default -> companion: default object -> class object in project code, builtins and libs 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 default object Instance {
|
||||
public class object Instance {
|
||||
val INTERNAL_MODE_PROPERTY = "kotlin.internal.mode.enabled"
|
||||
|
||||
public var enabled: Boolean
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.idea.stubindex.JetFunctionShortNameIndex
|
||||
|
||||
// used in Upsource, what's why in idea-analysis module
|
||||
public class JetShortNamesCache(private val project: com.intellij.openapi.project.Project) : com.intellij.psi.search.PsiShortNamesCache() {
|
||||
default object {
|
||||
class object {
|
||||
public fun getKotlinInstance(project: com.intellij.openapi.project.Project): org.jetbrains.kotlin.idea.caches.JetShortNamesCache
|
||||
= com.intellij.openapi.extensions.Extensions.getArea(project).getExtensionPoint<com.intellij.psi.search.PsiShortNamesCache>(com.intellij.psi.search.PsiShortNamesCache.EP_NAME).getExtensions()
|
||||
.firstIsInstance<JetShortNamesCache>()
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import kotlin.platform.platformStatic
|
||||
private val LOG = Logger.getInstance(javaClass<KotlinCacheService>())
|
||||
|
||||
public class KotlinCacheService(val project: Project) {
|
||||
default object {
|
||||
class object {
|
||||
platformStatic public fun getInstance(project: Project): KotlinCacheService = ServiceManager.getService(project, javaClass<KotlinCacheService>())!!
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import com.intellij.codeInsight.ExternalAnnotationsListener
|
||||
import com.intellij.psi.PsiModifierListOwner
|
||||
|
||||
class LibraryModificationTracker(project: Project) : SimpleModificationTracker() {
|
||||
default object {
|
||||
class object {
|
||||
platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<LibraryModificationTracker>())!!
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ private class ExceptionTrackerWithProcessCanceledReport() : ExceptionTracker() {
|
||||
}
|
||||
|
||||
|
||||
default object {
|
||||
class object {
|
||||
val LOG = Logger.getInstance(javaClass<ExceptionTrackerWithProcessCanceledReport>())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import com.intellij.openapi.util.SimpleModificationTracker
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
class ModuleTypeCacheManager private (project: Project) {
|
||||
default object {
|
||||
class object {
|
||||
platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<ModuleTypeCacheManager>())
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ public class KotlinClsStubBuilder : ClsStubBuilder() {
|
||||
return ClsStubBuilderComponents(classDataFinder, annotationLoader)
|
||||
}
|
||||
|
||||
default object {
|
||||
class object {
|
||||
val LOG = Logger.getInstance(javaClass<KotlinClsStubBuilder>())
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ public class DeserializerForDecompiler(val packageDirectory: VirtualFile, val di
|
||||
return MutablePackageFragmentDescriptor(moduleDescriptor, fqName)
|
||||
}
|
||||
|
||||
default object {
|
||||
class object {
|
||||
private val LOG = Logger.getInstance(javaClass<DeserializerForDecompiler>())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ public open class JetPsiChecker : Annotator, HighlightRangeExtension {
|
||||
}
|
||||
}
|
||||
|
||||
default object {
|
||||
class object {
|
||||
var namesHighlightingEnabled = true
|
||||
[TestOnly] set
|
||||
|
||||
|
||||
+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.Default.getNamesHighlightingEnabled()) {
|
||||
if (JetPsiChecker.OBJECT$.getNamesHighlightingEnabled()) {
|
||||
DeclarationDescriptor referenceTarget = bindingContext.get(BindingContext.REFERENCE_TARGET, expression);
|
||||
if (referenceTarget instanceof ConstructorDescriptor) {
|
||||
referenceTarget = referenceTarget.getContainingDeclaration();
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||
|
||||
public class OperatorToFunctionIntention : JetSelfTargetingIntention<JetExpression>("operator.to.function", javaClass()) {
|
||||
default object {
|
||||
class object {
|
||||
private fun isApplicablePrefix(element: JetPrefixExpression): Boolean {
|
||||
return when (element.getOperationReference().getReferencedNameElementType()) {
|
||||
JetTokens.PLUS, JetTokens.MINUS, JetTokens.PLUSPLUS, JetTokens.MINUSMINUS, JetTokens.EXCL -> true
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class JetForLoopInReference(element: JetForExpression) : JetMultiReferenc
|
||||
return LOOP_RANGE_KEYS.map { key -> context.get(key, loopRange)?.getCandidateDescriptor() }.filterNotNull()
|
||||
}
|
||||
|
||||
default object {
|
||||
class object {
|
||||
private val LOOP_RANGE_KEYS = array(
|
||||
BindingContext.LOOP_RANGE_ITERATOR_RESOLVED_CALL,
|
||||
BindingContext.LOOP_RANGE_NEXT_RESOLVED_CALL,
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public data class UsagesSearchLocation(
|
||||
val inStrings: Boolean = false,
|
||||
val inPlainText: Boolean = true
|
||||
) {
|
||||
default object {
|
||||
class object {
|
||||
public val DEFAULT: UsagesSearchLocation = UsagesSearchLocation()
|
||||
public val EVERYWHERE: UsagesSearchLocation = UsagesSearchLocation(true, true, true, true)
|
||||
}
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class SubpackagesIndexService(private val project: Project) {
|
||||
}
|
||||
}
|
||||
|
||||
default object {
|
||||
class object {
|
||||
public fun getInstance(project: Project): SubpackagesIndex {
|
||||
return ServiceManager.getService(project, javaClass<SubpackagesIndexService>())!!.cachedValue.getValue()!!
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public abstract class ImportInsertHelper {
|
||||
|
||||
public abstract fun importDescriptor(file: JetFile, descriptor: DeclarationDescriptor): ImportDescriptorResult
|
||||
|
||||
default object {
|
||||
class object {
|
||||
[platformStatic]
|
||||
public fun getInstance(project: Project): ImportInsertHelper
|
||||
= ServiceManager.getService<ImportInsertHelper>(project, javaClass<ImportInsertHelper>())
|
||||
|
||||
@@ -46,12 +46,12 @@ public class ShortenReferences(val options: (JetElement) -> Options = { Options.
|
||||
val removeThisLabels: Boolean = false,
|
||||
val removeThis: Boolean = false
|
||||
) {
|
||||
default object {
|
||||
class object {
|
||||
val DEFAULT = Options()
|
||||
}
|
||||
}
|
||||
|
||||
default object {
|
||||
class object {
|
||||
val DEFAULT = ShortenReferences()
|
||||
|
||||
private fun DeclarationDescriptor.asString()
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.psi.JetPsiFactory
|
||||
|
||||
public trait SimpleNameReferenceExtension {
|
||||
default object {
|
||||
class object {
|
||||
public val EP_NAME: ExtensionPointName<SimpleNameReferenceExtension> = ExtensionPointName.create("org.jetbrains.kotlin.simpleNameReferenceExtension")!!
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user