Commit Graph

22 Commits

Author SHA1 Message Date
Vyacheslav Gerasimov 952d2b6287 Remove 181 bunch files 2019-04-23 17:28:41 +03:00
Toshiaki Kameyama 0acecb4936 Minor: fix caret behaviour in arg template test
#KT-29398 Fixed
2019-03-19 16:09:07 +03:00
Toshiaki Kameyama 6acf3ad629 Add "arg" postfix template (KT-29398)
#KT-29398 Fixed
2019-03-14 15:35:44 +03:00
Toshiaki Kameyama f1dc09f839 Add postfix template for the spread operator #KT-26249 Fixed 2018-08-22 10:56:39 +03:00
Denis Zharkov b38a9ee386 Fix test data for postfix templates test
In this tests there are two variants:
- One extracts the lambda
- And another extracts the whole call

For some reason, the order of completion variants has been changed in 182
2018-08-10 18:40:44 +07:00
Denis Zharkov 0d00eb7de3 Add postfix template for listOf/setOf/etc
#KT-25239 Fixed
2018-07-06 10:06:56 +03:00
Dmitry Jemerov b1f84676d1 Update tests according to new formatter behavior 2017-06-14 11:40:41 +02:00
Denis Zharkov dcc98e3839 Improve check for statements-only postfix templates
Before this change the check was quite complicated
because of cases like:
for (i in 1..9)
    foo(i)<caret>

It's not located in a block, but in the same time it's a stament.
So we had a tricky heuristics that if is parent is not a block, then
we should check if element isn't used as expression.

Of course this heuristics is wrong, e.g. for import/package nodes.

The solution is to reuse similar logic from BasicExpressionTypingVisitor.
it has been checked once that statement container is one of:
- KtBlockExpression
- KtContainerNodeForControlStructureBody
- KtWhenEntry

So there's no need to check anything else

 #KT-14986 Fixed
 #KT-14483 Fixed
2017-03-15 10:47:12 +03:00
Denis Zharkov bd88919411 Refine predicate for 'iter' postfix template
Use IterableTypesDetection to determine if the given expression may be iterated

 #KT-14134 Fixed
 #KT-14129 Fixed
2017-03-15 10:47:12 +03:00
Denis Zharkov 0120085443 Refine expression kind definition in postfix templates
- Do not treat if without else as values
- Some statements aren't contained in block (see tests)

 #KT-14107 Fixed
 #KT-14110 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov 3c24996073 Refine default postfix templates selector
There is new settings checkCanBeUsedAsValue
Also expression filtering are split into to parts:
- getNonFilteredExpressions is trivially goes until it reaches
first block body of some declarations
- all additional filtering is merged into Condition that is passed into
PostfixTemplateExpressionSelectorBase super-call

Notable changes for users:
- do not suggest try for non-top-level expressions
- do not suggest var/par/etc for loops
2016-10-03 10:36:48 +03:00
Denis Zharkov ba2d2a036e Suggest postfix templates on lambda expressions 2016-10-03 10:36:48 +03:00
Denis Zharkov 54d9b4bee6 Do not suggest assignment as a subject in postfix templates
#KT-14077 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov 18146fafdf Allow if/when/try postfix templates in expression position
#KT-14078 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov bff9dd4ef5 Suggest assert/return postfix templates only for statements
#KT-14079 Fixed
 #KT-14090 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov ce128c5d6e Do not suggest operation references in postfix templates
#KT-14087 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov 23c0bdbd05 Add filtering of suggested expressions for postfix templates
Do not suggest qualified expression's selector or a part of user type
because they aren't really independent expressions
2016-09-22 18:11:22 +03:00
Denis Zharkov 189705727f Implement a bunch of string based postfix templates
#KT-4710 Fixed
2016-09-20 15:26:48 +03:00
Denis Zharkov 1b391123e6 Implement for/iter postfix templates
#KT-4710 In Progress
2016-09-20 15:26:47 +03:00
Denis Zharkov b702886f0d Introduce var/val postfix templates
#KT-4710 In Progress
2016-09-20 15:26:45 +03:00
Denis Zharkov 4d28199cc2 Implement if/else/null/notnull/when/try postfix templates
#KT-4710 In Progress
2016-09-20 15:26:42 +03:00
Denis Zharkov f18b9cceb3 Implement 'not' postfix template
#KT-4710 In Progress
2016-09-20 15:26:39 +03:00