Commit Graph

205 Commits

Author SHA1 Message Date
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
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
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
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
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
Kirill Rakhman b567817d1f Make completion for overriding functions respect suspend modifier
Fixes #KT-22200
2018-01-16 15:42:03 +01:00
Toshiaki Kameyama 27e7f13335 Fix AssertionError on completing after template in string literal
#KT-16402 Fixed
2017-11-13 16:01:34 +03:00
Simon Ogorodnik d6143e2af6 Fix testData broken after KT-12797 2017-10-31 21:11:19 +03:00
Simon Ogorodnik 213ce01152 Update testData for completion, broken after KT-13220 2017-10-30 17:31:15 +03:00
Simon Ogorodnik 8631e898a7 KT-12797: Fix completion to show inner classes from base class
#KT-12797 fixed
2017-10-25 18:07:37 +03:00
Simon Ogorodnik 7a991ddc25 KT-13220: Add completion for variable names
Using parameter name completion

#KT-13220 fixed
2017-10-18 19:11:13 +03:00
Simon Ogorodnik 4972dbfc2d KT-17165: Support array literals in annotations in completion
#KT-17165 fixed
2017-10-12 18:15:53 +03:00
Simon Ogorodnik c41c5f1916 KT-19145: Enable type completion for extension properties
#KT-19145 fixed
2017-07-27 09:57:11 +03:00
Simon Ogorodnik cc8933c82b KT-17074: Make completion respect DslMarker's
#KT-17074 fixed
2017-07-14 21:06:43 +03:00
Denis Zharkov bc564af2fc Regenerate mockJDK using openJDK 7 2017-06-24 17:26:01 +03:00
Simon Ogorodnik 9a969b0449 Add basic completion for operator fun names
#KT-11250 fixed
2017-04-28 15:06:27 +03:00
Valentin Kipyatkov b5dd2cc540 Completion of lambda parameters
Also changed policy for sorting of smart completion items in basic completion

 #KT-16800 Fixed
 #KT-12002 Fixed
2017-03-20 19:08:02 +03:00
Ilya Gorbunov eebb820060 Do not refer to java packages in common completion tests 2017-02-22 17:28:02 +03:00
Ilya Gorbunov 38b79a51d5 Fix tests after introducing exlcusions to default imports of kotlin.js package. 2017-01-30 19:44:51 +03:00
Denis Zharkov 88b82d5fa2 Exclude coroutine inrinsics and internal packages
#KT-16018
2017-01-30 15:45:02 +03:00
Simon Ogorodnik b422b0e24d KT-14722 completion list isn't filled up for typealias to object
#KT-14722 fixed
2017-01-28 21:42:39 +03:00
Simon Ogorodnik 2a08e3c679 KT-14767 typealias to annotation class should appear in the completion list
#KT-14767 fixed
2017-01-27 21:29:23 +03:00
Mikhail Zarechenskiy 462aed35d3 Don't exclude callable references with type parameters from completion 2017-01-26 14:48:37 +03:00
Simon Ogorodnik 3948c1e007 KT-15153 Support typeAlias extensions in completion and add import
#KT-15153 fixed
2017-01-25 20:47:48 +03:00
Simon Ogorodnik 4ca10c61fd KT-11308 Hide kotlin.jvm.internal package contents from completion and auto-import
#KT-11308 fixed
2017-01-25 17:39:36 +03:00
Zalim Bashorov cd04e794ee KJS: class MathClass -> object Math 2017-01-23 14:14:13 +03:00
Dmitry Petrov 8e3fd0efc3 If the last argument of a function is a suspend function,
suggest trailing lambda variant in completion.
2016-12-15 23:58:14 +03:00
Ilya Gorbunov d103657e07 Fix JS completion tests: remove unneeded imports, take care about type aliases looking different in completion. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov fbcf7c146b Remove JavaPackage from common completion tests, move to java-specific tests 2016-11-07 21:39:42 +03:00
Ilya Gorbunov 6656d10c67 Fix tests: do not refer to removed things. 2016-11-07 21:39:41 +03:00
Valentin Kipyatkov a2ebf07a93 KT-14386 Smart completion: add "<parameter name> = true/false" choices
#KT-14386 Fixed
2016-11-07 18:28:23 +03:00
Valentin Kipyatkov 0399772ee6 KT-9835 Completion thinks receiver is nullable when it is not
#KT-9835 Fixed
2016-10-13 15:11:19 +03:00
Valentin Kipyatkov 7b12dd498f KT-13780 No completion and assertion error in log
#KT-13780 Fixed
2016-10-13 15:10:53 +03:00
Valentin Kipyatkov 2f5e820afb KT-8664 Hide componentX() functions for data classes from completion
#KT-8664 Fixed
2016-10-04 19:28:53 +03:00
Ilya Gorbunov c508f75de4 Test data: change fully qualified type so that it's available as type (and not an alias) in both jvm and js runtimes to have the same output. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov b741c82a66 Fix completion tests after moving collection types in JS 2016-09-24 07:08:21 +03:00