Commit Graph

53 Commits

Author SHA1 Message Date
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
Mikhail Zarechenskiy c03dfd1522 [IDE-NI-MIGRATE] Migrate completion tests for new inference 2019-05-06 13:59:26 +03:00
Nikolay Krasko c968a362f6 Fix test data after file rename 2019-01-06 01:08:25 +03:00
Toshiaki Kameyama 827e04ae3e Keyword completion: add "class/interface/object + filename" completion for top level (KT-28394)
#KT-28394 Fixed
2019-01-05 19:06:22 +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
Pavel V. Talanov 0c1d25d5ac Completion: when Unit is expected do not prioritize by return type
Decide on completion order by other factors
Previously would prefer callable that return Unit if Unit is the expected type
    leading to strange completion order

 #KT-25588 Fixed
2018-08-16 13:59:38 +02:00
Pavel V. Talanov b51c021f56 Dsl completion: assign high priority for dsl elements that are members 2018-08-16 13:59:37 +02:00
Denis Zharkov 9f3a902ff3 Take into account refined applicability of dsl-marker in IDE
After the previous change, when being applied to a function type
with receiver it's assumed to work just as it's applied to receiver type

Thus, it's necessary to fix relevant IDE features relied on DSL markers

 #KT-23255 Fixed
2018-08-14 15:58:18 +07:00
Pavel V. Talanov a6aea5625a Dsl completion: fix completion when multiple receivers are in scope 2018-02-28 19:48:45 +01:00
Pavel V. Talanov 92070d132e Completion: do not force dsl members to the top if some type is expected 2018-02-21 14:44:14 +01:00
Pavel V. Talanov 1796d40118 Completion: assign highest priority to dsl members in dsl context
Use the same style as for dsl for lookup items that belong to dsl
2018-02-21 14:44:13 +01:00
Simon Ogorodnik 439e158fb2 Fix failing test after migration to IDEA 171
BasicCompletionWeigherTestGenerated$ExpectedInfo.testPreferMatchingThis
Looks like IDEA now rearranges elements with same weight by length and
then alphabetically
2017-03-21 16:47:16 +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
Valentin Kipyatkov 3fb64f4fa6 Fixed completion list sorting so that "shouldCompleteTopLevelCallablesFromIndex" not be first when typing "st" 2016-11-07 18:28:24 +03:00
Valentin Kipyatkov 47d624ac66 Better test 2016-09-07 18:10:13 +03:00
Valentin Kipyatkov 835c60f2a5 More correct completion list sorting by receivers 2016-09-07 18:10:12 +03:00
Valentin Kipyatkov a60d9d546d KT-12798 DSL-friendly completion
#KT-12798 Fixed
2016-09-07 18:10:12 +03:00
Ilya Gorbunov e34bc30bd7 Exclude alias imported names from all-under imported packages when determining whether a type has been imported for completion.
#KT-13447 Fixed
2016-08-17 12:40:50 +03:00
Valentin Kipyatkov e04c6d1f5c KT-12299 Completion: incorrect priority of property foo over method getFoo in Kotlin-only code
#KT-12299 Fixed
2016-05-14 12:19:42 +03:00
Valentin Kipyatkov dd16eb14e5 KT-12080 Move parameter names higher up in code completion
#KT-12080 Fixed
2016-05-12 22:22:46 +03:00
Valentin Kipyatkov 16c38a2415 KT-12138 Do not show "::error" in smart completion when any function type accepting one argument is expected
(actually made them lowest priority)

 #KT-12138 Fixed
2016-05-04 17:28:30 +03:00
Ilya Gorbunov 4dde59368c Fix tests not to duplicate array constructor definitions as they are available now in builtins. 2015-12-14 04:29:18 +03:00
Valentin Kipyatkov 7198b897ab Ordering of static members in completion 2015-11-09 15:37:45 +03:00
Valentin Kipyatkov 99b35257c6 Preference of right member after "super." and not only 2015-11-05 17:47:55 +03:00
Valentin Kipyatkov 7e2b37bb0f KT-9813 Parameter name&type completion gets in the way of typing
#KT-9813 Fixed
2015-10-30 17:43:26 +03:00
Valentin Kipyatkov f90ff31507 Adapting code completion to no annotations without "@" 2015-10-15 19:20:09 +03:00
Valentin Kipyatkov 9b4070b881 Changed lookup strings and prefix matchers for parameter name&type completion to get more stable and correct ordering 2015-10-09 16:42:06 +03:00
Stanislav Erokhin 8efbf4fc32 Fixed testdata -- removed package import 2015-09-18 21:00:20 +03:00
Denis Zharkov 31244edec9 Deprecate deprecated in favor of Deprecated 2015-09-04 18:19:31 +03:00
Valentin Kipyatkov 9df3bb8a06 More correct sorting of parameter name&type suggestions in completion 2015-08-28 16:22:47 +03:00
Valentin Kipyatkov 6c46e3ec02 Better test 2015-08-25 18:56:18 +03:00
Valentin Kipyatkov fd34ff3239 Implemented own version of LookupElementProximityWeigher (the standard one checks getObject() instanceof PsiElement)
#KT-8842 Fixed
2015-08-25 18:56:18 +03:00
Valentin Kipyatkov 0f332bd8b9 Refactored sorting in completion
Also changed semantics of DeclarationDescriptor.importableFqName - it now returns null when descriptor cannot be referenced by import + dropped DeclarationDescriptor.importableFqNameSafe
2015-08-25 18:56:16 +03:00
Valentin Kipyatkov 68c0c83879 Better sorting: current package is preferred 2015-08-25 18:56:16 +03:00
Valentin Kipyatkov 275299f5e2 Merged 2 tests 2015-08-18 18:50:00 +03:00
Valentin Kipyatkov 000d2f0cd1 Lower priority for extensions on own type parameters 2015-08-14 17:38:38 +03:00
Valentin Kipyatkov df32dcac39 Added smart priorities for true, false and null into basic completion 2015-08-10 17:49:36 +03:00
Valentin Kipyatkov cd6d8ffa98 Basic completion prefers right type in lambda value 2015-08-10 17:49:36 +03:00
Valentin Kipyatkov e6f5cefce3 Basic completion shows items from smart completion after "as" + do not insert any tail in basic completion 2015-08-10 17:49:35 +03:00
Valentin Kipyatkov be0a0e4401 Items filtered out from smart completion take lower priority in ordinary one + lower priority for Enum.valueOf 2015-08-10 17:49:35 +03:00
Valentin Kipyatkov af2b6588c0 Ordinary completion includes some items from smart completion + changed priority for multi-args item in smart completion
#KT-8580 Fixed
2015-08-10 17:49:34 +03:00
Valentin Kipyatkov 22e79d89f4 Completion sorts items by name similarity in intializer of variable with no explicit type 2015-08-10 17:49:33 +03:00
Valentin Kipyatkov 9cba912fe5 Ordinary completion prefers item matching expected name 2015-08-10 17:49:33 +03:00
Valentin Kipyatkov 07311234db "this" with matching type are preferred in ordinary completion 2015-08-10 17:49:33 +03:00
Valentin Kipyatkov 44d277af87 Completion prefers items matching expected type(s) 2015-08-10 17:49:33 +03:00
Valentin Kipyatkov e05c20b5c0 Completion: fixed ordering for packages + exclude for package items supported too 2015-07-21 16:00:10 +03:00
Valentin Kipyatkov ecbc7ba5b6 Parameter name completion allows user prefix part in the name + more strict prefix matcher used 2015-06-25 21:57:14 +02:00
Valentin Kipyatkov 8520235934 Fixed deprecated ordering and quick doc for java and compiled classes in completion 2015-06-25 21:57:14 +02:00
Valentin Kipyatkov 84ba634c3e Parameter names from current file get higher priority + number of occurrences matters 2015-06-25 21:57:13 +02:00
Valentin Kipyatkov c0126b08c3 Parameter name completion: added more tests for ordering 2015-06-25 21:57:12 +02:00