Remove all deprecated OBJECT$ usages from project code
This commit is contained in:
+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();
|
||||
|
||||
Reference in New Issue
Block a user