Ilya Kirillov
b41a5f9f34
FIR: make TypeRegistry thread safe
2020-08-09 12:04:26 +03:00
Ilya Kirillov
5f424ed1ec
FIR IDE: rewrite low level API
...
- Cache ModuleResolveState for module till the world changes
- Resolve every file under a lock
- All creation of raw fir files and resolve of them happens in FirFileBuilder
- Lazy resolve of fir elements happens in FirElementBuilder
Caching works like the following:
- FirModuleResolveState holds PsiToFirCache & DiagnosticsCollector & FileCacheForModuleProvider
- FileCacheForModuleProvider holds a mapping from ModuleInfo to ModuleFileCache
- ModuleFileCache caches
- KtFile -> FirFile mapping
- ClassId -> FirClassLikeDeclaration, CallableId -> FirCallableSymbol
which used in corresponding FirProvider
- mapping from declaration to it's file
which used in corresponding FirProvider
- locks for fir file resolving
- PsiToFirCache provides mapping from KtElement to FirElement
- DiagnosticsCollector collects diagnostics for file and caches them
2020-08-09 12:04:11 +03:00
Ilya Kirillov
1957be8757
FIR IDE: fix testdata of tests which now pass
2020-08-09 12:04:03 +03:00
Ilya Kirillov
34aa848b15
FIR: do not allow getting PSI text in RawFirBuilder in stub mode
2020-08-09 12:04:03 +03:00
Ilya Kirillov
cfc46b0cc8
FIR IDE: introduce FirIdeAllSourceDependenciesSymbolProvider
...
Co-authored-by: Simon Ogorodnik <simon.ogorodnik@jetbrains.com >
2020-08-09 12:03:56 +03:00
Ilya Kirillov
7d8ef5c7a2
FIR IDE: introduce KtFirConstructorDelegationReference
2020-08-09 12:03:54 +03:00
Ilya Kirillov
0870ded054
FIR IDE: introduce KtFirArrayAccessReference
2020-08-09 12:03:47 +03:00
Ilya Kirillov
22054c8507
FIR IDE: use non-fake override fir elements when finding psi for fir
2020-08-09 12:03:40 +03:00
Ilya Kirillov
d10e3f91fa
FIR IDE: store FirScope strong references only in KtFirAnalysisSession
2020-08-09 12:03:33 +03:00
Ilya Kirillov
7033be588c
FIR IDE: regenerate member scope test
2020-08-09 12:03:27 +03:00
Ilya Kirillov
ea3b2d8310
KT IDE: fix fully-qualified type resolving
2020-08-09 12:03:26 +03:00
Ilya Kirillov
50951fdfc3
KT IDE: use proper package symbol PSI to fix invalidated access exception
2020-08-09 12:03:14 +03:00
Ilya Kirillov
9f9ce6ba61
Fix compilation of KtFirDelegatingScope
2020-08-09 12:03:07 +03:00
Ilya Kirillov
1c195ea2bb
FIR IDE: add kdoc for KtAnalysisSession
2020-08-09 12:03:07 +03:00
Ilya Kirillov
b8caefa0c4
FIR IDE: always recreate analysis session in tests to avoid breaking its contract
2020-08-09 12:03:06 +03:00
Ilya Kirillov
19efd19c6c
FIR IDE: fix AbstractSymbolByFqNameTest after rebase
2020-08-09 12:03:01 +03:00
Ilya Kirillov
94b62e2ac6
FIR IDE: make context-dependent analysis session to use original cache on read-only mode
2020-08-09 12:03:00 +03:00
Ilya Kirillov
c0f5c90231
FIR IDE: separate ValidityOwner to ValidityTokenOwner & ValidityToken
2020-08-09 12:02:49 +03:00
Ilya Kirillov
6a6580dd97
FIR IDE: introduce KtConstructorSymbol.ownerClassId
...
Will be needed for completion
2020-08-09 12:02:48 +03:00
Ilya Kirillov
4653cdf794
FIR IDE: make KtFirDelegatingScope caching a thread safe
2020-08-09 12:02:42 +03:00
Roman Golyshev
ebf20c9706
Add multi-file tests for primitive completion
...
- This is required to test/debug correct completion from imports
2020-08-09 12:02:40 +03:00
Roman Golyshev
1b3a1a662f
Add simple completion of class-like symbols
2020-08-09 12:02:34 +03:00
Roman Golyshev
20c627ea47
Implement collecting class-like names in KtFirStarImportingScope
2020-08-09 12:02:28 +03:00
Roman Golyshev
29ee233bb9
Remove repeating scopes collected by buildCompletionContextForFunction
...
- This is certainly a bug, we would have to fix it later
2020-08-09 12:02:27 +03:00
Roman Golyshev
e3778d62e3
Simplify canBeCalledWith function
2020-08-09 12:02:21 +03:00
Roman Golyshev
b90503decb
Move PackageIndexHelper to KtFirStarImportingScope.kt
2020-08-09 12:02:16 +03:00
Roman Golyshev
d2fbd8e338
Remove KotlinFirCompletionProvider
...
- We should strive to use only high-level API for completion from now on
2020-08-09 12:02:16 +03:00
Ilya Kirillov
dee58e1d86
FIR IDE: handle importing scopes in completion in HL API
...
Co-authored-by: Roman Golyshev <roman.golyshev@jetbrains.com >
2020-08-09 12:02:11 +03:00
Ilya Kirillov
7aa26944d7
FIR IDE: rename utils.kt to psiUtils.kt
...
Co-authored-by: Roman Golyshev <roman.golyshev@jetbrains.com >
2020-08-09 12:02:00 +03:00
Ilya Kirillov
902b42ae1d
FIR IDE: fix typo in completion testdata
...
Co-authored-by: Roman Golyshev <roman.golyshev@jetbrains.com >
2020-08-09 12:01:59 +03:00
Roman Golyshev
c3a3ab9e89
Implement the completion using high-level API only
...
- The indecies are not yet used
Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com >
2020-08-09 12:01:59 +03:00
Roman Golyshev
a6dd84a7e4
FIR IDE: Modify KtFirAnalysisSession for completion
...
- This is WIP solution for having a specialized `KtFirAnalysisSession`
for the completion
Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com >
2020-08-09 12:01:54 +03:00
Roman Golyshev
54946a793a
Fix FirCompletionContext for safe access elements
...
- `towerDataContextForStatement` may contain safe access (?.) fir
elements as keys; however, `state.getCachedMapping(current)` would
never return those since they are considered as sugar fir elements
Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com >
2020-08-09 12:01:49 +03:00
Roman Golyshev
a2cf01162e
Fix bug with member extensions with explicit receiver
...
Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com >
2020-08-09 12:01:48 +03:00
Roman Golyshev
df03e31b86
FIR IDE: Add KtCallableSymbol abstraction
...
- It should incapsulate callable symbols like functions, properties
and constructors
Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com >
2020-08-09 12:01:44 +03:00
Roman Golyshev
a4a2d92c08
FIR IDE: Make KtFirReference implement KtSymbolBasedReference
...
Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com >
2020-08-09 12:01:35 +03:00
Roman Golyshev
2eb439899e
Use index to get symbols from importing scopes
2020-08-09 12:01:25 +03:00
Dmitriy Novozhilov
cefecdef25
fixup! Iterate on symbols, not on scopes
2020-08-09 12:01:23 +03:00
Roman Golyshev
e7f5594ffe
Use more correct check for the constructor symbol
...
- add test for extension function receiver
2020-08-09 12:01:23 +03:00
Roman Golyshev
a3da1ea1a0
Iterate on symbols, not on scopes
...
- This way it is easier to get the correct results
2020-08-09 12:01:15 +03:00
Roman Golyshev
708c54f4d2
Refactor the collecting of callable symbols from scopes
2020-08-09 12:01:07 +03:00
Roman Golyshev
81f60bf252
Add test for smartcast
2020-08-09 12:01:07 +03:00
Roman Golyshev
ffb907150a
Use information about receivers in completion
...
- Found few problems during resolving a single functon; disabled
assertions and marked them with TODO
- Add simple completion tests to simplify development
2020-08-09 12:01:00 +03:00
Roman Golyshev
0f5fc1fa99
Add FirSymbolProvider::getAllCallableNamesInPackage function
...
- Also, fix implementation of `getCallableNames` in few cases
2020-08-09 12:00:59 +03:00
Denis Zharkov
97d4918ed3
Expose local scopes to use in completion
2020-08-09 12:00:52 +03:00
Roman Golyshev
6129f4bcef
Partial raw FIR building
2020-08-09 12:00:45 +03:00
Roman Golyshev
a1b621d987
Completion with FIR (prototype, work-in-progress)
2020-08-09 12:00:44 +03:00
Ilya Kirillov
2a495c1135
FIR IDE: introduce composite scopes
2020-08-09 12:00:38 +03:00
Ilya Kirillov
9092b33755
FIR IDE: Introduce module resolve state for completion
2020-08-09 12:00:31 +03:00
Ilya Kirillov
1d92fbaa7f
FIR IDE: correctly set symbol origin for fake overridden ones
2020-08-09 12:00:24 +03:00