Commit Graph

633 Commits

Author SHA1 Message Date
Andrei Klunnyi 3eb0745b58 KTIJ-650 [Code completion]: "sealed interface" is for 1.5+ only 2020-12-17 18:28:04 +00:00
Ilya Kirillov 7be8d69870 FIR IDE: add completion weighers tests for return/if/while 2020-12-15 22:15:59 +01:00
Ilya Kirillov 299f36183c FIR IDE: add tests for completion weighers from old testdata 2020-12-15 22:15:53 +01:00
Andrei Klunnyi f02b73103b KTIJ-650 [Code completion]: no "sealed" for classes with modifiers
annotation, data, enum, inner, open - classes supplied with these
modifiers cannot be sealed.

Commit fixes code completion - "sealed" is no longer suggested in
the mentioned case.
2020-12-15 18:43:00 +01:00
Andrei Klunnyi fe64b13140 KTIJ-650 [Code completion]: support for "sealed interface"
^KTIJ-650 fixed
2020-12-15 18:10:23 +01:00
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
Ilmir Usmanov 05c4dfef3d Value classes: Use 'value' keyword instead of 'inline' in stub dumps 2020-11-27 23:52:08 +01:00
Ilya Kirillov 5c798d4e13 FIR IDE: fix test data in fir-ide module 2020-10-14 22:11:10 +03:00
Roman Golyshev 2b76fe8a72 [FIR Completion] Enable basic insertion handler tests for FIR completion
Enable tests that are passing
2020-10-01 15:42:50 +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
Yunir Salimzyanov 42da9e62db Cleanup 192 patchset files (KTI-315) 2020-08-19 19:40:02 +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
Mikhail Zarechenskiy beca7fca30 Fix completion order & presentation wrt to DeprecatedSinceKotlin 2020-06-29 14:25:09 +03:00
Roman Golyshev 2c12d26d28 KT-18538 Unwrap fake override in ShortenReferences
- Fake override prevents reference shortener from shortening of static
methods declared in the class bases when they are located not in
direct parent of the class (for example, in grand-
or grand-grand-parent)
- The completion uses descriptor with unwrapped fake override when it
performs the insertion. It leads to inserting the name of the base which
actually contains the static method instead of the direct parent class.
Now, when reference shortener compares unwrapped descriptors, this
problem should be fixed during insertion handling
2020-06-01 08:59:37 +00:00
Dmitry Gridin 11a3482970 tests: apply official code style
#KT-38632 Fixed
2020-05-07 12:36:44 +00: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 e19c0c9768 Update idea-completion testData after introducing vararg maxOf/minOf 2020-02-27 02:24:49 +03:00
Abduqodiri Qurbonzoda fe50bb4b93 KProperty and ReadOnlyProperty type parameter names #KT-16529 2020-02-26 17:34:03 +03:00
Roman Golyshev 3461effd47 KT-33372 Remove renaming file reference to the contents of the file
- There is still a hack with returning null from `getLastFileReference`,
it is here to keep KT-25674 issue fixed
- Overrides of `bindToElement` are removed, they caused renames of the
file references to their contents
- Code of `KotlinFilePathReferenceContributor.kt` is refactored
- ^KT-33372 ^KT-32514 ^KT-36306 Fixed
2020-02-16 17:08:11 +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
Nikolay Krasko f01b4706d1 Switch to 193 platform 2020-01-19 12:01:53 +03:00
Mikhail Zarechenskiy 547865d5c7 Fix tests for completion after fun keyword
It's correct from the current implemention but still questionable and
 should be discussed

 #KT-35990 Open
2020-01-17 19:37:48 +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
Toshiaki Kameyama ba640be81d KT-32178 Keyword completion: don't add 'fun' after 'suspend' in type position
#KT-32178 Fixed
2019-12-19 15:07:20 +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 3112d70420 KT-35042 Fix InsertHandlerProvider.kt to work with suspend functional parameters
- ^KT-35042 Fixed
- Also, fix review suggestions for KOTLIN-CR-3495
2019-11-29 14:55:22 +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 faf4c05fc8 KT-34644 Give return keyword more priority in completion where appropriate
- See `returnExpressionItems::returnIsProbableInPosition` to get an idea where return is supposed to be more appropriate
  - End of the block (except for top level block of unit function or cycle) or as single expression in if or when
  - Right side of the elvis operator (which is not already in return)
- Add additional `probable_keyword` weigher to signalize about probable keyword (for now it is only for `return`)
- ^KT-34644 Fixed
2019-11-26 11:56:32 +03:00