Remove all deprecated OBJECT$ usages from project code
This commit is contained in:
@@ -365,7 +365,7 @@ public abstract class MemberCodegen<T extends JetElement/* TODO: & JetDeclaratio
|
||||
CompileTimeConstant<?> initializerValue;
|
||||
if (property.isVar() && initializer != null) {
|
||||
BindingTrace tempTrace = TemporaryBindingTrace.create(state.getBindingTrace(), "property initializer");
|
||||
initializerValue = ConstantExpressionEvaluator.OBJECT$.evaluate(initializer, tempTrace, propertyDescriptor.getType());
|
||||
initializerValue = ConstantExpressionEvaluator.evaluate(initializer, tempTrace, propertyDescriptor.getType());
|
||||
}
|
||||
else {
|
||||
initializerValue = propertyDescriptor.getCompileTimeInitializer();
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport
|
||||
if (PackagePartClassUtils.getPackageFilesWithCallables(filesInPackage).isEmpty()) return Collections.emptyList();
|
||||
|
||||
//noinspection RedundantTypeArguments
|
||||
return UtilsPackage.<PsiClass>emptyOrSingletonList(KotlinLightClassForPackage.OBJECT$.create(psiManager, packageFqName, scope, filesInPackage));
|
||||
return UtilsPackage.<PsiClass>emptyOrSingletonList(KotlinLightClassForPackage.Factory.create(psiManager, packageFqName, scope, filesInPackage));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class JavaAnnotationImpl extends JavaElementImpl<PsiAnnotation> implement
|
||||
@Nullable
|
||||
public JavaAnnotationArgument findArgument(@NotNull Name name) {
|
||||
PsiAnnotationMemberValue attribute = getPsi().findAttributeValue(name.asString());
|
||||
return attribute == null ? null : JavaAnnotationArgumentImpl.OBJECT$.create(attribute, name);
|
||||
return attribute == null ? null : JavaAnnotationArgumentImpl.Factory.create(attribute, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ public class JavaElementCollectionFromPsiArrayUtil {
|
||||
String name = psiNameValuePair.getName();
|
||||
PsiAnnotationMemberValue value = psiNameValuePair.getValue();
|
||||
assert value != null : "Annotation argument value cannot be null: " + name;
|
||||
return JavaAnnotationArgumentImpl.OBJECT$.create(value, name == null ? null : Name.identifier(name));
|
||||
return JavaAnnotationArgumentImpl.Factory.create(value, name == null ? null : Name.identifier(name));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class JavaPropertyInitializerEvaluatorImpl implements JavaPropertyInitial
|
||||
if (evaluatedExpression != null) {
|
||||
return ConstantsPackage.createCompileTimeConstant(
|
||||
evaluatedExpression,
|
||||
ConstantExpressionEvaluator.OBJECT$.isPropertyCompileTimeConstant(descriptor),
|
||||
ConstantExpressionEvaluator.isPropertyCompileTimeConstant(descriptor),
|
||||
false,
|
||||
true,
|
||||
descriptor.getType());
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.name.Name
|
||||
abstract class JavaAnnotationArgumentImpl(
|
||||
override val name: Name?
|
||||
) : JavaAnnotationArgument {
|
||||
class object {
|
||||
class object Factory {
|
||||
fun create(argument: PsiAnnotationMemberValue, name: Name?): JavaAnnotationArgument {
|
||||
val value = JavaPsiFacade.getInstance(argument.getProject()).getConstantEvaluationHelper().computeConstantExpression(argument)
|
||||
if (value is Enum<*>) {
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public final class KotlinBinaryClassCache implements Disposable {
|
||||
@Override
|
||||
public VirtualFileKotlinClass compute() {
|
||||
//noinspection deprecation
|
||||
return VirtualFileKotlinClass.OBJECT$.create(file);
|
||||
return VirtualFileKotlinClass.Factory.create(file);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public class VirtualFileKotlinClass private(
|
||||
override fun hashCode() = file.hashCode()
|
||||
override fun toString() = "${javaClass.getSimpleName()}: $file"
|
||||
|
||||
class object {
|
||||
class object Factory {
|
||||
private val LOG = Logger.getInstance(javaClass<VirtualFileKotlinClass>())
|
||||
|
||||
deprecated("Use KotlinBinaryClassCache")
|
||||
|
||||
+4
-4
@@ -446,7 +446,7 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
|
||||
@NotNull Map<PseudoValue, TypePredicate> expectedTypes,
|
||||
@NotNull MagicKind kind
|
||||
) {
|
||||
MagicInstruction instruction = MagicInstruction.OBJECT$.create(
|
||||
MagicInstruction instruction = MagicInstruction.Factory.create(
|
||||
instructionElement, valueElement, getCurrentScope(), inputValues, expectedTypes, kind, valueFactory
|
||||
);
|
||||
add(instruction);
|
||||
@@ -456,7 +456,7 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
|
||||
@NotNull
|
||||
@Override
|
||||
public MergeInstruction merge(@NotNull JetExpression expression, @NotNull List<PseudoValue> inputValues) {
|
||||
MergeInstruction instruction = MergeInstruction.OBJECT$.create(expression, getCurrentScope(), inputValues, valueFactory);
|
||||
MergeInstruction instruction = MergeInstruction.Factory.create(expression, getCurrentScope(), inputValues, valueFactory);
|
||||
add(instruction);
|
||||
return instruction;
|
||||
}
|
||||
@@ -480,7 +480,7 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
|
||||
@NotNull Map<PseudoValue, ValueParameterDescriptor> arguments
|
||||
) {
|
||||
JetType returnType = resolvedCall.getResultingDescriptor().getReturnType();
|
||||
CallInstruction instruction = CallInstruction.OBJECT$.create(
|
||||
CallInstruction instruction = CallInstruction.Factory.create(
|
||||
valueElement,
|
||||
getCurrentScope(),
|
||||
resolvedCall,
|
||||
@@ -537,7 +537,7 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
|
||||
@NotNull Map<PseudoValue, ReceiverValue> receiverValues
|
||||
) {
|
||||
AccessTarget accessTarget = resolvedCall != null ? new AccessTarget.Call(resolvedCall) : AccessTarget.BlackBox.INSTANCE$;
|
||||
ReadValueInstruction instruction = ReadValueInstruction.OBJECT$.create(
|
||||
ReadValueInstruction instruction = ReadValueInstruction.Factory.create(
|
||||
expression, getCurrentScope(), accessTarget, receiverValues, valueFactory
|
||||
);
|
||||
add(instruction);
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ public class ReadValueInstruction private (
|
||||
override fun createCopy(): InstructionImpl =
|
||||
ReadValueInstruction(element, lexicalScope, target, receiverValues, outputValue)
|
||||
|
||||
class object {
|
||||
class object Factory {
|
||||
public fun create (
|
||||
element: JetElement,
|
||||
lexicalScope: LexicalScope,
|
||||
|
||||
+3
-3
@@ -79,7 +79,7 @@ public class CallInstruction private(
|
||||
override fun toString() =
|
||||
renderInstruction("call", "${render(element)}, ${resolvedCall.getResultingDescriptor()!!.getName()}")
|
||||
|
||||
class object {
|
||||
class object Factory {
|
||||
fun create (
|
||||
element: JetElement,
|
||||
lexicalScope: LexicalScope,
|
||||
@@ -115,7 +115,7 @@ public class MagicInstruction(
|
||||
|
||||
override fun toString() = renderInstruction("magic[$kind]", render(element))
|
||||
|
||||
class object {
|
||||
class object Factory {
|
||||
fun create(
|
||||
element: JetElement,
|
||||
valueElement: JetElement?,
|
||||
@@ -165,7 +165,7 @@ class MergeInstruction private(
|
||||
|
||||
override fun toString() = renderInstruction("merge", render(element))
|
||||
|
||||
class object {
|
||||
class object Factory {
|
||||
fun create(
|
||||
element: JetElement,
|
||||
lexicalScope: LexicalScope,
|
||||
|
||||
@@ -60,7 +60,7 @@ public interface KDocTokens {
|
||||
ILazyParseableElementType MARKDOWN_LINK = new ILazyParseableElementType("KDOC_MARKDOWN_LINK", JetLanguage.INSTANCE) {
|
||||
@Override
|
||||
public ASTNode parseContents(ASTNode chameleon) {
|
||||
return KDocLinkParser.OBJECT$.parseMarkdownLink(this, chameleon);
|
||||
return KDocLinkParser.parseMarkdownLink(this, chameleon);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,13 +23,14 @@ import com.intellij.lang.ASTNode
|
||||
import org.jetbrains.kotlin.lexer.JetTokens
|
||||
import org.jetbrains.kotlin.lexer.JetLexer
|
||||
import com.intellij.lang.PsiBuilderFactory
|
||||
import kotlin.platform.*
|
||||
|
||||
/**
|
||||
* Parses the contents of a Markdown link in KDoc. Uses the standard Kotlin lexer.
|
||||
*/
|
||||
class KDocLinkParser(): PsiParser {
|
||||
class object {
|
||||
public fun parseMarkdownLink(root: IElementType, chameleon: ASTNode): ASTNode {
|
||||
platformStatic public fun parseMarkdownLink(root: IElementType, chameleon: ASTNode): ASTNode {
|
||||
val parentElement = chameleon.getTreeParent().getPsi()
|
||||
val project = parentElement.getProject()
|
||||
val builder = PsiBuilderFactory.getInstance().createBuilder(project,
|
||||
|
||||
@@ -48,13 +48,13 @@ public class JetNameReferenceExpression extends JetExpressionImplStub<KotlinName
|
||||
if (stub != null) {
|
||||
return stub.getReferencedName();
|
||||
}
|
||||
return JetSimpleNameExpressionImpl.OBJECT$.getReferencedNameImpl(this);
|
||||
return JetSimpleNameExpressionImpl.Helper.getReferencedNameImpl(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Name getReferencedNameAsName() {
|
||||
return JetSimpleNameExpressionImpl.OBJECT$.getReferencedNameAsNameImpl(this);
|
||||
return JetSimpleNameExpressionImpl.Helper.getReferencedNameAsNameImpl(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,7 +76,7 @@ public class JetNameReferenceExpression extends JetExpressionImplStub<KotlinName
|
||||
@NotNull
|
||||
@Override
|
||||
public IElementType getReferencedNameElementType() {
|
||||
return JetSimpleNameExpressionImpl.OBJECT$.getReferencedNameElementTypeImpl(this);
|
||||
return JetSimpleNameExpressionImpl.Helper.getReferencedNameElementTypeImpl(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,7 +50,7 @@ abstract class JetSimpleNameExpressionImpl(node: ASTNode) : JetExpressionImpl(no
|
||||
override fun getReferencedName() = getReferencedNameImpl()
|
||||
|
||||
//NOTE: an unfortunate way to share an implementation between stubbed and not stubbed tree
|
||||
class object {
|
||||
class object Helper {
|
||||
|
||||
fun JetSimpleNameExpression.getReferencedNameElementTypeImpl(): IElementType {
|
||||
return this.getReferencedNameElement().getNode()!!.getElementType()!!
|
||||
|
||||
@@ -348,7 +348,7 @@ public class AnnotationResolver {
|
||||
for (ValueArgument argument : resolvedValueArgument.getArguments()) {
|
||||
JetExpression argumentExpression = argument.getArgumentExpression();
|
||||
if (argumentExpression != null) {
|
||||
CompileTimeConstant<?> constant = ConstantExpressionEvaluator.OBJECT$.evaluate(argumentExpression, trace, expectedType);
|
||||
CompileTimeConstant<?> constant = ConstantExpressionEvaluator.evaluate(argumentExpression, trace, expectedType);
|
||||
if (constant instanceof IntegerValueTypeConstant) {
|
||||
JetType defaultType = ((IntegerValueTypeConstant) constant).getType(expectedType);
|
||||
SimpleResolutionContext context =
|
||||
|
||||
@@ -130,7 +130,7 @@ public class CompileTimeConstantUtils {
|
||||
) {
|
||||
if (expression == null) return false;
|
||||
CompileTimeConstant<?> compileTimeConstant =
|
||||
ConstantExpressionEvaluator.OBJECT$.evaluate(expression, trace, KotlinBuiltIns.getInstance().getBooleanType());
|
||||
ConstantExpressionEvaluator.evaluate(expression, trace, KotlinBuiltIns.getInstance().getBooleanType());
|
||||
if (!(compileTimeConstant instanceof BooleanValue) || compileTimeConstant.usesVariableAsConstant()) return false;
|
||||
|
||||
Boolean value = ((BooleanValue) compileTimeConstant).getValue();
|
||||
|
||||
@@ -1095,7 +1095,7 @@ public class DescriptorResolver {
|
||||
public CompileTimeConstant<?> invoke() {
|
||||
JetExpression initializer = variable.getInitializer();
|
||||
JetType initializerType = expressionTypingServices.safeGetType(scope, initializer, variableType, dataFlowInfo, trace);
|
||||
CompileTimeConstant<?> constant = ConstantExpressionEvaluator.OBJECT$.evaluate(initializer, trace, initializerType);
|
||||
CompileTimeConstant<?> constant = ConstantExpressionEvaluator.evaluate(initializer, trace, initializerType);
|
||||
if (constant instanceof IntegerValueTypeConstant) {
|
||||
return EvaluatePackage.createCompileTimeConstantWithType((IntegerValueTypeConstant) constant, initializerType);
|
||||
}
|
||||
|
||||
@@ -298,6 +298,6 @@ public class ArgumentTypeResolver {
|
||||
return;
|
||||
}
|
||||
|
||||
ConstantExpressionEvaluator.OBJECT$.evaluate(expression, context.trace, numberType);
|
||||
ConstantExpressionEvaluator.evaluate(expression, context.trace, numberType);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -294,7 +294,7 @@ public class CallExpressionResolver {
|
||||
context.trace.record(BindingContext.EXPRESSION_TYPE, selectorExpression, selectorReturnType);
|
||||
}
|
||||
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.evaluate(expression, context.trace, context.expectedType);
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.evaluate(expression, context.trace, context.expectedType);
|
||||
if (value instanceof IntegerValueConstant && ((IntegerValueConstant) value).isPure()) {
|
||||
return BasicExpressionTypingVisitor.createCompileTimeConstantTypeInfo(value, expression, context);
|
||||
}
|
||||
|
||||
+3
-2
@@ -34,16 +34,17 @@ import java.math.BigInteger
|
||||
import org.jetbrains.kotlin.diagnostics.Errors
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
public class ConstantExpressionEvaluator private (val trace: BindingTrace) : JetVisitor<CompileTimeConstant<*>, JetType>() {
|
||||
|
||||
class object {
|
||||
public fun evaluate(expression: JetExpression, trace: BindingTrace, expectedType: JetType? = TypeUtils.NO_EXPECTED_TYPE): CompileTimeConstant<*>? {
|
||||
platformStatic public fun evaluate(expression: JetExpression, trace: BindingTrace, expectedType: JetType? = TypeUtils.NO_EXPECTED_TYPE): CompileTimeConstant<*>? {
|
||||
val evaluator = ConstantExpressionEvaluator(trace)
|
||||
return evaluator.evaluate(expression, expectedType)
|
||||
}
|
||||
|
||||
public fun isPropertyCompileTimeConstant(descriptor: VariableDescriptor): Boolean {
|
||||
platformStatic public fun isPropertyCompileTimeConstant(descriptor: VariableDescriptor): Boolean {
|
||||
if (descriptor.isVar()) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class LazyFileScope private(
|
||||
}
|
||||
}
|
||||
|
||||
class object {
|
||||
class object Factory {
|
||||
public fun create(
|
||||
resolveSession: ResolveSession,
|
||||
file: JetFile,
|
||||
|
||||
@@ -100,7 +100,7 @@ public class ScopeProvider implements DeclarationScopeProvider, FileScopeProvide
|
||||
|
||||
private LazyFileScope createFileScope(@NotNull JetFile file) {
|
||||
TemporaryBindingTrace tempTrace = TemporaryBindingTrace.create(resolveSession.getTrace(), "Transient trace for default imports lazy resolve");
|
||||
return LazyFileScope.OBJECT$.create(
|
||||
return LazyFileScope.Factory.create(
|
||||
resolveSession,
|
||||
file,
|
||||
defaultImports.invoke(),
|
||||
|
||||
+6
-5
@@ -120,7 +120,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
|
||||
@Override
|
||||
public JetTypeInfo visitConstantExpression(@NotNull JetConstantExpression expression, ExpressionTypingContext context) {
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.evaluate(expression, context.trace, context.expectedType);
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.evaluate(expression, context.trace, context.expectedType);
|
||||
|
||||
if (!(value instanceof IntegerValueTypeConstant)) {
|
||||
CompileTimeConstantChecker compileTimeConstantChecker = context.getCompileTimeConstantChecker();
|
||||
@@ -747,7 +747,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
result = returnType;
|
||||
}
|
||||
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.evaluate(expression, contextWithExpectedType.trace,
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.evaluate(expression, contextWithExpectedType.trace,
|
||||
contextWithExpectedType.expectedType);
|
||||
if (value != null) {
|
||||
return createCompileTimeConstantTypeInfo(value, expression, contextWithExpectedType);
|
||||
@@ -923,8 +923,9 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
context.trace.report(UNSUPPORTED.on(operationSign, "Unknown operation"));
|
||||
result = JetTypeInfo.create(null, context.dataFlowInfo);
|
||||
}
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.
|
||||
evaluate(expression, contextWithExpectedType.trace, contextWithExpectedType.expectedType);
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.evaluate(
|
||||
expression, contextWithExpectedType.trace, contextWithExpectedType.expectedType
|
||||
);
|
||||
if (value != null) {
|
||||
return createCompileTimeConstantTypeInfo(value, expression, contextWithExpectedType);
|
||||
}
|
||||
@@ -1267,7 +1268,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
}
|
||||
});
|
||||
}
|
||||
ConstantExpressionEvaluator.OBJECT$.evaluate(expression, context.trace, contextWithExpectedType.expectedType);
|
||||
ConstantExpressionEvaluator.evaluate(expression, context.trace, contextWithExpectedType.expectedType);
|
||||
return DataFlowUtils.checkType(components.builtIns.getStringType(), expression, contextWithExpectedType, dataFlowInfo[0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ public class DataFlowUtils {
|
||||
}
|
||||
|
||||
if (expression instanceof JetConstantExpression) {
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.evaluate(expression, c.trace, c.expectedType);
|
||||
CompileTimeConstant<?> value = ConstantExpressionEvaluator.evaluate(expression, c.trace, c.expectedType);
|
||||
if (value instanceof IntegerValueTypeConstant) {
|
||||
value = EvaluatePackage.createCompileTimeConstantWithType((IntegerValueTypeConstant) value, c.expectedType);
|
||||
}
|
||||
|
||||
+1
-1
@@ -392,7 +392,7 @@ public class ExpressionTypingServices {
|
||||
if (defaultValue != null) {
|
||||
getType(declaringScope, defaultValue, valueParameterDescriptor.getType(), dataFlowInfo, trace);
|
||||
if (DescriptorUtils.isAnnotationClass(DescriptorResolver.getContainingClass(declaringScope))) {
|
||||
ConstantExpressionEvaluator.OBJECT$.evaluate(defaultValue, trace, valueParameterDescriptor.getType());
|
||||
ConstantExpressionEvaluator.evaluate(defaultValue, trace, valueParameterDescriptor.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -214,7 +214,7 @@ public class KotlinLightClassForPackage private(
|
||||
}
|
||||
}
|
||||
|
||||
class object {
|
||||
class object Factory {
|
||||
public fun create(
|
||||
manager: PsiManager,
|
||||
qualifiedName: FqName,
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.idea.actions.internal
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
|
||||
public class KotlinInternalMode {
|
||||
public class object {
|
||||
public class object Instance {
|
||||
val INTERNAL_MODE_PROPERTY = "kotlin.internal.mode.enabled"
|
||||
|
||||
public var enabled: Boolean
|
||||
|
||||
+3
-4
@@ -90,7 +90,7 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
|
||||
Collections.sort(sortedFiles, jetFileComparator);
|
||||
|
||||
JetFile file = sortedFiles.get(0);
|
||||
ResolveSessionForBodies session = KotlinCacheService.OBJECT$.getInstance(file.getProject()).getLazyResolveSession(file);
|
||||
ResolveSessionForBodies session = KotlinCacheService.getInstance(file.getProject()).getLazyResolveSession(file);
|
||||
forceResolvePackageDeclarations(files, session);
|
||||
return new LightClassConstructionContext(session.getBindingContext(), session.getModuleDescriptor());
|
||||
}
|
||||
@@ -98,8 +98,7 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
|
||||
@NotNull
|
||||
@Override
|
||||
public LightClassConstructionContext getContextForClassOrObject(@NotNull JetClassOrObject classOrObject) {
|
||||
ResolveSessionForBodies session =
|
||||
KotlinCacheService.OBJECT$.getInstance(classOrObject.getProject()).getLazyResolveSession(classOrObject);
|
||||
ResolveSessionForBodies session = KotlinCacheService.getInstance(classOrObject.getProject()).getLazyResolveSession(classOrObject);
|
||||
|
||||
if (classOrObject.isLocal()) {
|
||||
BindingContext bindingContext = session.resolveToElement(classOrObject, BodyResolveMode.FULL);
|
||||
@@ -278,7 +277,7 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
|
||||
IdeaModuleInfo moduleInfo = info.getModuleInfo();
|
||||
if (moduleInfo instanceof ModuleSourceInfo) {
|
||||
KotlinLightClassForPackage lightClass =
|
||||
KotlinLightClassForPackage.OBJECT$.create(psiManager, packageFqName, moduleInfo.contentScope(), files);
|
||||
KotlinLightClassForPackage.Factory.create(psiManager, packageFqName, moduleInfo.contentScope(), files);
|
||||
if (lightClass == null) continue;
|
||||
|
||||
result.add(lightClass);
|
||||
|
||||
+2
-1
@@ -40,12 +40,13 @@ import org.jetbrains.kotlin.psi.JetDeclaration
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.resolve.scopes.JetScope
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
private val LOG = Logger.getInstance(javaClass<KotlinCacheService>())
|
||||
|
||||
public class KotlinCacheService(val project: Project) {
|
||||
class object {
|
||||
public fun getInstance(project: Project): KotlinCacheService = ServiceManager.getService(project, javaClass<KotlinCacheService>())!!
|
||||
platformStatic public fun getInstance(project: Project): KotlinCacheService = ServiceManager.getService(project, javaClass<KotlinCacheService>())!!
|
||||
}
|
||||
|
||||
public fun getResolutionFacade(elements: List<JetElement>): ResolutionFacade {
|
||||
|
||||
+1
-1
@@ -27,6 +27,6 @@ public abstract class JetModuleTypeManager {
|
||||
|
||||
public abstract boolean isAndroidGradleModule(@NotNull Module module);
|
||||
public boolean isGradleModule(@NotNull Module module) {
|
||||
return ModuleTypeCacheManager.OBJECT$.geInstance(module.getProject()).isGradleModule(module);
|
||||
return ModuleTypeCacheManager.getInstance(module.getProject()).isGradleModule(module);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,10 +29,11 @@ import com.intellij.openapi.vfs.VirtualFileMoveEvent
|
||||
import com.intellij.openapi.vfs.VirtualFileCopyEvent
|
||||
import com.intellij.openapi.vfs.VirtualFilePropertyEvent
|
||||
import com.intellij.openapi.util.SimpleModificationTracker
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
class ModuleTypeCacheManager private (project: Project) {
|
||||
class object {
|
||||
fun geInstance(project: Project) = ServiceManager.getService(project, javaClass<ModuleTypeCacheManager>())
|
||||
platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<ModuleTypeCacheManager>())
|
||||
}
|
||||
|
||||
private val vfsModificationTracker = VfsModificationTracker(project)
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
public class DebugInfoAnnotator implements Annotator {
|
||||
|
||||
public static boolean isDebugInfoEnabled() {
|
||||
return KotlinInternalMode.OBJECT$.getEnabled();
|
||||
return KotlinInternalMode.Instance.getEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ class TypeKindHighlightingVisitor extends AfterAnalysisHighlightingVisitor {
|
||||
public void visitSimpleNameExpression(@NotNull JetSimpleNameExpression expression) {
|
||||
PsiReference ref = expression.getReference();
|
||||
if (ref == null) return;
|
||||
if (JetPsiChecker.OBJECT$.getNamesHighlightingEnabled()) {
|
||||
if (JetPsiChecker.Default.getNamesHighlightingEnabled()) {
|
||||
DeclarationDescriptor referenceTarget = bindingContext.get(BindingContext.REFERENCE_TARGET, expression);
|
||||
if (referenceTarget instanceof ConstructorDescriptor) {
|
||||
referenceTarget = referenceTarget.getContainingDeclaration();
|
||||
|
||||
@@ -122,7 +122,7 @@ public class QuickFixRegistrar {
|
||||
QuickFixes.factories.put(NO_BACKING_FIELD_CUSTOM_ACCESSORS, changeToPropertyNameFactory);
|
||||
QuickFixes.factories.put(INACCESSIBLE_BACKING_FIELD, changeToPropertyNameFactory);
|
||||
|
||||
JetSingleIntentionActionFactory unresolvedReferenceFactory = AutoImportFix.OBJECT$.createFactory();
|
||||
JetSingleIntentionActionFactory unresolvedReferenceFactory = AutoImportFix.Default.createFactory();
|
||||
QuickFixes.factories.put(UNRESOLVED_REFERENCE, unresolvedReferenceFactory);
|
||||
QuickFixes.factories.put(UNRESOLVED_REFERENCE_WRONG_RECEIVER, unresolvedReferenceFactory);
|
||||
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase {
|
||||
final JetExpression originalBody = originalDeclaration.getBodyExpression();
|
||||
assert originalBody != null : "Original body is not found: " + originalDeclaration;
|
||||
|
||||
JetDeclarationWithBody newDeclaration = ConvertToBlockBodyAction.OBJECT$.convert(originalDeclaration);
|
||||
JetDeclarationWithBody newDeclaration = ConvertToBlockBodyAction.Default.convert(originalDeclaration);
|
||||
|
||||
JetBlockExpression newCommonContainer = (JetBlockExpression) newDeclaration.getBodyExpression();
|
||||
assert newCommonContainer != null : "New body is not found: " + newDeclaration;
|
||||
|
||||
@@ -38,11 +38,11 @@ public abstract class AbstractJetPsiCheckerTest extends JetLightCodeInsightFixtu
|
||||
//noinspection unchecked
|
||||
myFixture.enableInspections(SpellCheckingInspection.class);
|
||||
|
||||
JetPsiChecker.OBJECT$.setNamesHighlightingEnabled(false);
|
||||
JetPsiChecker.Default.setNamesHighlightingEnabled(false);
|
||||
checkHighlighting(true, true, false);
|
||||
}
|
||||
finally {
|
||||
JetPsiChecker.OBJECT$.setNamesHighlightingEnabled(true);
|
||||
JetPsiChecker.Default.setNamesHighlightingEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,13 +52,13 @@ public abstract class JetLightCodeInsightFixtureTestCase extends LightCodeInsigh
|
||||
((StartupManagerImpl) StartupManager.getInstance(getProject())).runPostStartupActivities();
|
||||
VfsRootAccess.allowRootAccess(JetTestUtils.getHomeDirectory());
|
||||
|
||||
kotlinInternalModeOriginalValue = KotlinInternalMode.OBJECT$.getEnabled();
|
||||
KotlinInternalMode.OBJECT$.setEnabled(true);
|
||||
kotlinInternalModeOriginalValue = KotlinInternalMode.Instance.getEnabled();
|
||||
KotlinInternalMode.Instance.setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
KotlinInternalMode.OBJECT$.setEnabled(kotlinInternalModeOriginalValue);
|
||||
KotlinInternalMode.Instance.setEnabled(kotlinInternalModeOriginalValue);
|
||||
VfsRootAccess.disallowRootAccess(JetTestUtils.getHomeDirectory());
|
||||
|
||||
Set<JetFile> builtInsSources = getProject().getComponent(BuiltInsReferenceResolver.class).getBuiltInsSources();
|
||||
|
||||
@@ -94,7 +94,7 @@ public final class AnnotationsUtils {
|
||||
}
|
||||
|
||||
for (DeclarationDescriptor descriptor : descriptors) {
|
||||
for (PredefinedAnnotation annotation : PredefinedAnnotation.OBJECT$.getWITH_CUSTOM_NAME()) {
|
||||
for (PredefinedAnnotation annotation : PredefinedAnnotation.Default.getWITH_CUSTOM_NAME()) {
|
||||
if (!hasAnnotationOrInsideAnnotatedClass(descriptor, annotation)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user