KT-61889 [AA] Migrate KtFirReferenceShortener to ContextCollector

This should make reference shortener considerably faster, since it won't
need to perform redundant extra resolve of the file.

`ContextCollector` more accurately collects the scopes for the scripts,
so some script tests are also fixed.

It should fix the following bugs:

^KTIJ-26714 Fixed
^KTIJ-26727 Fixed

This is also an important part of fixing the following bugs:
- KTIJ-26715
- KTIJ-26734

But those bugs also rely on KT-61890, because completion uses scopes
and snows incorrect elements from them
This commit is contained in:
Roman Golyshev
2023-09-11 12:57:08 +02:00
committed by Space Team
parent ce900063c0
commit 7b50506aea
10 changed files with 167 additions and 10 deletions
@@ -640,6 +640,18 @@ public class FirStandaloneNormalAnalysisSourceModuleReferenceShortenerTestGenera
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/nestedClasses/classHeaderPositions/annotationOnParameter_nested.kt");
}
@Test
@TestMetadata("constructorParameterVsTopLevelProperty_conflict.kt")
public void testConstructorParameterVsTopLevelProperty_conflict() throws Exception {
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/nestedClasses/classHeaderPositions/constructorParameterVsTopLevelProperty_conflict.kt");
}
@Test
@TestMetadata("constructorParameterVsTopLevelProperty_noConflict.kt")
public void testConstructorParameterVsTopLevelProperty_noConflict() throws Exception {
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/nestedClasses/classHeaderPositions/constructorParameterVsTopLevelProperty_noConflict.kt");
}
@Test
@TestMetadata("contextReceiver.kt")
public void testContextReceiver() throws Exception {