[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
@@ -12,23 +12,16 @@ Tower Data Context:
Element 5
Scope: FirExplicitSimpleImportingScope
Element 6
Implicit receiver:
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
Type: Foo
Scope: FirLocalScope
Properties:
FirValueParameterSymbol a: R|kotlin/String| = String(foo)
FirValueParameterSymbol b: R|kotlin/Int| = R|<local>/a|.R|kotlin/String.length|
FirValueParameterSymbol c: R|kotlin/Long| = R|<local>/a|.R|kotlin/String.length|.R|kotlin/Int.minus|(Int(1)).R|kotlin/Int.toLong|()
FILE: [ResolvedTo(IMPORTS)] primaryConstructorParameter.kt
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Foo : R|kotlin/Any| {
public [ResolvedTo(ANNOTATION_ARGUMENTS)] constructor([ResolvedTo(ANNOTATION_ARGUMENTS)] a: R|kotlin/String| = LAZY_EXPRESSION, [ResolvedTo(ANNOTATION_ARGUMENTS)] b: R|kotlin/Int| = LAZY_EXPRESSION, [ResolvedTo(ANNOTATION_ARGUMENTS)] c: R|kotlin/Long| = LAZY_EXPRESSION): R|Foo| {
LAZY_super<R|kotlin/Any|>
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] a: R|kotlin/String| = String(foo), [ResolvedTo(BODY_RESOLVE)] b: R|kotlin/Int| = R|<local>/a|.R|kotlin/String.length|, [ResolvedTo(BODY_RESOLVE)] c: R|kotlin/Long| = R|<local>/a|.R|kotlin/String.length|.R|kotlin/Int.minus|(Int(1)).R|kotlin/Int.toLong|()): R|Foo| {
super<R|kotlin/Any|>()
}
public final [ResolvedTo(STATUS)] val a: R|kotlin/String| = R|<local>/a|
public [ResolvedTo(STATUS)] get(): R|kotlin/String|
public final [ResolvedTo(BODY_RESOLVE)] val b: R|kotlin/Int| = R|<local>/b|
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
public final [ResolvedTo(STATUS)] val c: R|kotlin/Long| = R|<local>/c|
public [ResolvedTo(STATUS)] get(): R|kotlin/Long|
}