Commit Graph

1341 Commits

Author SHA1 Message Date
Toshiaki Kameyama f6059c3eb5 "Change to var": remove const modifier
#KT-35022 Fixed
2019-11-23 01:17:38 +09:00
victor.petukhov cf161f8234 Rework notForIncompletionCall test 2019-11-17 15:19:28 +03:00
igoriakovlev cb11282183 Merge pull request #2516 from t-kameyama/KT-18539
KT-18539 Default implement fun/property text shouldn't contain scary comment
2019-11-13 19:33:44 +03:00
Pavel Kirpichenkov 9a231bbbfa Update trailing lambda quickfix, add tests
Case of incorrect call expression as the receiver of dot-qualified expression
was not handled properly.

Now the following order is used:
- If parent is a call expression or if this call is a receiver of parent
dot-qualified expression, parent must get last lambda as a new receiver;
- Otherwise, if parent is a dot-qualified expression, this call is in selector position.
Then grandparent is checked for being call or dot-qualified expression. If so, trailing
lambda must become grandparent's new receiver. If not, trailing nodes become standalone
epressions after parent.
- Otherwise, incorrect call expression is a standalone expression, so trailing nodes
may be lifted and put after it.
2019-11-13 11:00:01 +03:00
Pavel Kirpichenkov f1934fa49d Amend "Terminate preceding call with semicolon" quickfix
Quickfix wasn't aware of cases, when expression to be fixed
 is a part of parent call expression or dot-qualified expression.
 Incorrect position for extracting trailing lambdas led to broken
 formatting.

 #KT-34694 Fixed
2019-11-13 11:00:01 +03:00
Toshiaki Kameyama 4d9b19da82 Remove comments from function/property implementation template
#KT-18539 Fixed
2019-11-13 08:37:25 +09:00
victor.petukhov 62d204f4d6 Support trailing comma
^KT-34743 Fixed
2019-11-01 19:40:20 +03:00
Toshiaki Kameyama 68ea677cc4 Import quick fix: support extension iterator function
#KT-34303 Fixed
2019-10-29 18:35:14 +07:00
Dmitry Gridin 5d16753285 ImportFix: add support for WRONG_NUMBER_OF_TYPE_ARGUMENTS
#KT-23834 Fixed
2019-10-29 17:25:17 +07:00
Toshiaki Kameyama 60f4ed914a "Add parameter to function" quick fix: apply for TYPE_MISMATCH error
#KT-8478 Fixed
2019-10-22 21:22:33 +07:00
Toshiaki Kameyama e8effe6727 Replace with safe call: do not add redundant elvis operator
#KT-34432 Fixed
2019-10-21 23:28:19 +07:00
Toshiaki Kameyama 27eea882fb ChangeVisibilityFix: remove redundant property setter
#KT-33796 Fixed
2019-10-21 15:55:04 +07:00
Toshiaki Kameyama 48968c0fe2 Replace deprecated symbol usage: do not include 'Companion' in import directives when importing companion object
#KT-34078 Fixed
2019-10-21 15:55:04 +07:00
Toshiaki Kameyama d72e55d1b7 Add "Make private and overrides member" quick fix for ACCIDENTAL_OVERRIDE
#KT-18536 Fixed
2019-10-17 17:08:03 +07:00
Yan Zhulanow d153aa87a8 Fix EA-126019: Handle 'null' PsiType as nullable Any in "Create" actions 2019-10-08 19:13:56 +09:00
Pavel Kirpichenkov b7e5d9faae Update annotation rendering in diagnostics
Disable annotation rendering in default type and descriptor renderers.
Preserve annotations in Android and Serialization plugins.
Update error texts in ide tests.
Nullability annotations in Java descriptors are rendered with context-dependent renderer.

#KT-20258 Fixed
2019-10-04 11:18:45 +03:00
Dmitry Gridin 1b7b546249 Tests: fix some tests in quickfix 2019-10-03 15:23:05 +07:00
Toshiaki Kameyama d86e87d35e Add quickfix to change object to class
#KT-33586 Fixed
2019-10-02 19:42:30 +07:00
Toshiaki Kameyama ac7e955d3e Change parameter type quick fix: don't use qualified name
#KT-32012 Fixed
2019-10-02 18:41:54 +07:00
Roman Golyshev c463fad3b7 KT-34000: Allow autoimport to suggest fixes in qualified expressions
- it is required to be able to autoimport extensions from objects,
not only from the top level
- use `substituteExtensionIfCallable` to handle generics for extension methods
- move finding expression receivers to the separate method, add `Receivers` value class to hold found receivers
- change `CallableDescriptor.isValidByReceiversFor` to return false
if explicit receiver is not required for the descriptor
- ^KT-34000 Fixed
2019-10-02 13:46:47 +03:00
Toshiaki Kameyama b2d2165342 Add "Remove redundant label" quick fix for REDUNDANT_LABEL_WARNING
#KT-26431 Fixed
2019-10-02 16:40:13 +07:00
Pavel Kirpichenkov 6c8e829f19 Update diagnostics for trailing lambdas, add quickfix
Alternative message for errors, caused by unexpected lambda expression arguments on a new line.
Both diagnostic are reported, if multiple lambda expressions were passed to the call.
For other errors trailing lambda diagnostic overrides the original one.

Quickfix for erroneous trailing lambdas on a new line after call.
Fix separates lambda expression from previous call with semicolon.
All trailing lambda arguments become standalone lambda expressions.
2019-09-25 15:38:17 +03:00
Toshiaki Kameyama 7fcca71b4b Replace with dot call quickfix: don't break formatting
#KT-25697 Fixed
2019-09-25 12:06:51 +07:00
Toshiaki Kameyama 44edd94fea "Create member function" quick fix: do not add redundant semicolons after enum entry
#KT-14899 Fixed
2019-09-24 19:40:31 +07:00
Toshiaki Kameyama 0497f0cba4 "Create enum constant" quick fix: add before semicolon
#KT-33718 Fixed
2019-09-24 19:31:52 +07:00
Toshiaki Kameyama 30c41e6720 "Create type parameter from usage": don't suggest for not extension property
#KT-33300 Fixed
2019-09-24 19:28:40 +07:00
Toshiaki Kameyama 5b666ff33f "Create type parameter from usage": don't remove backticks if necessary
#KT-33299 Fixed
2019-09-24 19:24:02 +07:00
Dmitry Gridin 1ee827bfc8 Import quick fix: support provideDelegate
#KT-28049 Fixed
2019-09-24 16:27:10 +07:00
Toshiaki Kameyama 79199260b9 Import quick fix: suggest for operator extension function called from name reference
#KT-28049 Fixed
2019-09-24 16:27:09 +07:00
Toshiaki Kameyama d9d04fc556 "Create enum constant" quick fix: do not add redundant empty line
#KT-32981 Fixed
2019-09-24 13:23:06 +07:00
Nikolay Krasko ee4ab967a4 Force resolve check for dispatch thread instead of isWriteAccessAllowed
isWriteAccessAllowed = dispatch thread + write lock
2019-09-23 16:54:35 +03:00
Pavel Kirpichenkov 55cb9561c2 Provide better error messages for read-only delegate
Split error reporting into two parts for incorrect and missing candidates.
Missing function error is not reported on provideDelegate.
Update error factory and default message for error.
Update error texts in quick fix test data.

#KT-16526 Fixed
2019-09-12 14:58:21 +03:00
Dmitry Gridin c4a1101600 KtSimpleNameReference: add root prefix support to bindToFqName function 2019-09-05 18:01:23 +07:00
Igor Yakovlev 7b2f39530a Fix invalid testdata for ConvertToScopeIntention applicability 2019-08-28 16:31:49 +03:00
Igor Yakovlev 1e72116a9c Fix test data for intention tests
The ExtractDeclarationFromCurrentFileIntention applicability range was changed by commit 3b35c2d24 so the test data of several test comes invalid
2019-08-28 13:07:33 +03:00
Dereck Bridie 8f2a73b734 KT-28471: "Add initializer" quickfix initializes non-null variable with null 2019-08-23 14:15:08 +07:00
Dmitry Gridin cf3b92d80e CreateTypeParameterFromUsageFix: fix KNPE for type alias
#KT-33302 Fixed
#EA-120181 Fixed
2019-08-20 17:04:00 +07:00
Toshiaki Kameyama 3742993dea Change to star projection: do not suggest when type paramer is generic type
#KT-30794 Fixed
2019-07-31 20:51:57 +03:00
Dmitry Gridin c76ca988eb KotlinCreateTestIntention: disallow intention for expect classes
#KT-26242 Fixed
2019-07-23 16:24:16 +03:00
Mikhail Glukhikh 5afa5de1d7 ReplaceWith: don't keep class literal & callable reference in inlining
#KT-30197 Fixed
2019-07-10 15:10:51 +03:00
Toshiaki Kameyama 64780293d3 "Redundant visibility modifier" inspection: don't report for property getter
#KT-32347 Fixed
2019-07-08 16:14:35 +03:00
Dmitry Gridin 074829bcea Import: IDE should import class from root package
#KT-21422 Fixed
2019-07-02 11:54:38 +07:00
Toshiaki Kameyama fb94cb141f Add "Add constructor parameter" quick fix for NO_VALUE_FOR_PARAMETER
#KT-27353 Fixed
2019-06-27 19:19:25 +07:00
Toshiaki Kameyama e3c9134904 Add "Convert to notNull delegate" quick fix for INAPPLICABLE_LATEINIT_MODIFIER
#KT-12515 Fixed
2019-06-26 17:07:32 +07:00
Dmitry Gridin 22a73bc09d ChangeFunctionSignatureFix: fix wrong result
#KT-32001 Fixed
2019-06-19 18:52:53 +07:00
Toshiaki Kameyama fbd992f8c7 Add intentions to convert lazy <--> ordinary property
#KT-23501 Fixed
2019-06-17 01:10:19 +03:00
Toshiaki Kameyama 0fad3fafa8 Replace deprecated symbol usage: fix message in case of generic parameter
#KT-8958 Fixed
2019-06-13 23:16:31 +03:00
Dmitry Gridin 74c177fd26 Convert FoldInitializerAndIfToElvisIntention to inspection and decrease severity to INFO
#KT-19643 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin 8b0b135112 Add new line after modifier list if last child is comment
#KT-30804 Fixed
2019-06-07 12:23:06 +07:00
Dmitry Gridin 21c10af1a7 Fix tests in quickfix 2019-05-31 18:00:56 +07:00