KT-61890 [AA] Add testdata to ensure KDoc completion support in IDE

Completion in the IDE relies on correct scopes for KDoc positions.
So we add testData for `KtScopeProvider` and `ContextCollector`
to ensure that there are no regressions
This commit is contained in:
Roman Golyshev
2023-11-14 13:49:06 +01:00
committed by teamcity
parent 1b1df9f0db
commit 4f136cde31
14 changed files with 1084 additions and 0 deletions
@@ -0,0 +1,13 @@
package test
class Param1
class Param2
/**
* [<expr>param1</expr>]
*/
class MyClass<TypeParam>(param1: Param1, param2: Param2) {
val property: Int = 10
fun member(): Int = 10
}
@@ -0,0 +1,54 @@
element: param1
implicit receivers:
type: test.MyClass<TypeParam>
owner symbol: KtFirNamedClassOrObjectSymbol
scopes:
TypeScope, index = 0
packages: 0
classifiers: 0
callables: 5
val property: kotlin.Int
fun member(): kotlin.Int
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
constructors: 1
constructor(param1: test.Param1, param2: test.Param2)
TypeParameterScope, index = 1
packages: 0
classifiers: 1
TypeParam
callables: 0
constructors: 0
ExplicitSimpleImportingScope, index = 2
packages: 0
classifiers: 0
callables: 0
constructors: 0
PackageMemberScope, index = 3
packages: 0
classifiers: 3
class Param1
class Param2
class MyClass<TypeParam>(param1: test.Param1, param2: test.Param2)
callables: 0
constructors: 0
DefaultSimpleImportingScope, index = 4
DefaultSimpleImportingScope, index = 5
ExplicitStarImportingScope, index = 6
packages: 0
classifiers: 0
callables: 0
constructors: 0
DefaultSimpleImportingScope, index = 7
DefaultStarImportingScope, index = 8
@@ -0,0 +1,406 @@
element: param1
implicit receivers:
type: KtUsualClassType:
annotationsList: []
ownTypeArguments: [
KtTypeParameterType:
annotationsList: []
type: TypeParam
]
type: test/MyClass<TypeParam>
owner symbol: KtFirNamedClassOrObjectSymbol
scopes:
TypeScope, index = 0
packages: 0
classifiers: 0
callables: 5
KtKotlinPropertySymbol:
annotationsList: []
backingFieldSymbol: KtBackingFieldSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
name: field
origin: PROPERTY_BACKING_FIELD
owningProperty: KtKotlinPropertySymbol(test/MyClass.property)
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: LOCAL
typeParameters: []
callableIdIfNonLocal: test/MyClass.property
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: false
hasStableParameterNames: true
isDefault: true
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
hasBackingField: true
hasGetter: true
hasSetter: false
initializer: KtConstantInitializerValue(10)
isActual: false
isConst: false
isDelegatedProperty: false
isExpect: false
isExtension: false
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: property
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/MyClass.member
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: member
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.equals
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: equals
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: other
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any?
symbolKind: LOCAL
typeParameters: []
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.hashCode
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: hashCode
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.toString
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: toString
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/String
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
constructors: 1
KtConstructorSymbol:
annotationsList: []
callableIdIfNonLocal: null
containingClassIdIfNonLocal: test/MyClass
contextReceivers: []
hasStableParameterNames: true
isActual: false
isExpect: false
isExtension: false
isPrimary: true
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: [
KtTypeParameterType:
annotationsList: []
type: TypeParam
]
type: test/MyClass<TypeParam>
symbolKind: CLASS_MEMBER
typeParameters: [
KtTypeParameterSymbol(TypeParam)
]
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: param1
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Param1
symbolKind: LOCAL
typeParameters: []
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: param2
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Param2
symbolKind: LOCAL
typeParameters: []
]
visibility: Public
TypeParameterScope, index = 1
packages: 0
classifiers: 1
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: TypeParam
origin: SOURCE
typeParameters: []
upperBounds: []
variance: INVARIANT
callables: 0
constructors: 0
ExplicitSimpleImportingScope, index = 2
packages: 0
classifiers: 0
callables: 0
constructors: 0
PackageMemberScope, index = 3
packages: 0
classifiers: 3
KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: test/Param1
classKind: CLASS
companionObject: null
contextReceivers: []
isActual: false
isData: false
isExpect: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: Param1
origin: SOURCE
superTypes: [
KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: test/Param2
classKind: CLASS
companionObject: null
contextReceivers: []
isActual: false
isData: false
isExpect: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: Param2
origin: SOURCE
superTypes: [
KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: test/MyClass
classKind: CLASS
companionObject: null
contextReceivers: []
isActual: false
isData: false
isExpect: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: MyClass
origin: SOURCE
superTypes: [
KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any
]
symbolKind: TOP_LEVEL
typeParameters: [
KtTypeParameterSymbol(TypeParam)
]
visibility: Public
callables: 0
constructors: 0
DefaultSimpleImportingScope, index = 4
DefaultSimpleImportingScope, index = 5
ExplicitStarImportingScope, index = 6
packages: 0
classifiers: 0
callables: 0
constructors: 0
DefaultSimpleImportingScope, index = 7
DefaultStarImportingScope, index = 8
@@ -0,0 +1,12 @@
package test
class Receiver
class Param1
class Param2
/**
* [<expr>param1</expr>]
*/
fun <TypeParam> Receiver.function(param1: Param1, param2: Param2): TypeParam {}
@@ -0,0 +1,60 @@
element: param1
implicit receivers:
type: test.Receiver
owner symbol: KtFirFunctionSymbol
scopes:
TypeScope, index = 0
packages: 0
classifiers: 0
callables: 3
fun equals(other: kotlin.Any?): kotlin.Boolean
fun hashCode(): kotlin.Int
fun toString(): kotlin.String
constructors: 1
constructor()
LocalScope, index = 1
packages: 0
classifiers: 0
callables: 2
param1: test.Param1
param2: test.Param2
constructors: 0
TypeParameterScope, index = 2
packages: 0
classifiers: 1
TypeParam
callables: 0
constructors: 0
ExplicitSimpleImportingScope, index = 3
packages: 0
classifiers: 0
callables: 0
constructors: 0
PackageMemberScope, index = 4
packages: 0
classifiers: 3
class Receiver
class Param1
class Param2
callables: 1
fun <TypeParam> test.Receiver.function(param1: test.Param1, param2: test.Param2): TypeParam
constructors: 0
DefaultSimpleImportingScope, index = 5
DefaultSimpleImportingScope, index = 6
ExplicitStarImportingScope, index = 7
packages: 0
classifiers: 0
callables: 0
constructors: 0
DefaultSimpleImportingScope, index = 8
DefaultStarImportingScope, index = 9
@@ -0,0 +1,381 @@
element: param1
implicit receivers:
type: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Receiver
owner symbol: KtFirFunctionSymbol
scopes:
TypeScope, index = 0
packages: 0
classifiers: 0
callables: 3
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.equals
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: equals
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: other
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any?
symbolKind: LOCAL
typeParameters: []
]
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.hashCode
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: hashCode
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.toString
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: toString
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/String
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
constructors: 1
KtConstructorSymbol:
annotationsList: []
callableIdIfNonLocal: null
containingClassIdIfNonLocal: test/Receiver
contextReceivers: []
hasStableParameterNames: true
isActual: false
isExpect: false
isExtension: false
isPrimary: true
origin: SOURCE_MEMBER_GENERATED
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Receiver
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
LocalScope, index = 1
packages: 0
classifiers: 0
callables: 2
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: param1
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Param1
symbolKind: LOCAL
typeParameters: []
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: param2
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Param2
symbolKind: LOCAL
typeParameters: []
constructors: 0
TypeParameterScope, index = 2
packages: 0
classifiers: 1
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: TypeParam
origin: SOURCE
typeParameters: []
upperBounds: []
variance: INVARIANT
callables: 0
constructors: 0
ExplicitSimpleImportingScope, index = 3
packages: 0
classifiers: 0
callables: 0
constructors: 0
PackageMemberScope, index = 4
packages: 0
classifiers: 3
KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: test/Receiver
classKind: CLASS
companionObject: null
contextReceivers: []
isActual: false
isData: false
isExpect: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: Receiver
origin: SOURCE
superTypes: [
KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: test/Param1
classKind: CLASS
companionObject: null
contextReceivers: []
isActual: false
isData: false
isExpect: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: Param1
origin: SOURCE
superTypes: [
KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: test/Param2
classKind: CLASS
companionObject: null
contextReceivers: []
isActual: false
isData: false
isExpect: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: Param2
origin: SOURCE
superTypes: [
KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
callables: 1
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/function
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: true
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: function
origin: SOURCE
receiverParameter: KtReceiverParameterSymbol:
annotationsList: []
origin: SOURCE
owningCallableSymbol: KtFunctionSymbol(test/function)
type: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Receiver
returnType: KtTypeParameterType:
annotationsList: []
type: TypeParam
symbolKind: TOP_LEVEL
typeParameters: [
KtTypeParameterSymbol(TypeParam)
]
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: param1
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Param1
symbolKind: LOCAL
typeParameters: []
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: param2
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Param2
symbolKind: LOCAL
typeParameters: []
]
visibility: Public
constructors: 0
DefaultSimpleImportingScope, index = 5
DefaultSimpleImportingScope, index = 6
ExplicitStarImportingScope, index = 7
packages: 0
classifiers: 0
callables: 0
constructors: 0
DefaultSimpleImportingScope, index = 8
DefaultStarImportingScope, index = 9