Commit Graph

245 Commits

Author SHA1 Message Date
Mikhail Glukhikh 0d6bc7e7b2 FIR: report ANNOTATION_CLASS_CONSTRUCTOR_CALL diagnostic 2021-05-20 12:22:20 +03:00
Igor Yakovlev 966743c704 [FIR IDE] Enable passing completion tests 2021-05-14 23:05:49 +03:00
Ilya Kirillov a08c267c37 FIR IDE: mute a few completion tests as they now fails because of unexpected keywords 2021-05-12 21:39:59 +03:00
Ilya Kirillov 98becc9a50 FIR IDE: remove FIR_IGNORE from passing completion test after implementing basic keyword completion 2021-05-12 21:39:58 +03:00
Ilya Kirillov da6c5e13d5 FIR IDE: add completion support to classes and to type aliases 2021-04-21 21:16:56 +03:00
Roman Golyshev 0d7eb971ca Fix test data 2021-04-13 11:40:24 +00:00
Roman Golyshev e0fca9d2f6 FIR IDE: Add visibility checks to the completion
Visibility checks currently do not work in some cases, for example:

- public nested class of private class is seen globally
- private_for_this does not work
- some other cases I am not yet aware of

If `FirVisibilityChecker.isVisible` fix those issues, they will be fixed
automatically in the completion
2021-04-13 11:40:23 +00:00
Roman Golyshev 28d8d2d903 FIR IDE: Search for the first non-local declaration in EnclosingDeclarationContext::detect
Local declarations do not have a stable `ClassId`, which is used in
`declarationUtils.collectDesignation`. Local classes will always have
`outerClassId.isLocal = true`, even when it is not true (see
`org.jetbrains.kotlin.fir.builder.Context.currentClassId` for why this
happens)
2021-04-13 11:40:20 +00:00
Roman Golyshev 0d2158325a Remove redundant ticks from test data 2021-04-13 11:40:19 +00:00
Abduqodiri Qurbonzoda 46338224e1 Remove deprecated JQuery 2021-04-08 18:43:16 +03:00
Abduqodiri Qurbonzoda 40d1849f33 Migrate compiler, idea and others to new case conversion api 2021-04-08 03:22:02 +03:00
Roman Golyshev abeff5d5c5 Enable passing tests 2021-03-19 12:37:40 +03:00
Roman Golyshev f641466f70 FIR IDE: Fix searching for the closest function to re-resolve
If the function is local, there would be errors related to its
unresolved body and receiver type
2021-03-19 12:37:39 +03:00
Mark Punzalan 1c94372b6c FIR checker/IDE: Add checker and quickfix for VAL_WITH_SETTER. 2021-02-25 13:06:53 +01:00
Jinseong Jeon 9aaa952b39 FIR: regard implicit type for value parameter after body resolve as an error type 2021-02-19 10:17:16 +03:00
Roman Golyshev 7a4625b70b FIR IDE: Enable passing completion test 2021-02-12 14:29:22 +03:00
Dmitriy Novozhilov 17230397e6 [Test] Update or drop some IDE tests about experimental coroutines 2021-01-28 13:19:34 +03:00
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
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 5c798d4e13 FIR IDE: fix test data in fir-ide module 2020-10-14 22:11:10 +03:00
Roman Golyshev 6c79040cfb [FIR Completion] Enable passing tests 2020-10-01 13:07:20 +03:00
Roman Golyshev edb277b30a FIR Completion: Enable passing tests 2020-09-12 11:49:36 +00:00
Roman Golyshev dcc22d3e5d FIR IDE: Fix completion in property setters
Property consists of getter and setter (both optional). The setter
have a single `value` parameter with type

Because of it, we have to make a separate 'frankenstein setter' with
original resolved header, but with the body of the fake one

It seems that getters does not have such issues
2020-09-12 11:49:35 +00:00
Roman Golyshev 7bd9c52732 FIR Completion: Fix completion in function calls (foo.bar<caret>())
In such expressions, `KtCallExpression` wraps `KtSimpleNameExpression`,
so `getQualifiedExpressionForSelector()` returns `null`

Also, enable tests that are fixed by this
2020-09-09 13:14:08 +03:00
Pavel Kirpichenkov d674f519fd [FIR-IDE] Fix completion check for generic extensions
Generic candidate extensions are completed in partial mode
when there is not enough information for type parameter in return position.
Partial completion mode in single candidate resolver leads to unconditionally failing candidate.
Providing noExpectedType instead of null guarantees full completion.
2020-09-07 13:38:11 +03:00
Pavel Kirpichenkov 8b28e54584 [FIR-IDE] Update tests 2020-09-03 16:44:57 +03:00
Pavel Kirpichenkov ec072798b1 [FIR-IDE] Hack for checking single candidate resolver in tests 2020-09-02 19:15:06 +03:00
Roman Golyshev 3d5ec8aa10 FIR Completion: Add simple classifiers completion
- This also fixes a few test
2020-09-02 14:32:53 +03:00
Ilya Kirillov 106d8e74d4 FIR IDE: unmute passing completion tests 2020-09-02 11:16:20 +03:00
Ilya Kirillov 8714ad575f FIR IDE: move FIR IDE completion tests to idea-fir module 2020-09-02 11:16:16 +03:00
Roman Golyshev 64187b40c9 FIR Completion: Prevent immediate completion in number literals
- This is copied from the original KotlinCompletionContributor
2020-08-10 18:25:32 +03:00
Roman Golyshev 1b3a1a662f Add simple completion of class-like symbols 2020-08-09 12:02:34 +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 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 2eb439899e Use index to get symbols from importing scopes 2020-08-09 12:01:25 +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 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
Mikhail Zarechenskiy 507a718632 Update tests for completion after adding DeprecatedSinceKotlin 2020-06-29 17:41:05 +03:00
Roman Golyshev 90750483ee KT-36860 Collect extensions from object on first completion
- This should not affect the performance of the completion, since all
object extensions are collected on the last step, when all main variants
are already collected
- Add more tests
- Also, disable completion of extensions from objects as callable
references (^KT-37395 Fixed)
- ^KT-36860 Fixed
2020-03-11 13:31:56 +03:00
Abduqodiri Qurbonzoda fe50bb4b93 KProperty and ReadOnlyProperty type parameter names #KT-16529 2020-02-26 17:34:03 +03:00
Ilya Gorbunov c37a2d3dc3 Fix completion test: add coroutines-compat jar dependency
Related to KT-34582
2020-01-29 09:12:43 +03:00
Roman Golyshev 4b50fb18fb KT-35258 Add better completion for MixedNamedArgumentsInTheirOwnPosition feature
- When named parameter is on its own position, the completion of the next argument will not be limited by named arguments only
- The completion will not suggest already used arguments names
- ^KT-35258 Fixed
2020-01-17 12:06:08 +03:00
Roman Golyshev 42deb7db48 KT-34582 Exclude kotlin.coroutines.experimental package from completion and auto-import
- Exclusion happens only when `ReleaseCoroutines` feature is supported
- Add `LANGUAGE_VERSION` to few tests to make sure that previous exclusions still work when `experimental` package is not excluded entirely
- ^KT-34582 Fixed
2019-12-29 15:35:49 +03:00
Roman Golyshev 6f234beb9c KT-34414 Make sure completion for suspend functional parameters works too
- Replace `isFunctionType` with `isBuiltinFunctionalType` where it is relevant
- ^KT-34414 Fixed
2019-11-29 14:55:21 +03:00
Roman Golyshev 3661dedacf KT-31762: Fix completion in enum entries constructors
- The issue was caused by incorrect parsing of enum entry because of `$` in the `KotlinCompletionContributor::DEFAULT_DUMMY_IDENTIFIER`
  - Incorrect parsing caused arguments next to completed one to be recognized as another enum entries
- Change `KotlinCompletionContributor::isInClassHeader` to accept classes without bodies, so identifier without `$` is used inside enum entries constructors
- ^KT-31762 Fixed
2019-10-29 12:35:13 +03:00
Roman Golyshev 6560ecc82b KT-15286: Provide object member extensions in the completion
- Add extensions only when completion of static members is enabled (double ctrl + space and nonempty prefix)
- Add full import for callables with receiver in `LookupElement.decorateAsStaticMember`
2019-10-18 17:17:28 +03:00
Roman Golyshev 0239229dfc KT-33903: consider imports from objects when removing descriptors duplicates
- `ImportedFromObjectCallableDescriptor` and descriptors in general do
not have consistent `equals`,  which leads to duplication in completion
when multiple functions from objects are imported, or when function is
visible in some scope both implicitly and by import (see KT33903_1.kt)
- ^KT-33903 Fixed
2019-09-26 18:23:04 +03:00
Alexander Podkhalyuzin d018489621 Fixed testdata
JS stdlib contains more classes now, so we need to filter them out
2019-09-26 16:25:50 +03:00