Commit Graph

154 Commits

Author SHA1 Message Date
Dmitrii Gridin d19a23aae5 [LL FIR] implement tests on dependent copy session analyze
^KT-60987
2023-08-09 15:22:57 +00:00
Dmitrii Gridin 734a3e5716 [LL FIR] do not create lazy bodies during on-air resolve in scripts
We assume that on-air resolve already has normal bodies,
so depending on this fact, we can omit some redundant work

^KT-61026 Fixed
2023-08-08 15:40:48 +00:00
Yan Zhulanow 4fbbe9f274 [LL API] Add in-body modification tests for code fragments 2023-08-07 16:22:03 +00:00
Yan Zhulanow a09c2a485e [LL API] Add basic tests for 'ContextCollector' 2023-08-07 16:22:02 +00:00
Yan Zhulanow e1db3c88cf [LL API] Support code fragment compilation 2023-08-07 16:22:01 +00:00
Yan Zhulanow 02af189066 [LL API] Support code fragment analysis 2023-08-07 16:22:01 +00:00
Ilya Kirillov 419c0c83e3 [stub builder] introduce a separate testsuite where classfiles generated by the K2 compiler
The result of k1/k2 should be similar here, the differences should be fixed by KT-60764
2023-07-31 15:38:07 +00:00
Dmitrii Gridin e99cfbd3b7 [LL FIR] add script tests for AbstractFirLazyDeclarationResolveTest
^KT-60728
2023-07-28 00:13:59 +02:00
Dmitrii Gridin 1515fbe99f [LL FIR] add script tests for AbstractGetOrBuildFirTest
^KT-60728
2023-07-28 00:13:59 +02:00
Dmitrii Gridin a60abc6c06 [LL FIR] add script tests for AbstractInBlockModificationTest
^KT-60728
2023-07-28 00:13:59 +02:00
Dmitrii Gridin e328aeee72 [LL FIR] add script tests for AbstractWholeFileResolvePhaseTest
^KT-60728
2023-07-27 12:02:05 +00:00
Dmitrii Gridin 167c247456 [LL FIR] rename AbstractInnerDeclarationsResolvePhaseTest to AbstractWholeFileResolvePhaseTest
^KT-60728
2023-07-27 12:02:05 +00:00
Dmitrii Gridin b1b123efc0 [LL FIR] merge innerDeclarationsResolve testData to fileStructure
^KT-60728
2023-07-27 12:02:05 +00:00
Dmitrii Gridin 8a906004e3 [LL FIR] do not resolve declarations from script separately
It leads to exceptions because of race.
We shouldn't try to resolve a script and its content simultaneously,
because it is not thread-safe

^KT-60728
2023-07-27 12:02:05 +00:00
Dmitrii Gridin 6fa254c353 [LL FIR] merge diagnosticTraversalCounter testData to fileStructure
^KT-60728
2023-07-27 12:02:04 +00:00
Dmitrii Gridin 9970663a2b [LL FIR] add script tests for AbstractFirContextCollectionTest
^KT-60728
2023-07-27 12:02:04 +00:00
Dmitrii Gridin 3ed5ccbb6f [LL FIR] add script tests for AbstractFileStructureTest
^KT-60728
2023-07-27 12:02:04 +00:00
Dmitrii Gridin e248d1a588 [LL FIR] add script tests for AbstractFileBasedKotlinDeclarationProviderTest
^KT-60728
2023-07-27 12:02:04 +00:00
Dmitrii Gridin aa36e2ef5b [LL FIR] add script tests for AbstractNonLocalDeclarationAnchorTest
^KT-60728
2023-07-27 12:02:04 +00:00
Dmitrii Gridin 60dc0ace47 [LL FIR] add script tests for AbstractClassIdTest
^KT-60728
2023-07-27 12:02:04 +00:00
Yan Zhulanow 0f6f22d76b [Analysis API] Add API for code compilation
The API replaces 'KotlinCompilerIde' in the IntelliJ IDEA plugin.
Code moved to Analysis API as its K2 implementation severely depends on
the internal compiler API (FIR).

The API is going to be used in the JVM debugger evaluator, and in
the Bytecode Tool Window.

In this commit, only ordinary Kotlin are supported.
In later commits, there will be also support for 'KtCodeFragment' files,
as well as some test coverage.
2023-07-27 10:23:42 +00:00
aleksandrina-streltsova ca25162574 [AA] implement isExpect/isActual for KtClassLikeSymbol
KT-54846
2023-07-24 17:24:41 +00:00
Justin Paupore 9f85739599 [AA] Add KtResolveExtensionInfoProvider to AA.
This provider is responsible for answering queries related to resolve
extensions. At the moment, this includes retrieving a KtScope with all REx
top-level declarations (moved from KtSymbolFromResolveExtensionProvider), and
retrieving information necessary to supply a GeneratedSourcesFilter for REx
generated code. Future REx-related functions can be added to this interface.

^KT-59329
2023-07-14 19:32:09 +02:00
Justin Paupore 734b87b97e [AA] Allow specifying REx file contents in testdata.
Tests can now specify the code generated by a resolve extension from
within the test's testdata. Module-level directives control whether
resolve extensions are enabled for that module, as well as package names
and source shadowing regexes. File-level directives allow a `// FILE:`
block within the testdata to be converted into a KtResolveExtensionFile
and removed from the module as a whole. (This requires a new
`ModuleStructureTransformer`, because we need to be able to entirely
remove the files in question.)

Any test can add support for these directives by calling
`KtResolveExtensionTestSupport.configure` from within their
`configureTest` stanza. This allows this functionality to be used in
conjuction with any test base class.

^KT-59329
2023-07-14 19:32:08 +02:00
Andrei Klunnyi 0323b0fb19 KT-59801 [FIR] scripting: tests for reference shortening 2023-07-13 15:21:39 +02:00
Dmitrii Gridin e354b2a900 [LL FIR] rewrote in-block modifications logic
Now we will invalidate bodies for FIR declarations
immediately after in-block modifications in these declarations
We assume that such in-block modifications can happen
only under write action,
so it should be safe to make changes for FirFile

^KT-59687 Fixed
^KT-59199 Fixed
^KTIJ-26066 Fixed
2023-07-05 20:29:00 +02:00
Yan Zhulanow d04ed56a4d [LL API] Add tests for FIR tree guards
^KT-59297 Fixed
2023-06-30 14:26:43 +00:00
Ilya Kirillov 8b0eb0488f [Analysis API] add method for implicit companion object reference detection
Add a new method `isImplicitReferenceToCompanion` to determine
if the given reference is an implicit reference to a companion object.

The method is needed for the rename refactoring in IJ.

^KTIJ-25863
2023-06-30 13:43:30 +00:00
Anna Kozlova 190d49a1e0 [light classes] optimize accessors retrieval
Avoid expensive calls to `navigationElement` for methods
that cannot be getters/setters and would be filtered later.
Repeat partly naming generation strategy.

Merge-request: KT-MR-10689
Merged-by: Anna Kozlova <Anna.Kozlova@jetbrains.com>
2023-06-22 14:14:39 +00:00
Mikhail Glukhikh 7fd441f16a Analysis API: add normal FE10 import optimizer (taken from plugin code) 2023-06-21 12:04:31 +02:00
Dmitrii Gridin 72c625906f [LL FIR] add tests on ClassIdCalculator 2023-06-17 13:58:24 +02:00
Dmitrii Gridin 563f913a95 [LL FIR] introduce tests to check lazy resolve stdlib as sources
^KTIJ-25761
2023-06-10 17:57:52 +00:00
Anna Kozlova 4d97e4c572 [LL] add tests for FirDeclarationForCompiledElementSearcher
build stub if was not able to load:
expected that in IDE stubs would always be found in the index, for tests -
build from virtual file
2023-06-07 21:00:26 +00:00
Ilya Kirillov 1eb0862820 [Analysis, build] replace testApi -> testImplementation in build.gradle.kts where it's possible 2023-06-02 09:16:47 +00:00
Marco Pennekamp a50e839660 [LL FIR] Add multi-module resolve extension reference resolve tests
- To test the reference resolution of declarations provided through
  resolve extensions of module dependencies, we need support for
  multimodule resolve extension tests.
2023-05-31 18:34:42 +00:00
Dmitrii Gridin 09dbae5eca [LL FIR] add more restrictions to getNonLocalContainingOrThisDeclaration
^KTIJ-25437
KT-MR-10036
2023-05-11 16:09:02 +02:00
Ilya Kirillov eeac3f53b4 [Analysis API] add tests for getImportingScopeContext
^KT-57966
2023-05-04 15:26:50 +00:00
Ilya Kirillov e9f75b1350 [LL FIR] add test which checks reference shortening for the whole file
^KT-57966
2023-05-04 15:26:50 +00:00
Dmitrii Gridin d66b919c12 [AA] introduce tests on annotation stability
^KT-57849
2023-04-21 10:14:05 +00:00
Ilya Kirillov 51eaa3f9cf [Analysis API] provide tests for the KtResolveExtensionProvider
^KT-57930
2023-04-19 16:09:05 +00:00
Anna Kozlova f810d435f4 [cls] write flexible type information to cls
^KTIJ-25172
this information would be used to create resolved FirElements from stubs,
so no ProtoBuf would be kept in memory
2023-04-14 18:12:48 +00:00
Dmitrii Gridin 9a4a3d1f49 [LL FIR] introduce test with reversed resolve order
^KT-56543

Merge-request: KT-MR-9299
Merged-by: Dmitrii Gridin <dmitry.gridin@jetbrains.com>
2023-03-22 17:34:07 +00:00
Ivan Kochurkin 8a3e2543f7 [K2, MPP] Ignore MPP tests in DiagnosisCompilerTestFE10TestdataTestGenerated 2023-03-22 01:28:17 +00:00
aleksandrina-streltsova e8272fa02e [Analysis API] Move testdata for scope provider 2023-03-20 22:04:48 +00:00
aleksandrina-streltsova 4b7164a557 [Analysis API] Allow handling scopes from KtScopeContext separately
^KT-55527
2023-03-20 22:04:48 +00:00
Dmitrii Gridin fae4cbb415 [LL FIR] fix test naming
^KT-55750
2023-03-20 20:25:46 +01:00
Yan Zhulanow c66f1a12cb [LL API] Handle 'KtScript' consistently in file-based provider 2023-03-15 19:22:43 +00:00
Dmitrii Gridin e20f72fcf8 [SLC] introduce tests on equality
^KT-56613
2023-03-01 10:43:01 +00:00
Dmitrii Gridin 0bd193ccba [SLC] rename AbstractSymbolLightClassesEqualityTest to AbstractSymbolLightClassesEquivalentTest
^KT-56613
2023-03-01 10:43:00 +00:00
Dmitrii Gridin 7273610d41 [SLC] introduce AbstractSymbolLightClassesParentingTestByPsi
^KT-56613
2023-03-01 10:43:00 +00:00