Commit Graph

25300 Commits

Author SHA1 Message Date
Roman Golyshev 75ed167566 FIR IDE: Use FirModuleResolveState instead of TowerDataContextProvider
This way we will have a single place to get information about scopes,
so in the future it would be easier to refactor it
2021-01-27 08:02:53 +00:00
Roman Golyshev dd91ebf1ea FIR IDE: Collect TowerDataContext only for block-level expressions
This makes finding right context easier later in situations like this:

```
fun test() {
  foo.bar.bazz()
}
```

Context is written for `bazz()` element, but we might want to find it
from `foo.bar.bazz()` element
2021-01-27 08:02:52 +00:00
Roman Golyshev b51b8b59b1 FIR IDE: Collect scopes in FirDesignatedImplicitTypesTransformerForIDE
We need this to capture scopes for properties
with initializers (like `val a = 10`)
2021-01-27 08:02:52 +00:00
Roman Golyshev 445edf8e28 FIR IDE: Mark FirTowerDataContextCollector as ThreadSafeMutableState
Also, use HashMap instead of LinkedHashMap
in `FirTowerDataContextCollector`
2021-01-27 08:02:51 +00:00
Roman Golyshev 11564d7950 FIR: Collect all scopes in FirModuleResolveStateImpl
We need to collect the scopes to later use them in reference shortening

Probably we will need to optimize this behaviour later, since it seems
inefficient
2021-01-27 08:02:50 +00:00
sebastian.sellmair dcda47b502 Ensure that Decompiler and IDE agree on rendered function types with parameterized annotations
findDecompiledDeclaration.kt: Use same DescriptorRenderer options as Decompiler

DescriptorRendererImpl.kt: not enforce different AnnotationArgumentsRenderingPolicy for function type annotations

This will fix KTIJ-563 where rendered Descriptors are used as Keys
for GOTO navigation into decompiled sources.

^KTIJ-563 fixed
2021-01-26 12:24:53 +00:00
Mikhail Zarechenskiy a33877a9b9 Fix add import quick fix for unresolved conventional invoke operator
After adding extension invoke on DeepRecursiveFunction in 1.4,
 the compiler start reporting another error and now it doesn't write
 info about callable descriptor. Therefore it's needed to use another
 source of info for expression type

 ^KT-40926 Fixed
2021-01-22 13:57:47 +03:00
Alexander Dudinsky 6dc0440cd0 Remove commented code in previous commit 2021-01-21 18:47:48 +03:00
Alexander Dudinsky 71e74497b5 Use addTestJdk&removeTestJdk methods instead addJdk&removeJdk 2021-01-21 18:38:06 +03:00
Mikhail Glukhikh 20843b6894 Remove error suppression in KotlinChangeSignatureDialog 2021-01-21 18:32:34 +03:00
Pavel Kirpichenkov 628d6a9c30 Don't store logger in instance field 2021-01-21 16:53:09 +03:00
Pavel Kirpichenkov 5003738d29 Fix: use idea caches correctly
Instead of using value from cache the first created value
was being saved to field and not invalidated later.
2021-01-21 16:53:09 +03:00
Igor Yakovlev 243f85a4d6 [FIR IDE] Add base support for FIR incomplete types resolve 2021-01-21 15:20:30 +03:00
Andrei Klunnyi 77ffc318f2 KT-44250 [Sealed interfaces]: completion fails for 'when' with sealed 2021-01-21 10:53:36 +00:00
Yaroslav Chernyshev 6aa6f82c47 Fix MultiplatformModelImportingContextImpl#isOrphanSourceSet predicate 2021-01-19 17:28:15 +03:00
Vladimir Dolzhenko 6331a135c8 Add LightClassUtil.getLightClassMethodsByName to avoid resolving all lightClassMethods and filtration later on 2021-01-18 11:13:16 +00:00
Ilya Kirillov 8fa848bed3 FIR IDE: fix testdata after rebase 2021-01-15 17:23:12 +01:00
Ilya Kirillov 459c919072 FIR IDE: introduce JAVA_SYNTHETIC_PROPERTY symbol origin 2021-01-15 17:23:12 +01:00
Ilya Kirillov a5e6c1d82b FIR IDE: implement new getTopLevelFunction(/property)Symbols in FirModuleWithDependenciesSymbolProvider 2021-01-15 17:23:11 +01:00
Ilya Kirillov 450ab33f16 FIR IDE: do not highlight by-name argument as parameter 2021-01-15 17:23:11 +01:00
Ilya Kirillov b405cbb1ff FIR IDE: consider synthetic functional interfaces to have LIBRARY origin 2021-01-15 17:23:10 +01:00
Ilya Kirillov 981f932033 FIR IDE: ignore synthetic references in reference resolve 2021-01-15 17:23:10 +01:00
Ilya Kirillov 56bd6a30b3 FIR IDE: introduce delegated symbol origin 2021-01-15 17:23:09 +01:00
Ilya Kirillov 2a9779cd89 FIR IDE: resolve reference to intersection override member to overridden members 2021-01-15 17:23:09 +01:00
Ilya Kirillov 2ef8f58d90 FIR IDE: add KDoc for KtSymbolOrogin 2021-01-15 17:23:08 +01:00
Ilya Kirillov e060778528 FIR IDE: implement assignment statement references 2021-01-15 17:23:07 +01:00
Ilya Kirillov 14d2b1be49 FIR IDE: resolve by-name-parameter call 2021-01-15 17:23:07 +01:00
Ilya Kirillov 47894c6cc9 FIR IDE: invalidate LibraryModificationTracker in memory leak test 2021-01-15 17:23:06 +01:00
Ilya Kirillov 87e6dbf435 FIR IDE: generate heap dump on memory leak in memory leak test 2021-01-15 17:23:06 +01:00
Ilya Kirillov f454ec8e4a FIR IDE: introduce methods for working with annotations 2021-01-15 17:23:05 +01:00
Ilya Kirillov 132fc9e68b FIR IDE: invalidate caches between tests 2021-01-15 17:23:04 +01:00
Ilya Kirillov 861c9b8e45 FIR IDE: unmute passing tests
fix unmute passing
2021-01-15 17:23:04 +01:00
Ilya Kirillov c97c4fa99c FIR IDE: fix finding fir in container which have conflicting duplicate by name 2021-01-15 17:23:03 +01:00
Ilya Kirillov 601d5cbff8 FIR IDE: fix duplicating diagnostics collection 2021-01-15 17:23:03 +01:00
Ilya Kirillov c2866152bf FIR IDE: fix not initialized containingClassAttr for copied declaration 2021-01-15 17:23:02 +01:00
Ilya Kirillov a7903c64f1 FIR IDE: do not consider function literal as fqName-having declaration 2021-01-15 17:23:02 +01:00
Ilya Kirillov 1fb33207b8 FIR IDE: add meaningful error message when opening non-source file 2021-01-15 17:23:01 +01:00
Ilya Kirillov 1901436c96 FIR IDE: add more info to error messages 2021-01-15 17:23:01 +01:00
Ilya Kirillov c131983188 FIR IDE: implement FirIdeProvider.getClassNamesInPackage
#KT-41048 fixed
2021-01-15 17:23:00 +01:00
Ilya Kirillov 4d07eb27bb FIR IDE: add incremental analysis test for function in companion object 2021-01-15 17:23:00 +01:00
Ilya Kirillov e63d084cdc FIR IDE: allow getting light class name from EDT 2021-01-15 17:22:59 +01:00
Ilya Kirillov d53af8170b FIR IDE: cache module libraries 2021-01-15 17:22:59 +01:00
Ilya Kirillov 8c113f02d5 FIR IDE: consider top level file change as out of block modification 2021-01-15 17:22:58 +01:00
Ilya Kirillov d3dd6e3b96 FIR IDE: delegate light classes is valid to corresponding symbol validity check 2021-01-15 17:22:58 +01:00
Ilya Kirillov a95f38569f FIR IDE: fix FirModuleWithDependenciesSymbolProvider recursive calls 2021-01-15 17:22:58 +01:00
Dmitry Savvinov 78b2eb994b Deduplicate logic of computing orphan source sets in MPP Gradle Import
Set of compiled source sets is already available in
MultiplatformModelImportingContext via
'sourceSetsToParticipatedCompilations.keys', no need to recompute it

^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov 1d0a696a62 Simplify building of source-sets during MPP Import
Build dependsOn closure straight away by using KotlinSourceSetProto
instead of building first KotlinSourceSetImpls with incorrect
dependsOn-names, and then discarding it

^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov 9e58e3c3fd Remove unused KotlinSourceSetImpl.defaultIsTestModule; simplify logic of test modules detection
^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov 58b2064295 Introduce MultiplatformModelImportingContext
Essentially it is responsible for returning various information about
the model being imported, such as:

- flags and properties, which configure the process of import
- "bulk" requests which might be needed multiple times during import,
but which are more convenient to be computed once, like various indices
(source sets by name, compilations by source-sets, etc.)

^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov f87aa4612b Minor: return map straight away 2021-01-15 11:12:45 +03:00