Commit Graph

305 Commits

Author SHA1 Message Date
Ilya Kirillov a0651cdba7 FIR IDE: add Java synthetic properties support for completion 2020-12-12 12:27:48 +01:00
Dmitriy Novozhilov eeb9b3214c Switch to 202 platform 2020-11-28 14:25:19 +03: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 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
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
Nikita Bobko ef562598ea 202: Fix MultiFileJvmBasicCompletionTestGenerated
It was broken by 4bef803e1b5994e9ea9731acfb5095a94b1b1383 in intellij
2020-07-01 11:31:21 +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 66ffdf1b2d KT-33979 KT-34150 Remove filtering overridden object members and nested objects
- ^KT-33979 Fixed
- ^KT-34150 Fixed
- Also, in extension completion check descriptor instance first
2019-12-03 13:29:30 +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
Nikolay Krasko 394a812329 Re-mute completion tests (KT-32919) 2019-11-22 22:12:37 +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
Nikolay Krasko 030aaee117 Mute completion tests (KT-32919) 2019-10-03 12:24:46 +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
Roman Golyshev b422485440 KT-30996: Use the last receiver to complete dsl methods
- change `detectReceiverTypes` return type to `List` instead of `Collection`
  - it reflects that receiver types are actually ordered
  - did not propagate signature changes to all possible places because it creates too much noise in git history
- ^KT-30996 Fixed
2019-09-13 15:52:52 +03:00
Roman Golyshev 9a938b07ba KT-17689: Fix TypeAliasQualifier to provide enum entries descriptors
- this adds enum entries to the completion on the typealiases
- we cannot use `unsubstitutedInnerClassesScope` instead of `EnumEntriesScope` because it allows to complete things that are not allowed to be resolved by the Kotlin compiler; see `EnumEntriesScope` doc for details
- ^KT-17689 Fixed
2019-09-06 12:11:23 +03:00
Mikhail Zarechenskiy c03dfd1522 [IDE-NI-MIGRATE] Migrate completion tests for new inference 2019-05-06 13:59:26 +03:00
Yan Zhulanow fb3efd2d78 Debugger: Fix completion for synthetic '_field' extension properties (KT-23586) 2019-04-11 17:46:14 +03:00
Simon Ogorodnik 6b07cd1950 Update testData due to changes in stdlib
New function equals, and kotlin.js.JsName in common
2018-11-15 16:27:20 +03:00
Ilmir Usmanov c4d0b5493a Fix NPE in suspension point in monitor call checker
#KT-27484 Fixed
2018-10-11 14:38:34 +03:00
shiraji fd3fe52eb4 Fix the problem with code completion of type extension method
KT-23834 Fixed
2018-09-11 14:24:45 +03:00
Pavel V. Talanov b59f134f78 Fix completing members for receivers shadowed by DslMarker
#KT-20396 Fixed
2018-08-16 13:59:38 +02:00
Nikolay Krasko 759ffafb0a Render flexible types with enhancement as enhanced in IDE (KT-25622)
Main targets for the fix is completion, parameters info, inlay hints and
override/implement.

Other IDE functions might be affected.

 #KT-24911 Fixed
 #KT-25616 Fixed
 #KT-25622 Fixed
2018-08-03 16:00:09 +03:00
Dmitry Savvinov f90b29c2e3 Support contracts in PartialBodyResolveFilter
Previously, PartialBodyResolveFilter didn't know about contracts and was
filtering out calls of such functions, leading to unstable completion in
cases like that:

fun test(x: Any?) {
    require(x is String)
    x.<caret>
}

However, PartialBodyResolveFilter works by pure PSI, while to determine
if function has a contract we have to resolve it.

To solve it, we do something very similar to what has been done with
Nothin-returning functions: introduce
KotlinProbablyContractedFunctionShortNameIndex, which collects all
function which *may* have a contract during indexing.

^KT-25275 Fixed
2018-07-27 16:59:24 +03:00
Alexander Podkhalyuzin 5a752da9e9 Updated tests #KT-23546 Comment 2018-04-06 16:25:09 +03:00
Ilmir Usmanov 18c03f94f8 Move coroutineContext to correct package
from kotlin.coroutines.experimental.instrinsics to kotlin.coroutines.experimental

 #KT-22400
2018-02-01 13:18:32 +03:00