Get rid of 'class object' usages in code and builtins
Replace some comments and library usages as well
This commit is contained in:
@@ -76,7 +76,7 @@ class PlatformStaticGenerator(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
[platformStatic]
|
[platformStatic]
|
||||||
public fun createStaticFunctionDescriptor(descriptor: FunctionDescriptor): FunctionDescriptor {
|
public fun createStaticFunctionDescriptor(descriptor: FunctionDescriptor): FunctionDescriptor {
|
||||||
val memberDescriptor = if (descriptor is PropertyAccessorDescriptor) descriptor.getCorrespondingProperty() else descriptor
|
val memberDescriptor = if (descriptor is PropertyAccessorDescriptor) descriptor.getCorrespondingProperty() else descriptor
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.jetbrains.kotlin.psi.JetNamedFunction
|
|||||||
|
|
||||||
data public class SourceInfo(val source: String, val pathOrCleanFQN: String, val linesInFile: Int) {
|
data public class SourceInfo(val source: String, val pathOrCleanFQN: String, val linesInFile: Int) {
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
fun createInfo(element: JetElement?, internalClassName: String): SourceInfo {
|
fun createInfo(element: JetElement?, internalClassName: String): SourceInfo {
|
||||||
assert(element != null) { "Couldn't create source mapper for null element " + internalClassName }
|
assert(element != null) { "Couldn't create source mapper for null element " + internalClassName }
|
||||||
val lineNumbers = CodegenUtil.getLineNumberForElement(element!!.getContainingFile(), true)
|
val lineNumbers = CodegenUtil.getLineNumberForElement(element!!.getContainingFile(), true)
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.descriptors.*
|
|||||||
import org.jetbrains.kotlin.resolve.*
|
import org.jetbrains.kotlin.resolve.*
|
||||||
|
|
||||||
public trait ExpressionCodegenExtension {
|
public trait ExpressionCodegenExtension {
|
||||||
class object : ProjectExtensionDescriptor<ExpressionCodegenExtension>("org.jetbrains.kotlin.expressionCodegenExtension", javaClass<ExpressionCodegenExtension>())
|
companion object : ProjectExtensionDescriptor<ExpressionCodegenExtension>("org.jetbrains.kotlin.expressionCodegenExtension", javaClass<ExpressionCodegenExtension>())
|
||||||
|
|
||||||
public class Context(
|
public class Context(
|
||||||
public val typeMapper: JetTypeMapper,
|
public val typeMapper: JetTypeMapper,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils
|
|||||||
|
|
||||||
public class ReifiedTypeInliner(private val parametersMapping: ReifiedTypeParameterMappings?) {
|
public class ReifiedTypeInliner(private val parametersMapping: ReifiedTypeParameterMappings?) {
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val NEW_ARRAY_MARKER_METHOD_NAME: String = "reifyNewArray"
|
public val NEW_ARRAY_MARKER_METHOD_NAME: String = "reifyNewArray"
|
||||||
public val CHECKCAST_MARKER_METHOD_NAME: String = "reifyCheckcast"
|
public val CHECKCAST_MARKER_METHOD_NAME: String = "reifyCheckcast"
|
||||||
public val INSTANCEOF_MARKER_METHOD_NAME: String = "reifyInstanceof"
|
public val INSTANCEOF_MARKER_METHOD_NAME: String = "reifyInstanceof"
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ trait SourceMapper {
|
|||||||
parent?.visitOrigin()
|
parent?.visitOrigin()
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
|
|
||||||
fun flushToClassBuilder(mapper: SourceMapper, v: ClassBuilder) {
|
fun flushToClassBuilder(mapper: SourceMapper, v: ClassBuilder) {
|
||||||
for (fileMapping in mapper.resultMappings) {
|
for (fileMapping in mapper.resultMappings) {
|
||||||
@@ -253,7 +253,7 @@ class SMAP(val fileMappings: List<FileMapping>) {
|
|||||||
sourceInfo = SourceInfo(default.name, default.path, defaultMapping.source + defaultMapping.range - 1)
|
sourceInfo = SourceInfo(default.name, default.path, defaultMapping.source + defaultMapping.range - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
val FILE_SECTION = "*F"
|
val FILE_SECTION = "*F"
|
||||||
|
|
||||||
val LINE_SECTION = "*L"
|
val LINE_SECTION = "*L"
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ import javax.inject.Inject
|
|||||||
|
|
||||||
public class TraceBasedErrorReporter : ErrorReporter {
|
public class TraceBasedErrorReporter : ErrorReporter {
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LOG = Logger.getInstance(javaClass<TraceBasedErrorReporter>())
|
private val LOG = Logger.getInstance(javaClass<TraceBasedErrorReporter>())
|
||||||
|
|
||||||
public val ABI_VERSION_ERRORS: WritableSlice<String, AbiVersionErrorData> = Slices.createCollectiveSlice()
|
public val ABI_VERSION_ERRORS: WritableSlice<String, AbiVersionErrorData> = Slices.createCollectiveSlice()
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.name.Name
|
|||||||
abstract class JavaAnnotationArgumentImpl(
|
abstract class JavaAnnotationArgumentImpl(
|
||||||
override val name: Name?
|
override val name: Name?
|
||||||
) : JavaAnnotationArgument {
|
) : JavaAnnotationArgument {
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
fun create(argument: PsiAnnotationMemberValue, name: Name?): JavaAnnotationArgument {
|
fun create(argument: PsiAnnotationMemberValue, name: Name?): JavaAnnotationArgument {
|
||||||
val value = JavaPsiFacade.getInstance(argument.getProject()).getConstantEvaluationHelper().computeConstantExpression(argument)
|
val value = JavaPsiFacade.getInstance(argument.getProject()).getConstantEvaluationHelper().computeConstantExpression(argument)
|
||||||
if (value is Enum<*>) {
|
if (value is Enum<*>) {
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ public class VirtualFileKotlinClass private(
|
|||||||
override fun hashCode() = file.hashCode()
|
override fun hashCode() = file.hashCode()
|
||||||
override fun toString() = "${javaClass.getSimpleName()}: $file"
|
override fun toString() = "${javaClass.getSimpleName()}: $file"
|
||||||
|
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
private val LOG = Logger.getInstance(javaClass<VirtualFileKotlinClass>())
|
private val LOG = Logger.getInstance(javaClass<VirtualFileKotlinClass>())
|
||||||
|
|
||||||
deprecated("Use KotlinBinaryClassCache")
|
deprecated("Use KotlinBinaryClassCache")
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ public class JvmDeclarationOrigin(
|
|||||||
public val element: PsiElement?,
|
public val element: PsiElement?,
|
||||||
public val descriptor: DeclarationDescriptor?
|
public val descriptor: DeclarationDescriptor?
|
||||||
) {
|
) {
|
||||||
class object {
|
companion object {
|
||||||
public val NO_ORIGIN: JvmDeclarationOrigin = JvmDeclarationOrigin(OTHER, null, null)
|
public val NO_ORIGIN: JvmDeclarationOrigin = JvmDeclarationOrigin(OTHER, null, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public data open class AnalysisResult protected (
|
|||||||
|
|
||||||
private class Error(bindingContext: BindingContext, val exception: Throwable) : AnalysisResult(bindingContext, ErrorUtils.getErrorModule())
|
private class Error(bindingContext: BindingContext, val exception: Throwable) : AnalysisResult(bindingContext, ErrorUtils.getErrorModule())
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val EMPTY: AnalysisResult = success(BindingContext.EMPTY, ErrorUtils.getErrorModule())
|
public val EMPTY: AnalysisResult = success(BindingContext.EMPTY, ErrorUtils.getErrorModule())
|
||||||
|
|
||||||
platformStatic public fun success(bindingContext: BindingContext, module: ModuleDescriptor): AnalysisResult {
|
platformStatic public fun success(bindingContext: BindingContext, module: ModuleDescriptor): AnalysisResult {
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ public class ReadValueInstruction private (
|
|||||||
override fun createCopy(): InstructionImpl =
|
override fun createCopy(): InstructionImpl =
|
||||||
ReadValueInstruction(element, lexicalScope, target, receiverValues, outputValue)
|
ReadValueInstruction(element, lexicalScope, target, receiverValues, outputValue)
|
||||||
|
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
public fun create (
|
public fun create (
|
||||||
element: JetElement,
|
element: JetElement,
|
||||||
lexicalScope: LexicalScope,
|
lexicalScope: LexicalScope,
|
||||||
|
|||||||
+3
-3
@@ -79,7 +79,7 @@ public class CallInstruction private(
|
|||||||
override fun toString() =
|
override fun toString() =
|
||||||
renderInstruction("call", "${render(element)}, ${resolvedCall.getResultingDescriptor()!!.getName()}")
|
renderInstruction("call", "${render(element)}, ${resolvedCall.getResultingDescriptor()!!.getName()}")
|
||||||
|
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
fun create (
|
fun create (
|
||||||
element: JetElement,
|
element: JetElement,
|
||||||
lexicalScope: LexicalScope,
|
lexicalScope: LexicalScope,
|
||||||
@@ -115,7 +115,7 @@ public class MagicInstruction(
|
|||||||
|
|
||||||
override fun toString() = renderInstruction("magic[$kind]", render(element))
|
override fun toString() = renderInstruction("magic[$kind]", render(element))
|
||||||
|
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
fun create(
|
fun create(
|
||||||
element: JetElement,
|
element: JetElement,
|
||||||
valueElement: JetElement?,
|
valueElement: JetElement?,
|
||||||
@@ -165,7 +165,7 @@ class MergeInstruction private(
|
|||||||
|
|
||||||
override fun toString() = renderInstruction("merge", render(element))
|
override fun toString() = renderInstruction("merge", render(element))
|
||||||
|
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
fun create(
|
fun create(
|
||||||
element: JetElement,
|
element: JetElement,
|
||||||
lexicalScope: LexicalScope,
|
lexicalScope: LexicalScope,
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.analyzer.ModuleInfo
|
|||||||
import org.jetbrains.kotlin.psi.JetFile
|
import org.jetbrains.kotlin.psi.JetFile
|
||||||
|
|
||||||
public trait ExternalDeclarationsProvider {
|
public trait ExternalDeclarationsProvider {
|
||||||
class object : ProjectExtensionDescriptor<ExternalDeclarationsProvider>(
|
companion object : ProjectExtensionDescriptor<ExternalDeclarationsProvider>(
|
||||||
"org.jetbrains.kotlin.externalDeclarationsProvider",
|
"org.jetbrains.kotlin.externalDeclarationsProvider",
|
||||||
javaClass<ExternalDeclarationsProvider>()
|
javaClass<ExternalDeclarationsProvider>()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import kotlin.platform.*
|
|||||||
* Parses the contents of a Markdown link in KDoc. Uses the standard Kotlin lexer.
|
* Parses the contents of a Markdown link in KDoc. Uses the standard Kotlin lexer.
|
||||||
*/
|
*/
|
||||||
class KDocLinkParser(): PsiParser {
|
class KDocLinkParser(): PsiParser {
|
||||||
class object {
|
companion object {
|
||||||
platformStatic public fun parseMarkdownLink(root: IElementType, chameleon: ASTNode): ASTNode {
|
platformStatic public fun parseMarkdownLink(root: IElementType, chameleon: ASTNode): ASTNode {
|
||||||
val parentElement = chameleon.getTreeParent().getPsi()
|
val parentElement = chameleon.getTreeParent().getPsi()
|
||||||
val project = parentElement.getProject()
|
val project = parentElement.getProject()
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public abstract class JetCodeFragment(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val IMPORT_SEPARATOR: String = ","
|
public val IMPORT_SEPARATOR: String = ","
|
||||||
public val RUNTIME_TYPE_EVALUATOR: Key<Function1<JetExpression, JetType?>> = Key.create("RUNTIME_TYPE_EVALUATOR")
|
public val RUNTIME_TYPE_EVALUATOR: Key<Function1<JetExpression, JetType?>> = Key.create("RUNTIME_TYPE_EVALUATOR")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ abstract class JetSimpleNameExpressionImpl(node: ASTNode) : JetExpressionImpl(no
|
|||||||
override fun getReferencedName() = getReferencedNameImpl()
|
override fun getReferencedName() = getReferencedNameImpl()
|
||||||
|
|
||||||
//NOTE: an unfortunate way to share an implementation between stubbed and not stubbed tree
|
//NOTE: an unfortunate way to share an implementation between stubbed and not stubbed tree
|
||||||
class object Helper {
|
companion object Helper {
|
||||||
|
|
||||||
fun JetSimpleNameExpression.getReferencedNameElementTypeImpl(): IElementType {
|
fun JetSimpleNameExpression.getReferencedNameElementTypeImpl(): IElementType {
|
||||||
return this.getReferencedNameElement().getNode()!!.getElementType()!!
|
return this.getReferencedNameElement().getNode()!!.getElementType()!!
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public open class KotlinStubBaseImpl<T : JetElementImplStub<*>>(parent: StubElem
|
|||||||
return methodName
|
return methodName
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LOGGER: Logger = Logger.getInstance(javaClass<KotlinStubBaseImpl<JetElementImplStub<*>>>())
|
private val LOGGER: Logger = Logger.getInstance(javaClass<KotlinStubBaseImpl<JetElementImplStub<*>>>())
|
||||||
|
|
||||||
private val BASE_STUB_INTERFACES = listOf(javaClass<KotlinStubWithFqName<*>>(), javaClass<KotlinClassOrObjectStub<*>>(), javaClass<NamedStub<*>>())
|
private val BASE_STUB_INTERFACES = listOf(javaClass<KotlinStubWithFqName<*>>(), javaClass<KotlinClassOrObjectStub<*>>(), javaClass<NamedStub<*>>())
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public trait CodeAnalyzerInitializer {
|
|||||||
public fun initialize(trace: BindingTrace, module: ModuleDescriptor, codeAnalyzer: KotlinCodeAnalyzer?)
|
public fun initialize(trace: BindingTrace, module: ModuleDescriptor, codeAnalyzer: KotlinCodeAnalyzer?)
|
||||||
public fun createTrace(): BindingTrace
|
public fun createTrace(): BindingTrace
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public fun getInstance(project: Project): CodeAnalyzerInitializer =
|
public fun getInstance(project: Project): CodeAnalyzerInitializer =
|
||||||
ServiceManager.getService<CodeAnalyzerInitializer>(project, javaClass<CodeAnalyzerInitializer>())!!
|
ServiceManager.getService<CodeAnalyzerInitializer>(project, javaClass<CodeAnalyzerInitializer>())!!
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class CompositeBindingContext private (
|
|||||||
private val delegates: List<BindingContext>
|
private val delegates: List<BindingContext>
|
||||||
) : BindingContext {
|
) : BindingContext {
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public fun create(delegates: List<BindingContext>): BindingContext {
|
public fun create(delegates: List<BindingContext>): BindingContext {
|
||||||
if (delegates.isEmpty()) return BindingContext.EMPTY
|
if (delegates.isEmpty()) return BindingContext.EMPTY
|
||||||
if (delegates.size() == 1) return delegates.first()
|
if (delegates.size() == 1) return delegates.first()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public open class StatementFilter {
|
|||||||
public open val filter: ((JetElement) -> Boolean)?
|
public open val filter: ((JetElement) -> Boolean)?
|
||||||
get() = null
|
get() = null
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val NONE: StatementFilter = StatementFilter()
|
public val NONE: StatementFilter = StatementFilter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ public class TypeResolver(
|
|||||||
return classifierDescriptor
|
return classifierDescriptor
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
[platformStatic]
|
[platformStatic]
|
||||||
public fun resolveProjectionKind(projectionKind: JetProjectionKind): Variance {
|
public fun resolveProjectionKind(projectionKind: JetProjectionKind): Variance {
|
||||||
return when (projectionKind) {
|
return when (projectionKind) {
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class VarianceChecker(private val trace: BindingTrace) {
|
|||||||
val occurrencePosition: Variance
|
val occurrencePosition: Variance
|
||||||
)
|
)
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
platformStatic fun recordPrivateToThisIfNeeded(trace: BindingTrace, descriptor: CallableMemberDescriptor) {
|
platformStatic fun recordPrivateToThisIfNeeded(trace: BindingTrace, descriptor: CallableMemberDescriptor) {
|
||||||
if (isIrrelevant(descriptor) || descriptor.getVisibility() != Visibilities.PRIVATE) return
|
if (isIrrelevant(descriptor) || descriptor.getVisibility() != Visibilities.PRIVATE) return
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -47,8 +47,8 @@ public class CallableDescriptorCollectors<D : CallableDescriptor>(val collectors
|
|||||||
Iterable<CallableDescriptorCollector<D>> {
|
Iterable<CallableDescriptorCollector<D>> {
|
||||||
override fun iterator(): Iterator<CallableDescriptorCollector<D>> = collectors.iterator()
|
override fun iterator(): Iterator<CallableDescriptorCollector<D>> = collectors.iterator()
|
||||||
|
|
||||||
[suppress("UNCHECKED_CAST")]
|
[suppress("UNCHECKED_CAST")] companion
|
||||||
class object {
|
object {
|
||||||
public val FUNCTIONS_AND_VARIABLES: CallableDescriptorCollectors<CallableDescriptor> =
|
public val FUNCTIONS_AND_VARIABLES: CallableDescriptorCollectors<CallableDescriptor> =
|
||||||
CallableDescriptorCollectors(listOf(
|
CallableDescriptorCollectors(listOf(
|
||||||
FUNCTIONS_COLLECTOR as CallableDescriptorCollector<CallableDescriptor>,
|
FUNCTIONS_COLLECTOR as CallableDescriptorCollector<CallableDescriptor>,
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ import kotlin.platform.platformStatic
|
|||||||
|
|
||||||
public class ConstantExpressionEvaluator private (val trace: BindingTrace) : JetVisitor<CompileTimeConstant<*>, JetType>() {
|
public class ConstantExpressionEvaluator private (val trace: BindingTrace) : JetVisitor<CompileTimeConstant<*>, JetType>() {
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
platformStatic 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)
|
val evaluator = ConstantExpressionEvaluator(trace)
|
||||||
return evaluator.evaluate(expression, expectedType)
|
return evaluator.evaluate(expression, expectedType)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public trait Diagnostics : Iterable<Diagnostic> {
|
|||||||
|
|
||||||
override fun iterator() = all().iterator()
|
override fun iterator() = all().iterator()
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val EMPTY: Diagnostics = object : Diagnostics {
|
public val EMPTY: Diagnostics = object : Diagnostics {
|
||||||
override fun noSuppression(): Diagnostics = this
|
override fun noSuppression(): Diagnostics = this
|
||||||
override val modificationTracker: ModificationTracker = ModificationTracker.NEVER_CHANGED
|
override val modificationTracker: ModificationTracker = ModificationTracker.NEVER_CHANGED
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class LazyFileScope private(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
public fun create(
|
public fun create(
|
||||||
resolveSession: ResolveSession,
|
resolveSession: ResolveSession,
|
||||||
file: JetFile,
|
file: JetFile,
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ public abstract class DeclarationProviderFactoryService {
|
|||||||
filesScope: GlobalSearchScope
|
filesScope: GlobalSearchScope
|
||||||
): DeclarationProviderFactory
|
): DeclarationProviderFactory
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public platformStatic fun createDeclarationProviderFactory(
|
public platformStatic fun createDeclarationProviderFactory(
|
||||||
project: Project,
|
project: Project,
|
||||||
storageManager: StorageManager,
|
storageManager: StorageManager,
|
||||||
|
|||||||
+1
-1
@@ -319,7 +319,7 @@ public open class LazyClassMemberScope(
|
|||||||
// Do not add details here, they may compromise the laziness during debugging
|
// Do not add details here, they may compromise the laziness during debugging
|
||||||
override fun toString() = "lazy scope for class ${thisDescriptor.getName()}"
|
override fun toString() = "lazy scope for class ${thisDescriptor.getName()}"
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val EXTRACT_FUNCTIONS: MemberExtractor<FunctionDescriptor> = object : MemberExtractor<FunctionDescriptor> {
|
private val EXTRACT_FUNCTIONS: MemberExtractor<FunctionDescriptor> = object : MemberExtractor<FunctionDescriptor> {
|
||||||
override fun extract(extractFrom: JetType, name: Name): Collection<FunctionDescriptor> {
|
override fun extract(extractFrom: JetType, name: Name): Collection<FunctionDescriptor> {
|
||||||
return extractFrom.getMemberScope().getFunctions(name)
|
return extractFrom.getMemberScope().getFunctions(name)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public trait Qualifier: ReceiverValue {
|
|||||||
public val name: Name
|
public val name: Name
|
||||||
get() = classifier?.getName() ?: packageView!!.getName()
|
get() = classifier?.getName() ?: packageView!!.getName()
|
||||||
|
|
||||||
// package, classifier or class object descriptor
|
// package, classifier or companion object descriptor
|
||||||
public val resultingDescriptor: DeclarationDescriptor
|
public val resultingDescriptor: DeclarationDescriptor
|
||||||
|
|
||||||
public val scope: JetScope
|
public val scope: JetScope
|
||||||
|
|||||||
+1
-1
@@ -87,7 +87,7 @@ public class KotlinCodeBlockModificationListener(modificationTracker: PsiModific
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LOG = Logger.getInstance("#org.jetbrains.kotlin.asJava.JetCodeBlockModificationListener")
|
private val LOG = Logger.getInstance("#org.jetbrains.kotlin.asJava.JetCodeBlockModificationListener")
|
||||||
|
|
||||||
private fun containsClassesInside(element: PsiElement?): Boolean {
|
private fun containsClassesInside(element: PsiElement?): Boolean {
|
||||||
|
|||||||
+2
-2
@@ -65,7 +65,7 @@ public class KotlinLightClassForPackage private(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public fun getInstance(project: Project): FileStubCache {
|
public fun getInstance(project: Project): FileStubCache {
|
||||||
return ServiceManager.getService<FileStubCache>(project, javaClass<FileStubCache>())
|
return ServiceManager.getService<FileStubCache>(project, javaClass<FileStubCache>())
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ public class KotlinLightClassForPackage private(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
public fun create(
|
public fun create(
|
||||||
manager: PsiManager,
|
manager: PsiManager,
|
||||||
qualifiedName: FqName,
|
qualifiedName: FqName,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.config.CompilerConfigurationKey
|
|||||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||||
|
|
||||||
public trait ComponentRegistrar {
|
public trait ComponentRegistrar {
|
||||||
class object {
|
companion object {
|
||||||
public val PLUGIN_COMPONENT_REGISTRARS: CompilerConfigurationKey<MutableList<ComponentRegistrar>> = CompilerConfigurationKey.create("plugin component registrars")
|
public val PLUGIN_COMPONENT_REGISTRARS: CompilerConfigurationKey<MutableList<ComponentRegistrar>> = CompilerConfigurationKey.create("plugin component registrars")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public trait AbstractSMAPBaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SMAPAndFile(val smap: String?, val sourceFile: String) {
|
class SMAPAndFile(val smap: String?, val sourceFile: String) {
|
||||||
class object {
|
companion object {
|
||||||
fun SMAPAndFile(smap: String?, sourceFile: File) = SMAPAndFile(smap, getPath(sourceFile))
|
fun SMAPAndFile(smap: String?, sourceFile: File) = SMAPAndFile(smap, getPath(sourceFile))
|
||||||
|
|
||||||
public fun getPath(file: File): String {
|
public fun getPath(file: File): String {
|
||||||
|
|||||||
+1
-1
@@ -165,7 +165,7 @@ public class MultiModuleJavaAnalysisCustomTest : UsefulTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
val PATH_TO_TEST_ROOT_DIR = "compiler/testData/multiModule/java/custom"
|
val PATH_TO_TEST_ROOT_DIR = "compiler/testData/multiModule/java/custom"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ import java.net.URLClassLoader
|
|||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
public abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() {
|
public abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() {
|
||||||
class object {
|
companion object {
|
||||||
private val renderer = DescriptorRendererBuilder()
|
private val renderer = DescriptorRendererBuilder()
|
||||||
.setWithDefinedIn(false)
|
.setWithDefinedIn(false)
|
||||||
.setExcludedAnnotationClasses(listOf(
|
.setExcludedAnnotationClasses(listOf(
|
||||||
|
|||||||
+1
-1
@@ -108,7 +108,7 @@ public abstract class AbstractEvaluateExpressionTest : AbstractAnnotationDescrip
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
val pattern = Pattern.compile(".+(?=:)")
|
val pattern = Pattern.compile(".+(?=:)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.config
|
|||||||
import java.util.HashMap
|
import java.util.HashMap
|
||||||
|
|
||||||
public class Services private(private val map: Map<Class<*>, Any>) {
|
public class Services private(private val map: Map<Class<*>, Any>) {
|
||||||
class object {
|
companion object {
|
||||||
public val EMPTY: Services = Builder().build()
|
public val EMPTY: Services = Builder().build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ package kotlin
|
|||||||
* information on enum classes.
|
* information on enum classes.
|
||||||
*/
|
*/
|
||||||
public abstract class Enum<E : Enum<E>>(name: String, ordinal: Int): Comparable<E> {
|
public abstract class Enum<E : Enum<E>>(name: String, ordinal: Int): Comparable<E> {
|
||||||
class object Companion {}
|
companion object {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of this enum constant, exactly as declared in its enum declaration.
|
* Returns the name of this enum constant, exactly as declared in its enum declaration.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package kotlin
|
|||||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `byte`.
|
* On the JVM, non-nullable values of this type are represented as values of the primitive type `byte`.
|
||||||
*/
|
*/
|
||||||
public class Byte private () : Number, Comparable<Byte> {
|
public class Byte private () : Number, Comparable<Byte> {
|
||||||
class object Companion {}
|
companion object {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this value with the specified value for order.
|
* Compares this value with the specified value for order.
|
||||||
@@ -181,7 +181,7 @@ public class Byte private () : Number, Comparable<Byte> {
|
|||||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `char`.
|
* On the JVM, non-nullable values of this type are represented as values of the primitive type `char`.
|
||||||
*/
|
*/
|
||||||
public class Char private () : Comparable<Char> {
|
public class Char private () : Comparable<Char> {
|
||||||
class object Companion {}
|
companion object {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares the character code of this character with the specified value for order.
|
* Compares the character code of this character with the specified value for order.
|
||||||
@@ -326,7 +326,7 @@ public class Char private () : Comparable<Char> {
|
|||||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `short`.
|
* On the JVM, non-nullable values of this type are represented as values of the primitive type `short`.
|
||||||
*/
|
*/
|
||||||
public class Short private () : Number, Comparable<Short> {
|
public class Short private () : Number, Comparable<Short> {
|
||||||
class object Companion {}
|
companion object {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this value with the specified value for order.
|
* Compares this value with the specified value for order.
|
||||||
@@ -484,7 +484,7 @@ public class Short private () : Number, Comparable<Short> {
|
|||||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `int`.
|
* On the JVM, non-nullable values of this type are represented as values of the primitive type `int`.
|
||||||
*/
|
*/
|
||||||
public class Int private () : Number, Comparable<Int> {
|
public class Int private () : Number, Comparable<Int> {
|
||||||
class object Companion {}
|
companion object {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this value with the specified value for order.
|
* Compares this value with the specified value for order.
|
||||||
@@ -657,7 +657,7 @@ public class Int private () : Number, Comparable<Int> {
|
|||||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `long`.
|
* On the JVM, non-nullable values of this type are represented as values of the primitive type `long`.
|
||||||
*/
|
*/
|
||||||
public class Long private () : Number, Comparable<Long> {
|
public class Long private () : Number, Comparable<Long> {
|
||||||
class object Companion {}
|
companion object {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this value with the specified value for order.
|
* Compares this value with the specified value for order.
|
||||||
@@ -830,7 +830,7 @@ public class Long private () : Number, Comparable<Long> {
|
|||||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `float`.
|
* On the JVM, non-nullable values of this type are represented as values of the primitive type `float`.
|
||||||
*/
|
*/
|
||||||
public class Float private () : Number, Comparable<Float> {
|
public class Float private () : Number, Comparable<Float> {
|
||||||
class object Companion : FloatingPointConstants<Float> {}
|
companion object : FloatingPointConstants<Float> {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this value with the specified value for order.
|
* Compares this value with the specified value for order.
|
||||||
@@ -988,7 +988,7 @@ public class Float private () : Number, Comparable<Float> {
|
|||||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `double`.
|
* On the JVM, non-nullable values of this type are represented as values of the primitive type `double`.
|
||||||
*/
|
*/
|
||||||
public class Double private () : Number, Comparable<Double> {
|
public class Double private () : Number, Comparable<Double> {
|
||||||
class object Companion : FloatingPointConstants<Double> {}
|
companion object : FloatingPointConstants<Double> {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this value with the specified value for order.
|
* Compares this value with the specified value for order.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ package kotlin
|
|||||||
* implemented as instances of this class.
|
* implemented as instances of this class.
|
||||||
*/
|
*/
|
||||||
public class String : Comparable<String>, CharSequence {
|
public class String : Comparable<String>, CharSequence {
|
||||||
class object Companion {}
|
companion object {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string obtained by concatenating this string with the string representation of the given [other] object.
|
* Returns a string obtained by concatenating this string with the string representation of the given [other] object.
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class ByteRange(override val start: Byte, override val end: Byte) : Range
|
|||||||
override fun hashCode(): Int =
|
override fun hashCode(): Int =
|
||||||
if (isEmpty()) -1 else (31 * start.toInt() + end)
|
if (isEmpty()) -1 else (31 * start.toInt() + end)
|
||||||
|
|
||||||
class object Companion {
|
companion object {
|
||||||
/** An empty range of values of type Byte. */
|
/** An empty range of values of type Byte. */
|
||||||
public val EMPTY: ByteRange = ByteRange(1, 0)
|
public val EMPTY: ByteRange = ByteRange(1, 0)
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ public class CharRange(override val start: Char, override val end: Char) : Range
|
|||||||
override fun hashCode(): Int =
|
override fun hashCode(): Int =
|
||||||
if (isEmpty()) -1 else (31 * start.toInt() + end)
|
if (isEmpty()) -1 else (31 * start.toInt() + end)
|
||||||
|
|
||||||
class object Companion {
|
companion object {
|
||||||
/** An empty range of values of type Char. */
|
/** An empty range of values of type Char. */
|
||||||
public val EMPTY: CharRange = CharRange(1.toChar(), 0.toChar())
|
public val EMPTY: CharRange = CharRange(1.toChar(), 0.toChar())
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ public class ShortRange(override val start: Short, override val end: Short) : Ra
|
|||||||
override fun hashCode(): Int =
|
override fun hashCode(): Int =
|
||||||
if (isEmpty()) -1 else (31 * start.toInt() + end)
|
if (isEmpty()) -1 else (31 * start.toInt() + end)
|
||||||
|
|
||||||
class object Companion {
|
companion object {
|
||||||
/** An empty range of values of type Short. */
|
/** An empty range of values of type Short. */
|
||||||
public val EMPTY: ShortRange = ShortRange(1, 0)
|
public val EMPTY: ShortRange = ShortRange(1, 0)
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ public class IntRange(override val start: Int, override val end: Int) : Range<In
|
|||||||
override fun hashCode(): Int =
|
override fun hashCode(): Int =
|
||||||
if (isEmpty()) -1 else (31 * start + end)
|
if (isEmpty()) -1 else (31 * start + end)
|
||||||
|
|
||||||
class object Companion {
|
companion object {
|
||||||
/** An empty range of values of type Int. */
|
/** An empty range of values of type Int. */
|
||||||
public val EMPTY: IntRange = IntRange(1, 0)
|
public val EMPTY: IntRange = IntRange(1, 0)
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ public class LongRange(override val start: Long, override val end: Long) : Range
|
|||||||
override fun hashCode(): Int =
|
override fun hashCode(): Int =
|
||||||
if (isEmpty()) -1 else (31 * (start xor (start ushr 32)) + (end xor (end ushr 32))).toInt()
|
if (isEmpty()) -1 else (31 * (start xor (start ushr 32)) + (end xor (end ushr 32))).toInt()
|
||||||
|
|
||||||
class object Companion {
|
companion object {
|
||||||
/** An empty range of values of type Long. */
|
/** An empty range of values of type Long. */
|
||||||
public val EMPTY: LongRange = LongRange(1, 0)
|
public val EMPTY: LongRange = LongRange(1, 0)
|
||||||
}
|
}
|
||||||
@@ -168,7 +168,7 @@ public class FloatRange(override val start: Float, override val end: Float) : Ra
|
|||||||
override fun hashCode(): Int =
|
override fun hashCode(): Int =
|
||||||
if (isEmpty()) -1 else (31 * java.lang.Float.floatToIntBits(start) + java.lang.Float.floatToIntBits(end))
|
if (isEmpty()) -1 else (31 * java.lang.Float.floatToIntBits(start) + java.lang.Float.floatToIntBits(end))
|
||||||
|
|
||||||
class object Companion {
|
companion object {
|
||||||
/** An empty range of values of type Float. */
|
/** An empty range of values of type Float. */
|
||||||
public val EMPTY: FloatRange = FloatRange(1.0f, 0.0f)
|
public val EMPTY: FloatRange = FloatRange(1.0f, 0.0f)
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ public class DoubleRange(override val start: Double, override val end: Double) :
|
|||||||
return (31 * result + (temp xor (temp ushr 32))).toInt()
|
return (31 * result + (temp xor (temp ushr 32))).toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
class object Companion {
|
companion object {
|
||||||
/** An empty range of values of type Double. */
|
/** An empty range of values of type Double. */
|
||||||
public val EMPTY: DoubleRange = DoubleRange(1.0, 0.0)
|
public val EMPTY: DoubleRange = DoubleRange(1.0, 0.0)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.resolve.scopes.JetScope
|
|||||||
import org.jetbrains.kotlin.types.JetType
|
import org.jetbrains.kotlin.types.JetType
|
||||||
|
|
||||||
public trait SamConversionResolver {
|
public trait SamConversionResolver {
|
||||||
public class object EMPTY : SamConversionResolver {
|
public companion object EMPTY : SamConversionResolver {
|
||||||
override fun <D : FunctionDescriptor> resolveSamAdapter(original: D) = null
|
override fun <D : FunctionDescriptor> resolveSamAdapter(original: D) = null
|
||||||
override fun resolveSamConstructor(name: Name, scope: JetScope) = null
|
override fun resolveSamConstructor(name: Name, scope: JetScope) = null
|
||||||
override fun resolveFunctionTypeIfSamInterface(
|
override fun resolveFunctionTypeIfSamInterface(
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.name.Name
|
|||||||
// The purpose of this class is to hold a unique signature of either a method or a field, so that annotations on a member can be put
|
// The purpose of this class is to hold a unique signature of either a method or a field, so that annotations on a member can be put
|
||||||
// into a map indexed by these signatures
|
// into a map indexed by these signatures
|
||||||
data class MemberSignature private(private val signature: String) {
|
data class MemberSignature private(private val signature: String) {
|
||||||
class object {
|
companion object {
|
||||||
platformStatic public fun fromMethodNameAndDesc(nameAndDesc: String): MemberSignature {
|
platformStatic public fun fromMethodNameAndDesc(nameAndDesc: String): MemberSignature {
|
||||||
return MemberSignature(nameAndDesc)
|
return MemberSignature(nameAndDesc)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.name.Name
|
|||||||
abstract class ReflectJavaAnnotationArgument(
|
abstract class ReflectJavaAnnotationArgument(
|
||||||
override val name: Name?
|
override val name: Name?
|
||||||
) : JavaAnnotationArgument {
|
) : JavaAnnotationArgument {
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
fun create(value: Any, name: Name?): ReflectJavaAnnotationArgument {
|
fun create(value: Any, name: Name?): ReflectJavaAnnotationArgument {
|
||||||
return when {
|
return when {
|
||||||
value.javaClass.isEnumClassOrSpecializedEnumEntryClass() -> ReflectJavaEnumValueAnnotationArgument(name, value as Enum<*>)
|
value.javaClass.isEnumClassOrSpecializedEnumEntryClass() -> ReflectJavaEnumValueAnnotationArgument(name, value as Enum<*>)
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ public abstract class ReflectJavaType : JavaType {
|
|||||||
|
|
||||||
override fun createArrayType(): JavaArrayType = throw UnsupportedOperationException()
|
override fun createArrayType(): JavaArrayType = throw UnsupportedOperationException()
|
||||||
|
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
fun create(type: Type): ReflectJavaType {
|
fun create(type: Type): ReflectJavaType {
|
||||||
return when {
|
return when {
|
||||||
type is Class<*> && type.isPrimitive() -> ReflectJavaPrimitiveType(type)
|
type is Class<*> && type.isPrimitive() -> ReflectJavaPrimitiveType(type)
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@ public class ReflectKotlinClass private(
|
|||||||
private val classHeader: KotlinClassHeader
|
private val classHeader: KotlinClassHeader
|
||||||
) : KotlinJvmBinaryClass {
|
) : KotlinJvmBinaryClass {
|
||||||
|
|
||||||
class object Factory {
|
companion object Factory {
|
||||||
|
|
||||||
public fun create(klass: Class<*>): ReflectKotlinClass? {
|
public fun create(klass: Class<*>): ReflectKotlinClass? {
|
||||||
val headerReader = ReadKotlinClassHeaderAnnotationVisitor()
|
val headerReader = ReadKotlinClassHeaderAnnotationVisitor()
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ public class RuntimeModuleData private(private val injector: InjectorForRuntimeD
|
|||||||
|
|
||||||
public val localClassResolver: LocalClassResolver get() = injector.getDeserializationComponentsForJava().components.localClassResolver
|
public val localClassResolver: LocalClassResolver get() = injector.getDeserializationComponentsForJava().components.localClassResolver
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public fun create(classLoader: ClassLoader): RuntimeModuleData {
|
public fun create(classLoader: ClassLoader): RuntimeModuleData {
|
||||||
val module = ModuleDescriptorImpl(Name.special("<runtime module for $classLoader>"), listOf(), JavaToKotlinClassMap.INSTANCE)
|
val module = ModuleDescriptorImpl(Name.special("<runtime module for $classLoader>"), listOf(), JavaToKotlinClassMap.INSTANCE)
|
||||||
module.addDependencyOnModule(module)
|
module.addDependencyOnModule(module)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public trait Annotations : Iterable<AnnotationDescriptor> {
|
|||||||
|
|
||||||
public fun findAnnotation(fqName: FqName): AnnotationDescriptor?
|
public fun findAnnotation(fqName: FqName): AnnotationDescriptor?
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val EMPTY: Annotations = object : Annotations {
|
public val EMPTY: Annotations = object : Annotations {
|
||||||
override fun isEmpty() = true
|
override fun isEmpty() = true
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public trait JetScope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val ALL_NAME_FILTER: (Name) -> Boolean = { true }
|
public val ALL_NAME_FILTER: (Name) -> Boolean = { true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,7 +141,7 @@ public class DescriptorKindFilter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val NON_SINGLETON_CLASSIFIERS_MASK: Int = 0x01
|
public val NON_SINGLETON_CLASSIFIERS_MASK: Int = 0x01
|
||||||
public val SINGLETON_CLASSIFIERS_MASK: Int = 0x02
|
public val SINGLETON_CLASSIFIERS_MASK: Int = 0x02
|
||||||
public val PACKAGES_MASK: Int = 0x04
|
public val PACKAGES_MASK: Int = 0x04
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public trait FlexibleTypeCapabilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public trait Flexibility : TypeCapability, SubtypingRepresentatives {
|
public trait Flexibility : TypeCapability, SubtypingRepresentatives {
|
||||||
class object {
|
companion object {
|
||||||
// This is a "magic" classifier: when type resolver sees it in the code, e.g. ft<Foo, Foo?>, instead of creating a normal type,
|
// This is a "magic" classifier: when type resolver sees it in the code, e.g. ft<Foo, Foo?>, instead of creating a normal type,
|
||||||
// it creates a flexible type, e.g. (Foo..Foo?).
|
// it creates a flexible type, e.g. (Foo..Foo?).
|
||||||
// This is used in tests and Evaluate Expression to have flexible types in the code,
|
// This is used in tests and Evaluate Expression to have flexible types in the code,
|
||||||
@@ -145,7 +145,7 @@ public open class DelegatingFlexibleType protected (
|
|||||||
override val upperBound: JetType,
|
override val upperBound: JetType,
|
||||||
override val extraCapabilities: FlexibleTypeCapabilities
|
override val extraCapabilities: FlexibleTypeCapabilities
|
||||||
) : DelegatingType(), NullAwareness, Flexibility, FlexibleTypeDelegation, Approximation {
|
) : DelegatingType(), NullAwareness, Flexibility, FlexibleTypeDelegation, Approximation {
|
||||||
class object {
|
companion object {
|
||||||
platformStatic fun create(lowerBound: JetType, upperBound: JetType, extraCapabilities: FlexibleTypeCapabilities): JetType {
|
platformStatic fun create(lowerBound: JetType, upperBound: JetType, extraCapabilities: FlexibleTypeCapabilities): JetType {
|
||||||
if (lowerBound == upperBound) return lowerBound
|
if (lowerBound == upperBound) return lowerBound
|
||||||
return DelegatingFlexibleType(lowerBound, upperBound, extraCapabilities)
|
return DelegatingFlexibleType(lowerBound, upperBound, extraCapabilities)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ enum class PrimitiveType {
|
|||||||
BOOLEAN
|
BOOLEAN
|
||||||
|
|
||||||
val capitalized: String get() = name().toLowerCase().capitalize()
|
val capitalized: String get() = name().toLowerCase().capitalize()
|
||||||
class object {
|
companion object {
|
||||||
val exceptBoolean: Iterable<PrimitiveType> by Delegates.lazy { PrimitiveType.values().filterNot { it == BOOLEAN } }
|
val exceptBoolean: Iterable<PrimitiveType> by Delegates.lazy { PrimitiveType.values().filterNot { it == BOOLEAN } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class GeneratePrimitives(out: PrintWriter) : BuiltInsSourceGenerator(out) {
|
|||||||
}
|
}
|
||||||
out.println("Comparable<$className> {")
|
out.println("Comparable<$className> {")
|
||||||
|
|
||||||
out.print(" class object Companion")
|
out.print(" companion object")
|
||||||
if (kind == PrimitiveType.FLOAT || kind == PrimitiveType.DOUBLE) {
|
if (kind == PrimitiveType.FLOAT || kind == PrimitiveType.DOUBLE) {
|
||||||
out.print(" : FloatingPointConstants<$className>")
|
out.print(" : FloatingPointConstants<$className>")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class $range(override val start: $t, override val end: $t) : Range<$t>, P
|
|||||||
|
|
||||||
override fun hashCode(): Int $hashCode
|
override fun hashCode(): Int $hashCode
|
||||||
|
|
||||||
class object Companion {
|
companion object {
|
||||||
/** An empty range of values of type $t. */
|
/** An empty range of values of type $t. */
|
||||||
public val EMPTY: $range = $range($emptyBounds)
|
public val EMPTY: $range = $range($emptyBounds)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -48,7 +48,7 @@ public class ReferenceVariantsHelper(
|
|||||||
public val receivers: Collection<ReceiverValue>,
|
public val receivers: Collection<ReceiverValue>,
|
||||||
public val callType: CallType
|
public val callType: CallType
|
||||||
) {
|
) {
|
||||||
class object {
|
companion object {
|
||||||
val Empty = ReceiversData(listOf(), CallType.NORMAL)
|
val Empty = ReceiversData(listOf(), CallType.NORMAL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -216,7 +216,7 @@ public class ReferenceVariantsHelper(
|
|||||||
return resolutionScope.getDescriptorsFiltered(DescriptorKindFilter.PACKAGES, nameFilter).filter(visibilityFilter)
|
return resolutionScope.getDescriptorsFiltered(DescriptorKindFilter.PACKAGES, nameFilter).filter(visibilityFilter)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public fun getExplicitReceiverData(expression: JetSimpleNameExpression): Pair<JetExpression, CallType>? {
|
public fun getExplicitReceiverData(expression: JetSimpleNameExpression): Pair<JetExpression, CallType>? {
|
||||||
val receiverExpression = expression.getReceiverExpression() ?: return null
|
val receiverExpression = expression.getReceiverExpression() ?: return null
|
||||||
val parent = expression.getParent()
|
val parent = expression.getParent()
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ class PartialBodyResolveFilter(
|
|||||||
NEED_COMPLETION
|
NEED_COMPLETION
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private fun JetElement.blocks(): Collection<JetBlockExpression> {
|
private fun JetElement.blocks(): Collection<JetBlockExpression> {
|
||||||
val result = ArrayList<JetBlockExpression>(1)
|
val result = ArrayList<JetBlockExpression>(1)
|
||||||
this.accept(object : JetVisitorVoid() {
|
this.accept(object : JetVisitorVoid() {
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.idea.actions.internal
|
|||||||
import com.intellij.ide.util.PropertiesComponent
|
import com.intellij.ide.util.PropertiesComponent
|
||||||
|
|
||||||
public class KotlinInternalMode {
|
public class KotlinInternalMode {
|
||||||
public class object Instance {
|
public companion object Instance {
|
||||||
val INTERNAL_MODE_PROPERTY = "kotlin.internal.mode.enabled"
|
val INTERNAL_MODE_PROPERTY = "kotlin.internal.mode.enabled"
|
||||||
|
|
||||||
public var enabled: Boolean
|
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
|
// 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() {
|
public class JetShortNamesCache(private val project: com.intellij.openapi.project.Project) : com.intellij.psi.search.PsiShortNamesCache() {
|
||||||
class object {
|
companion object {
|
||||||
public fun getKotlinInstance(project: com.intellij.openapi.project.Project): org.jetbrains.kotlin.idea.caches.JetShortNamesCache
|
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()
|
= com.intellij.openapi.extensions.Extensions.getArea(project).getExtensionPoint<com.intellij.psi.search.PsiShortNamesCache>(com.intellij.psi.search.PsiShortNamesCache.EP_NAME).getExtensions()
|
||||||
.firstIsInstance<JetShortNamesCache>()
|
.firstIsInstance<JetShortNamesCache>()
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ import kotlin.platform.platformStatic
|
|||||||
private val LOG = Logger.getInstance(javaClass<KotlinCacheService>())
|
private val LOG = Logger.getInstance(javaClass<KotlinCacheService>())
|
||||||
|
|
||||||
public class KotlinCacheService(val project: Project) {
|
public class KotlinCacheService(val project: Project) {
|
||||||
class object {
|
companion object {
|
||||||
platformStatic public fun getInstance(project: Project): KotlinCacheService = ServiceManager.getService(project, javaClass<KotlinCacheService>())!!
|
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
|
import com.intellij.psi.PsiModifierListOwner
|
||||||
|
|
||||||
class LibraryModificationTracker(project: Project) : SimpleModificationTracker() {
|
class LibraryModificationTracker(project: Project) : SimpleModificationTracker() {
|
||||||
class object {
|
companion object {
|
||||||
platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<LibraryModificationTracker>())!!
|
platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<LibraryModificationTracker>())!!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ private class ExceptionTrackerWithProcessCanceledReport() : ExceptionTracker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
val LOG = Logger.getInstance(javaClass<ExceptionTrackerWithProcessCanceledReport>())
|
val LOG = Logger.getInstance(javaClass<ExceptionTrackerWithProcessCanceledReport>())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import com.intellij.openapi.util.SimpleModificationTracker
|
|||||||
import kotlin.platform.platformStatic
|
import kotlin.platform.platformStatic
|
||||||
|
|
||||||
class ModuleTypeCacheManager private (project: Project) {
|
class ModuleTypeCacheManager private (project: Project) {
|
||||||
class object {
|
companion object {
|
||||||
platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<ModuleTypeCacheManager>())
|
platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<ModuleTypeCacheManager>())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -94,7 +94,7 @@ private fun getLibraryName(module: ModuleDescriptor): String? {
|
|||||||
|
|
||||||
|
|
||||||
class JsMetaFileVirtualFileHolder private(val myProject: Project) {
|
class JsMetaFileVirtualFileHolder private(val myProject: Project) {
|
||||||
class object {
|
companion object {
|
||||||
public val MODULE_DESCRIPTOR_KEY: Key<ModuleDescriptorImpl> = Key.create("MODULE_DESCRIPTOR")
|
public val MODULE_DESCRIPTOR_KEY: Key<ModuleDescriptorImpl> = Key.create("MODULE_DESCRIPTOR")
|
||||||
public val PACKAGE_FQNAME_KEY: Key<FqName> = Key.create("PACKAGE_FQNAME_KEY")
|
public val PACKAGE_FQNAME_KEY: Key<FqName> = Key.create("PACKAGE_FQNAME_KEY")
|
||||||
private val JS_META_FILE_HOLDER_KEY: Key<JsMetaFileVirtualFileHolder> = Key.create("JS_META_FILE_HOLDER_KEY")
|
private val JS_META_FILE_HOLDER_KEY: Key<JsMetaFileVirtualFileHolder> = Key.create("JS_META_FILE_HOLDER_KEY")
|
||||||
|
|||||||
+1
-1
@@ -87,7 +87,7 @@ public open class KotlinClsStubBuilder : ClsStubBuilder() {
|
|||||||
return ClsStubBuilderComponents(classDataFinder, annotationLoader)
|
return ClsStubBuilderComponents(classDataFinder, annotationLoader)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
val LOG = Logger.getInstance(javaClass<KotlinClsStubBuilder>())
|
val LOG = Logger.getInstance(javaClass<KotlinClsStubBuilder>())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -113,7 +113,7 @@ public class DeserializerForDecompiler(val packageDirectory: VirtualFile, val di
|
|||||||
return MutablePackageFragmentDescriptor(moduleDescriptor, fqName)
|
return MutablePackageFragmentDescriptor(moduleDescriptor, fqName)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LOG = Logger.getInstance(javaClass<DeserializerForDecompiler>())
|
private val LOG = Logger.getInstance(javaClass<DeserializerForDecompiler>())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ public open class JetPsiChecker : Annotator, HighlightRangeExtension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
var namesHighlightingEnabled = true
|
var namesHighlightingEnabled = true
|
||||||
[TestOnly] set
|
[TestOnly] set
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
|||||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||||
|
|
||||||
public class OperatorToFunctionIntention : JetSelfTargetingIntention<JetExpression>("operator.to.function", javaClass()) {
|
public class OperatorToFunctionIntention : JetSelfTargetingIntention<JetExpression>("operator.to.function", javaClass()) {
|
||||||
class object {
|
companion object {
|
||||||
private fun isApplicablePrefix(element: JetPrefixExpression): Boolean {
|
private fun isApplicablePrefix(element: JetPrefixExpression): Boolean {
|
||||||
return when (element.getOperationReference().getReferencedNameElementType()) {
|
return when (element.getOperationReference().getReferencedNameElementType()) {
|
||||||
JetTokens.PLUS, JetTokens.MINUS, JetTokens.PLUSPLUS, JetTokens.MINUSMINUS, JetTokens.EXCL -> true
|
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()
|
return LOOP_RANGE_KEYS.map { key -> context.get(key, loopRange)?.getCandidateDescriptor() }.filterNotNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LOOP_RANGE_KEYS = array(
|
private val LOOP_RANGE_KEYS = array(
|
||||||
BindingContext.LOOP_RANGE_ITERATOR_RESOLVED_CALL,
|
BindingContext.LOOP_RANGE_ITERATOR_RESOLVED_CALL,
|
||||||
BindingContext.LOOP_RANGE_NEXT_RESOLVED_CALL,
|
BindingContext.LOOP_RANGE_NEXT_RESOLVED_CALL,
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@ public data class UsagesSearchLocation(
|
|||||||
val inStrings: Boolean = false,
|
val inStrings: Boolean = false,
|
||||||
val inPlainText: Boolean = true
|
val inPlainText: Boolean = true
|
||||||
) {
|
) {
|
||||||
class object {
|
companion object {
|
||||||
public val DEFAULT: UsagesSearchLocation = UsagesSearchLocation()
|
public val DEFAULT: UsagesSearchLocation = UsagesSearchLocation()
|
||||||
public val EVERYWHERE: UsagesSearchLocation = UsagesSearchLocation(true, true, true, true)
|
public val EVERYWHERE: UsagesSearchLocation = UsagesSearchLocation(true, true, true, true)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ public class SubpackagesIndexService(private val project: Project) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public fun getInstance(project: Project): SubpackagesIndex {
|
public fun getInstance(project: Project): SubpackagesIndex {
|
||||||
return ServiceManager.getService(project, javaClass<SubpackagesIndexService>())!!.cachedValue.getValue()!!
|
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
|
public abstract fun importDescriptor(file: JetFile, descriptor: DeclarationDescriptor): ImportDescriptorResult
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
[platformStatic]
|
[platformStatic]
|
||||||
public fun getInstance(project: Project): ImportInsertHelper
|
public fun getInstance(project: Project): ImportInsertHelper
|
||||||
= ServiceManager.getService<ImportInsertHelper>(project, javaClass<ImportInsertHelper>())
|
= ServiceManager.getService<ImportInsertHelper>(project, javaClass<ImportInsertHelper>())
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ public class ShortenReferences(val options: (JetElement) -> Options = { Options.
|
|||||||
val removeThisLabels: Boolean = false,
|
val removeThisLabels: Boolean = false,
|
||||||
val removeThis: Boolean = false
|
val removeThis: Boolean = false
|
||||||
) {
|
) {
|
||||||
class object {
|
companion object {
|
||||||
val DEFAULT = Options()
|
val DEFAULT = Options()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
val DEFAULT = ShortenReferences()
|
val DEFAULT = ShortenReferences()
|
||||||
|
|
||||||
private fun DeclarationDescriptor.asString()
|
private fun DeclarationDescriptor.asString()
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import com.intellij.psi.PsiElement
|
|||||||
import org.jetbrains.kotlin.psi.JetPsiFactory
|
import org.jetbrains.kotlin.psi.JetPsiFactory
|
||||||
|
|
||||||
public trait SimpleNameReferenceExtension {
|
public trait SimpleNameReferenceExtension {
|
||||||
class object {
|
companion object {
|
||||||
public val EP_NAME: ExtensionPointName<SimpleNameReferenceExtension> = ExtensionPointName.create("org.jetbrains.kotlin.simpleNameReferenceExtension")!!
|
public val EP_NAME: ExtensionPointName<SimpleNameReferenceExtension> = ExtensionPointName.create("org.jetbrains.kotlin.simpleNameReferenceExtension")!!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class CompilerSettings {
|
|||||||
public var copyJsLibraryFiles: Boolean = true
|
public var copyJsLibraryFiles: Boolean = true
|
||||||
public var outputDirectoryForJsLibraryFiles: String = DEFAULT_OUTPUT_DIRECTORY
|
public var outputDirectoryForJsLibraryFiles: String = DEFAULT_OUTPUT_DIRECTORY
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val DEFAULT_ADDITIONAL_ARGUMENTS = "-version"
|
private val DEFAULT_ADDITIONAL_ARGUMENTS = "-version"
|
||||||
private val DEFAULT_OUTPUT_DIRECTORY = "lib"
|
private val DEFAULT_OUTPUT_DIRECTORY = "lib"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ public class JetAddImportAction(
|
|||||||
JBPopupFactory.getInstance().createListPopup(getImportSelectionPopup()).showInBestPositionFor(editor)
|
JBPopupFactory.getInstance().createListPopup(getImportSelectionPopup()).showInBestPositionFor(editor)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
|
|
||||||
protected fun addImport(element: PsiElement, project: Project, selectedVariant: Variant) {
|
protected fun addImport(element: PsiElement, project: Project, selectedVariant: Variant) {
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class KotlinReferenceData(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val dataFlavor: DataFlavor? by Delegates.lazy {
|
public val dataFlavor: DataFlavor? by Delegates.lazy {
|
||||||
try {
|
try {
|
||||||
DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + ";class=" + javaClass<KotlinReferenceData>().getName(), "KotlinReferenceData")
|
DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + ";class=" + javaClass<KotlinReferenceData>().getName(), "KotlinReferenceData")
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class DeclarationDescriptorLookupObject(
|
|||||||
return descriptorsEqualWithSubstitution(descriptor, lookupObject.descriptor)
|
return descriptorsEqualWithSubstitution(descriptor, lookupObject.descriptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LOG = Logger.getInstance("#" + javaClass<DeclarationDescriptorLookupObject>().getName())
|
private val LOG = Logger.getInstance("#" + javaClass<DeclarationDescriptorLookupObject>().getName())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.jetbrains.kotlin.lexer.JetTokens
|
|||||||
import org.jetbrains.kotlin.psi.JetFunctionLiteral
|
import org.jetbrains.kotlin.psi.JetFunctionLiteral
|
||||||
|
|
||||||
public class KotlinCompletionCharFilter() : CharFilter() {
|
public class KotlinCompletionCharFilter() : CharFilter() {
|
||||||
class object {
|
companion object {
|
||||||
public val ACCEPT_OPENING_BRACE: Key<Boolean> = Key("KotlinCompletionCharFilter.ACCEPT_OPENNING_BRACE")
|
public val ACCEPT_OPENING_BRACE: Key<Boolean> = Key("KotlinCompletionCharFilter.ACCEPT_OPENNING_BRACE")
|
||||||
|
|
||||||
public val JUST_TYPING_PREFIX: Key<String> = Key("KotlinCompletionCharFilter.JUST_TYPING_PREFIX")
|
public val JUST_TYPING_PREFIX: Key<String> = Key("KotlinCompletionCharFilter.JUST_TYPING_PREFIX")
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class LeafElementFilter(private val elementType: IElementType) : ElementF
|
|||||||
override fun isClassAcceptable(hintClass: Class<*>)
|
override fun isClassAcceptable(hintClass: Class<*>)
|
||||||
= LEAF_CLASS_FILTER.isClassAcceptable(hintClass)
|
= LEAF_CLASS_FILTER.isClassAcceptable(hintClass)
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LEAF_CLASS_FILTER = ClassFilter(javaClass<LeafPsiElement>())
|
private val LEAF_CLASS_FILTER = ClassFilter(javaClass<LeafPsiElement>())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ public class LookupElementFactory(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public fun getDefaultInsertHandler(descriptor: DeclarationDescriptor): InsertHandler<LookupElement> {
|
public fun getDefaultInsertHandler(descriptor: DeclarationDescriptor): InsertHandler<LookupElement> {
|
||||||
return when (descriptor) {
|
return when (descriptor) {
|
||||||
is FunctionDescriptor -> {
|
is FunctionDescriptor -> {
|
||||||
|
|||||||
+1
-1
@@ -217,7 +217,7 @@ public class KotlinFunctionInsertHandler(val caretPosition : CaretPosition, val
|
|||||||
return caretPosition == CaretPosition.IN_BRACKETS
|
return caretPosition == CaretPosition.IN_BRACKETS
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val NO_PARAMETERS_HANDLER: KotlinFunctionInsertHandler = KotlinFunctionInsertHandler(CaretPosition.AFTER_BRACKETS, null)
|
public val NO_PARAMETERS_HANDLER: KotlinFunctionInsertHandler = KotlinFunctionInsertHandler(CaretPosition.AFTER_BRACKETS, null)
|
||||||
public val WITH_PARAMETERS_HANDLER: KotlinFunctionInsertHandler = KotlinFunctionInsertHandler(CaretPosition.IN_BRACKETS, null)
|
public val WITH_PARAMETERS_HANDLER: KotlinFunctionInsertHandler = KotlinFunctionInsertHandler(CaretPosition.IN_BRACKETS, null)
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class WithTailInsertHandler(val tailText: String,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
fun commaTail() = WithTailInsertHandler(",", spaceBefore = false, spaceAfter = true /*TODO: use code style option*/)
|
fun commaTail() = WithTailInsertHandler(",", spaceBefore = false, spaceAfter = true /*TODO: use code style option*/)
|
||||||
fun rparenthTail() = WithTailInsertHandler(")", spaceBefore = false, spaceAfter = false)
|
fun rparenthTail() = WithTailInsertHandler(")", spaceBefore = false, spaceAfter = false)
|
||||||
fun elseTail() = WithTailInsertHandler("else", spaceBefore = true, spaceAfter = true)
|
fun elseTail() = WithTailInsertHandler("else", spaceBefore = true, spaceAfter = true)
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ class SmartCompletion(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public val OLD_ARGUMENTS_REPLACEMENT_OFFSET: OffsetKey = OffsetKey.create("nonFunctionReplacementOffset")
|
public val OLD_ARGUMENTS_REPLACEMENT_OFFSET: OffsetKey = OffsetKey.create("nonFunctionReplacementOffset")
|
||||||
public val MULTIPLE_ARGUMENTS_REPLACEMENT_OFFSET: OffsetKey = OffsetKey.create("multipleArgumentsReplacementOffset")
|
public val MULTIPLE_ARGUMENTS_REPLACEMENT_OFFSET: OffsetKey = OffsetKey.create("multipleArgumentsReplacementOffset")
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ fun LookupElement.addTailAndNameSimilarity(matchedExpectedInfos: Collection<Expe
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ExpectedInfoClassification private(val substitutor: TypeSubstitutor?, val makeNotNullable: Boolean) {
|
class ExpectedInfoClassification private(val substitutor: TypeSubstitutor?, val makeNotNullable: Boolean) {
|
||||||
class object {
|
companion object {
|
||||||
val notMatches = ExpectedInfoClassification(null, false)
|
val notMatches = ExpectedInfoClassification(null, false)
|
||||||
fun matches(substitutor: TypeSubstitutor) = ExpectedInfoClassification(substitutor, false)
|
fun matches(substitutor: TypeSubstitutor) = ExpectedInfoClassification(substitutor, false)
|
||||||
fun matchesIfNotNullable(substitutor: TypeSubstitutor) = ExpectedInfoClassification(substitutor, true)
|
fun matchesIfNotNullable(substitutor: TypeSubstitutor) = ExpectedInfoClassification(substitutor, true)
|
||||||
|
|||||||
+1
-1
@@ -180,7 +180,7 @@ public class ConvertJavaCopyPastePostProcessor() : CopyPastePostProcessor<TextBl
|
|||||||
return dialog.isOK()
|
return dialog.isOK()
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LOG = Logger.getInstance("#org.jetbrains.kotlin.idea.conversion.copy.ConvertJavaCopyPastePostProcessor")
|
private val LOG = Logger.getInstance("#org.jetbrains.kotlin.idea.conversion.copy.ConvertJavaCopyPastePostProcessor")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class CopiedCode(val fileName: String, val fileText: String, val startOffsets: I
|
|||||||
public override fun getOffsets(offsets: IntArray?, index: Int) = index
|
public override fun getOffsets(offsets: IntArray?, index: Int) = index
|
||||||
public override fun setOffsets(offsets: IntArray?, index: Int) = index
|
public override fun setOffsets(offsets: IntArray?, index: Int) = index
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
val DATA_FLAVOR: DataFlavor = DataFlavor(javaClass<ConvertJavaCopyPastePostProcessor>(), "class: ConvertJavaCopyPastePostProcessor")
|
val DATA_FLAVOR: DataFlavor = DataFlavor(javaClass<ConvertJavaCopyPastePostProcessor>(), "class: ConvertJavaCopyPastePostProcessor")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class KotlinCoverageExtension(): JavaCoverageEngineExtension() {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LOG = Logger.getInstance(javaClass<KotlinCoverageExtension>())
|
private val LOG = Logger.getInstance(javaClass<KotlinCoverageExtension>())
|
||||||
|
|
||||||
fun collectGeneratedClassQualifiedNames(outputRoot: VirtualFile?, file: JetFile): List<String>? {
|
fun collectGeneratedClassQualifiedNames(outputRoot: VirtualFile?, file: JetFile): List<String>? {
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ public class JetPositionManager(private val myDebugProcess: DebugProcess) : Mult
|
|||||||
myTypeMappers.put(key, value)
|
myTypeMappers.put(key, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public fun createTypeMapper(file: JetFile): JetTypeMapper {
|
public fun createTypeMapper(file: JetFile): JetTypeMapper {
|
||||||
val project = file.getProject()
|
val project = file.getProject()
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class KotlinDebuggerSettings : XDebuggerSettings<KotlinDebuggerSettings>(
|
|||||||
public var DEBUG_DISABLE_KOTLIN_INTERNAL_CLASSES: Boolean = true
|
public var DEBUG_DISABLE_KOTLIN_INTERNAL_CLASSES: Boolean = true
|
||||||
public var DEBUG_IS_FILTER_FOR_STDLIB_ALREADY_ADDED: Boolean = false
|
public var DEBUG_IS_FILTER_FOR_STDLIB_ALREADY_ADDED: Boolean = false
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
public fun getInstance(): KotlinDebuggerSettings {
|
public fun getInstance(): KotlinDebuggerSettings {
|
||||||
return XDebuggerUtil.getInstance()?.getDebuggerSettings(javaClass<KotlinDebuggerSettings>())!!
|
return XDebuggerUtil.getInstance()?.getDebuggerSettings(javaClass<KotlinDebuggerSettings>())!!
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class KotlinEditorTextProvider : EditorTextProvider {
|
|||||||
return Pair(expression, expressionRange)
|
return Pair(expression, expressionRange)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
|
|
||||||
fun <T> getElementInfo(expr: JetExpression, f: (PsiElement) -> T): T {
|
fun <T> getElementInfo(expr: JetExpression, f: (PsiElement) -> T): T {
|
||||||
var expressionText = f(expr)
|
var expressionText = f(expr)
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class KotlinCodeFragmentFactory: CodeFragmentFactory() {
|
|||||||
|
|
||||||
override fun getEvaluatorBuilder() = KotlinEvaluationBuilder
|
override fun getEvaluatorBuilder() = KotlinEvaluationBuilder
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
fun getContextElement(elementAt: PsiElement?): PsiElement? {
|
fun getContextElement(elementAt: PsiElement?): PsiElement? {
|
||||||
if (elementAt == null) return null
|
if (elementAt == null) return null
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ class KotlinEvaluateExpressionCache(val project: Project) {
|
|||||||
MultiMap.create(), PsiModificationTracker.MODIFICATION_COUNT)
|
MultiMap.create(), PsiModificationTracker.MODIFICATION_COUNT)
|
||||||
}, false)
|
}, false)
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private val LOG = Logger.getLogger(javaClass<KotlinEvaluateExpressionCache>())!!
|
private val LOG = Logger.getLogger(javaClass<KotlinEvaluateExpressionCache>())!!
|
||||||
|
|
||||||
fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<KotlinEvaluateExpressionCache>())!!
|
fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<KotlinEvaluateExpressionCache>())!!
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ class KotlinEvaluator(val codeFragment: JetCodeFragment,
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private fun extractAndCompile(codeFragment: JetCodeFragment, sourcePosition: SourcePosition, context: EvaluationContextImpl): CompiledDataDescriptor {
|
private fun extractAndCompile(codeFragment: JetCodeFragment, sourcePosition: SourcePosition, context: EvaluationContextImpl): CompiledDataDescriptor {
|
||||||
codeFragment.checkForErrors()
|
codeFragment.checkForErrors()
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public abstract class KotlinRuntimeTypeEvaluator(
|
|||||||
throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.surrounded.expression.null"))
|
throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.surrounded.expression.null"))
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
private fun getCastableRuntimeType(project: Project, value: Value): JetType? {
|
private fun getCastableRuntimeType(project: Project, value: Value): JetType? {
|
||||||
val myValue = value.asValue()
|
val myValue = value.asValue()
|
||||||
var psiClass = myValue.asmType.getClassDescriptor(project)
|
var psiClass = myValue.asmType.getClassDescriptor(project)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import com.intellij.psi.tree.TokenSet
|
|||||||
import com.intellij.psi.PsiWhiteSpace
|
import com.intellij.psi.PsiWhiteSpace
|
||||||
|
|
||||||
public class KotlinEnterHandler: EnterHandlerDelegateAdapter() {
|
public class KotlinEnterHandler: EnterHandlerDelegateAdapter() {
|
||||||
class object {
|
companion object {
|
||||||
private val LOG = Logger.getInstance(javaClass<KotlinEnterHandler>())
|
private val LOG = Logger.getInstance(javaClass<KotlinEnterHandler>())
|
||||||
private val FORCE_INDENT_IN_LAMBDA_AFTER = TokenSet.create(JetTokens.ARROW, JetTokens.LBRACE)
|
private val FORCE_INDENT_IN_LAMBDA_AFTER = TokenSet.create(JetTokens.ARROW, JetTokens.LBRACE)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.lexer.JetTokens
|
|||||||
import com.intellij.codeInsight.editorActions.ExtendWordSelectionHandlerBase
|
import com.intellij.codeInsight.editorActions.ExtendWordSelectionHandlerBase
|
||||||
|
|
||||||
public class KotlinListSelectioner : ExtendWordSelectionHandlerBase() {
|
public class KotlinListSelectioner : ExtendWordSelectionHandlerBase() {
|
||||||
class object {
|
companion object {
|
||||||
fun canSelect(e: PsiElement)
|
fun canSelect(e: PsiElement)
|
||||||
= e is JetParameterList || e is JetValueArgumentList || e is JetTypeParameterList || e is JetTypeArgumentList
|
= e is JetParameterList || e is JetValueArgumentList || e is JetTypeParameterList || e is JetTypeArgumentList
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.idea.JetIcons
|
|||||||
import org.jetbrains.kotlin.idea.project.TargetPlatform
|
import org.jetbrains.kotlin.idea.project.TargetPlatform
|
||||||
|
|
||||||
public class KotlinTemplatesFactory : ProjectTemplatesFactory() {
|
public class KotlinTemplatesFactory : ProjectTemplatesFactory() {
|
||||||
class object {
|
companion object {
|
||||||
public val KOTLIN_GROUP_NAME: String = "Kotlin"
|
public val KOTLIN_GROUP_NAME: String = "Kotlin"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import javax.swing.JComponent
|
|||||||
import javax.swing.JPanel
|
import javax.swing.JPanel
|
||||||
|
|
||||||
public class UnusedSymbolInspection : AbstractKotlinInspection() {
|
public class UnusedSymbolInspection : AbstractKotlinInspection() {
|
||||||
class object {
|
companion object {
|
||||||
private val javaInspection = UnusedDeclarationInspection()
|
private val javaInspection = UnusedDeclarationInspection()
|
||||||
|
|
||||||
public fun isEntryPoint(declaration: JetNamedDeclaration): Boolean {
|
public fun isEntryPoint(declaration: JetNamedDeclaration): Boolean {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ import org.jetbrains.kotlin.idea.util.ShortenReferences
|
|||||||
public class ConvertFunctionToPropertyIntention : JetSelfTargetingIntention<JetNamedFunction>(
|
public class ConvertFunctionToPropertyIntention : JetSelfTargetingIntention<JetNamedFunction>(
|
||||||
"convert.function.to.property.intention", javaClass()
|
"convert.function.to.property.intention", javaClass()
|
||||||
) {
|
) {
|
||||||
class object {
|
companion object {
|
||||||
private var JetNamedFunction.typeFqNameToAdd: String? by UserDataProperty(Key.create("TYPE_FQ_NAME_TO_ADD"))
|
private var JetNamedFunction.typeFqNameToAdd: String? by UserDataProperty(Key.create("TYPE_FQ_NAME_TO_ADD"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class ConvertToBlockBodyAction : PsiElementBaseIntentionAction() {
|
|||||||
convert(findDeclaration(element)!!)
|
convert(findDeclaration(element)!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
fun convert(declaration: JetDeclarationWithBody): JetDeclarationWithBody {
|
fun convert(declaration: JetDeclarationWithBody): JetDeclarationWithBody {
|
||||||
val body = declaration.getBodyExpression()!!
|
val body = declaration.getBodyExpression()!!
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class InsertExplicitTypeArguments : JetSelfTargetingIntention<JetCallExpr
|
|||||||
ShortenReferences.DEFAULT.process(element.getTypeArgumentList()!!)
|
ShortenReferences.DEFAULT.process(element.getTypeArgumentList()!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
class object {
|
companion object {
|
||||||
fun createTypeArguments(element: JetCallExpression): JetTypeArgumentList? {
|
fun createTypeArguments(element: JetCallExpression): JetTypeArgumentList? {
|
||||||
val context = element.analyze()
|
val context = element.analyze()
|
||||||
val resolvedCall = element.getResolvedCall(context)
|
val resolvedCall = element.getResolvedCall(context)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user