[Analysis API] Collect designations only for autonomous declarations

Parameters, type parameters, and property accessors are not
self-sufficient declarations (their resolution depends on resolution
of their parent), so a proper designation path cannot be computed
for them.

Without a designation path, 'ContextCollector' performs analysis of the
whole file, which is inefficient.
This commit is contained in:
Yan Zhulanow
2023-12-20 00:39:05 +09:00
committed by Space Team
parent 4a2f11b2f5
commit bed73fd650
20 changed files with 282 additions and 53 deletions
@@ -0,0 +1,34 @@
Tower Data Context:
Element 0
Scope: FirDefaultStarImportingScope
Element 1
Scope: FirExplicitStarImportingScope
Element 2
Scope: FirDefaultSimpleImportingScope
Element 3
Scope: FirDefaultSimpleImportingScope
Element 4
Scope: FirPackageMemberScope
Element 5
Scope: FirExplicitSimpleImportingScope
Element 6
Implicit receiver:
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
Type: Foo
Element 7
Scope: FirLocalScope
Properties:
FirValueParameterSymbol abc: R|kotlin/Int|
FILE: [ResolvedTo(IMPORTS)] parameter.kt
public final [ResolvedTo(STATUS)] class Foo : R|kotlin/Any| {
public [ResolvedTo(STATUS)] constructor(): R|Foo| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] abc: R|kotlin/Int|): R|kotlin/Unit| {
}
public final [ResolvedTo(STATUS)] fun other(): R|kotlin/Unit| { LAZY_BLOCK }
}