Commit Graph

68052 Commits

Author SHA1 Message Date
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
Ilya Kirillov 88548d988a FIR IDE: implement getCallableNames/getClassifierNames in more scopes 2020-08-09 12:00:18 +03:00
Ilya Kirillov 138f11ee27 FIR IDE: introduce member scope tests 2020-08-09 12:00:11 +03:00
Ilya Kirillov f709e6acf3 FIR IDE: introduce scopes for HL API 2020-08-09 12:00:05 +03:00
Dmitriy Novozhilov 6596dc359b fixup! Completion with FIR (prototype, work-in-progress) 2020-08-09 12:00:04 +03:00
Ilya Kirillov d62500531b FIR: add getClassifierNames for FirScope 2020-08-09 11:59:57 +03:00
Roman Golyshev 656086f90a Add FirScope::getCallableNames function 2020-08-09 11:59:50 +03:00
Ilya Kirillov 1f3add49f4 FIR IDE: move trailing comma related registry keys to ide-frontend-independent.xml 2020-08-09 11:59:49 +03:00
Ilya Kirillov 055b975699 FIR IDE: add tests which failing with exceptions inside FIR 2020-08-09 11:59:49 +03:00
Ilya Kirillov 9cf4fdfb71 FIR IDE: add reference info on reference resolve 2020-08-09 11:59:44 +03:00
Ilya Kirillov 5c6d636d02 Minor: reformat fir ide part of GenerateTests.kt 2020-08-09 11:59:38 +03:00
Ilya Kirillov 45e01a8b3d FIR IDE: precalculate DuplicatedFirSourceElementsException error message
It may be called from non-read action
2020-08-09 11:59:33 +03:00
Ilya Kirillov 964becf138 FIR IDE: allow the same entity to be accessed from different threads 2020-08-09 11:59:23 +03:00
Ilya Kirillov 4c08dfb238 Add invoke reference resolve test without errors in test data 2020-08-09 11:59:17 +03:00
Ilya Kirillov 15ecfd84b4 FIR IDE: cache KtAnalysisSession for modules 2020-08-09 11:59:15 +03:00
Ilya Kirillov 8c0197e081 FIR IDE: introduce KtAnalysisSessionProvider & helping functions for working with analysis session 2020-08-09 11:59:10 +03:00
Ilya Kirillov acb8546583 FIR IDE: fix ReadOnlyWeakRef error message 2020-08-09 11:59:05 +03:00
Ilya Kirillov b09358fe17 FIR IDE: rename KtFieldSymbol -> KtFirJavaFieldSymbol 2020-08-09 11:59:04 +03:00
Ilya Kirillov f98ff2c25e FIR IDE: always pass resolve state as parameter when getting fir by psi 2020-08-09 11:59:04 +03:00
Mikhail Zarechenskiy 0c13a7f89a Fix accessibility check for experimental declarations from default scope
#KT-40919 Fixed
2020-08-07 17:49:15 +03:00
Ilmir Usmanov b403b63f48 Ease field initialization check
Since there is already VAL_REASSIGNMENT diagnostics, we can safely only
for direct assignments.
 #KT-40893 Fixed
2020-08-07 14:22:18 +02:00
Nick 6c0abe7e48 [FIR] Fix CliTestGenerated$Jvm.testFirError 2020-08-07 13:27:29 +03:00
Pavel Kirpichenkov 9ca4717d11 Revert "Introduce @FrontendInternals annotation"
Revert due to Mobile IDE Trunk IJ TC configuration
This reverts commits:
ffc3d8bdfc
c0e713980b

^KT-39643 In Progress
2020-08-07 12:10:03 +03:00
Mads Ager 7f2efabe6a [JVM_IR]: Improve stepping for when.
Additionally, use the line number of the class for default interface
dispatch methods.
2020-08-07 09:16:01 +02:00
Dat Trieu 1009a240f2 KT-20357: Add samples for filter functions 2020-08-06 23:41:12 +03:00
Steven Schäfer ca6e430e89 JVM IR: Handle nested classes in DelegatedPropertyOptimizer 2020-08-06 21:01:59 +02:00
Steven Schäfer da9bff40f0 JVM IR: Don't remove stores to visible locals in DelegatedPropertyOptimizer 2020-08-06 21:01:59 +02:00
Ilya Kirillov 983c84d6a6 Wizard: fix default template compilation when using JS IR
#KT-39904 fixed
2020-08-06 21:46:50 +03:00