Commit Graph

62 Commits

Author SHA1 Message Date
Toshiaki Kameyama 4d2caa8e76 KT-33211 Quickfix "add parameter" for method references should infer functional type instead of KFunction (#2664)
* "Add parameter to function" quick fix: add function type instead of KFunction for method references

#KT-33211 Fixed

* Support suspend function references
2020-06-11 17:01:07 +03:00
Toshiaki Kameyama 19d1532dc7 AddFunctionParametersFix: use argument name as parameter name if argument is referenced variable
#KT-14021 Fixed
2020-05-27 02:38:41 +09:00
Dmitry Gridin 2b8bb30744 Change signature: fix formatting for long qualifier names
#KT-12878 Fixed
2020-04-28 11:58:16 +00:00
Toshiaki Kameyama f487118be5 Change signature: fix it works correctly when call site function has no value argument list
#KT-23510 Fixed
2020-02-22 09:07:34 +01:00
Dmitry Gridin 6c439ae85a Create TrailingCommaIntention
#KT-34744
2020-02-04 21:34:53 +07:00
Toshiaki Kameyama f1c605d0f7 AddFunctionParametersFix: improve parameter name for 'it' argument
#KT-33297 Fixed
2019-12-17 11:10:15 +03: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
Dmitry Gridin 22a73bc09d ChangeFunctionSignatureFix: fix wrong result
#KT-32001 Fixed
2019-06-19 18:52:53 +07:00
Dmitry Gridin 21c10af1a7 Fix tests in quickfix 2019-05-31 18:00:56 +07:00
Mikhail Zarechenskiy d4d1648e1d [IDE-NI-MIGRATE] Migrate QuickFix tests for new inference 2019-05-06 13:59:24 +03:00
Toshiaki Kameyama 804e03379d Remove unused function parameter: do not propose for property setter parameter
#KT-29606 Fixed
2019-01-31 18:56:59 +03:00
Toshiaki Kameyama 7cad0052d9 "Add parameter to constructor": fix for enum entry
#KT-28995 Fixed
#KT-29051 Fixed
#KT-29052 Fixed
2019-01-24 11:00:59 +03:00
Toshiaki Kameyama 455db32199 "Remove parameter" quick fix: remove also type constraint
#KT-26673 Fixed
2018-11-07 12:20:35 +03:00
Toshiaki Kameyama 20535feb31 "Remove parameter" quick fix: Remove unused type parameter used as type projection #KT-23511 2018-09-04 18:29:13 +03:00
Mikhail Zarechenskiy dc7678a700 Use smartcast info that related to call in change signature quick fix
There is an inconsistency on how we record smartcasts in old and new
 inference, but we definitely should use all possible information about
 smartcasts in quick-fixes

 #KT-25144 Fixed
2018-06-28 13:14:18 +03:00
Alexey Sedunov 35517a8253 Quick Fixes: Fix adding parameter to Java constructor
#KT-24574 In Progress
2018-05-25 23:03:26 +03:00
Toshiaki Kameyama 1d0a11cecd "Remove parameter" quick fix makes generic function call incompilable when type could be inferred from removed parameter only
#KT-23511 Fixed
2018-05-22 17:33:26 +03:00
Alexey Sedunov a92a4a2a6d Add Parameter Fix: Support smart casts
#KT-24207 Fixed
2018-05-11 16:05:19 +03:00
Mikhail Glukhikh ee3f89df87 Remove unused function parameter: delete empty constructor accurately
So #KT-22221 Fixed
Fixes also some quick-fix tests
2018-01-19 16:16:15 +03:00
Alexey Sedunov 354a6cbfd9 Change Signature: Keep parameter 'val'/'var' when invoked from Java
#KT-20901 Fixed
 #KT-21159 Fixed
2017-11-30 12:49:24 +03:00
Toshiaki Kameyama c5b7d0f0df Remove parentheses after deleting the last unused constructor parameter
So #KT-16636 Fixed
2017-10-10 11:55:27 +03:00
Alexey Sedunov 6060a39494 Change Signature: Use correct index in getOriginalParameter()
#KT-18642 Fixed
 #KT-18606 Fixed
2017-06-29 17:42:09 +03:00
Dmitry Petrov c83b764c73 Update testData after changes in diagnostics 2017-05-26 13:58:46 +03:00
Valentin Kipyatkov 1fe6886a33 Fixed error message to quote parameter name 2017-05-20 23:44:20 +03:00
Ilya Gorbunov 570ac8b821 Add runtime dependency to tests where exception references are used. 2016-08-17 12:40:50 +03:00
Pavel V. Talanov a4c005fefd Update existing test data depending on diagnostic parameter rendering 2016-02-26 14:45:11 +03:00
Alexey Sedunov d587bb2ea6 Change Signature: Support Change Signature quick-fix for Java -> Kotlin case
#KT-9401 Fixed
2016-02-17 11:31:40 +03:00
Alexey Sedunov fd79145b73 Change Signature: Represent parameter/receiver types using KotlinTypeInfo 2015-12-18 15:05:36 +03:00
Dmitry Jemerov e97e82d119 use terms "lambda expression" and "anonymous function" instead of "function literal" and "function expression" 2015-12-09 13:55:40 +01:00
Alexey Sedunov 6ff955b66c Change Signature: Implement improved call processing algorithm
#KT-8953 Fixed
 #KT-9525 Fixed
2015-11-10 16:47:48 +03:00
Valentin Kipyatkov f311d9febf Refactored change signature fixes to not hold DeclarationDescriptor's 2015-10-16 19:06:31 +03:00
Dmitry Petrov 5d9ee7efee Java 8 rules for method overrides:
- base class method wins against a (default) interface method,
so an abstract base class method should always be implemented
in a derived class;

- interface methods clash regardless of abstract/default
with possibly undefined behavior at run-time,
so a class or interface should always define its own method
for methods inherited from multiple interfaces and not from base class;

- meaningful diagnostics for class inheriting conflicting JVM signatures.
Since no override will happen under Java 8 rules,
ACCIDENTAL_OVERRIDE is misleading for this case;

- update testData.
2015-10-12 14:12:31 +03:00
Mikhail Glukhikh 82c0265cb3 Quick fix for implicit nothing with a test 2015-10-12 13:30:22 +03:00
Yan Zhulanow 6db9344659 Fix compiler tests 2015-09-25 19:20:20 +03:00
Denis Zharkov 1d90b2e1fe Get rid of obsolete syntax in quickfixes changing lambda's signature
- Do not wrap parameters with '()'
- Do not set return type for them
- Fix existing testData
2015-09-25 08:29:26 +03:00
Michael Nedzelsky 92ca057b4a fix tests in org.jetbrains.kotlin.idea.quickfix 2015-09-08 02:05:41 +03:00
Denis Zharkov f0833d626a Fix intentions tests after types enhancement
Types became more accurate
2015-07-09 16:36:44 +03:00
Alexey Sedunov 5319e9e761 Change Signature: Support configurable Change Signature for Java code
#KT-5923 Fixed
2015-07-03 18:38:06 +03:00
Alexey Sedunov 9e82411e78 Change Signature: Do not process calls with unmatched arguments/parameters 2015-07-03 18:38:05 +03:00
Pavel V. Talanov 07d35d305e Create import list psi element even if no directives are present
Fix a problem where deleting last import directive via "optimize imports" could lead to incorrect psi structure resulting in CCE, see EA-64291
New imports are inserted at the head (after package directive if present) of the file (before any comments) if no imports were present
Add test for inserting import to file where a first statement is a comment
Drop code dealing with non-existing import list in ImportInsertHelperImpl
AbstractQuickFixTest: check for unexpected actions before changes to the file are made as it relies on the first line having specific format
2015-06-08 20:51:04 +03:00
Valentin Kipyatkov 0dc92c3ee8 QuickFixMultiFileTestGenerated - shorter test data files names 2015-05-27 16:15:44 +03:00
Dmitry Jemerov 625096466e IDE testdata: s/trait/interface 2015-05-13 16:13:13 +02:00
Valentin Kipyatkov 837e46a9b8 Big change in quickfix tests: no stupid test data format with "before" and "after" file prefixes 2015-05-08 22:29:42 +03:00
Pavel V. Talanov 3329136c9c Fix test data for quickfix tests
Depending on Module and ModuleBuilder from runtime
2015-04-16 16:40:44 +03:00
Alexey Sedunov 0eda6c88b9 Quick-Fixes: Fix signature configuration for extension functions
#KT-7019 Fixed
2015-03-24 16:41:07 +03:00
Evgeny Gerashchenko 7b6f83815c Unified obtaining psi element for descriptor. Now code for finding effective descriptors of fake override and finding source element for original declarations are separated. Old method DescriptorToSourceUtils.descriptorToDeclaration is still there, because it has ~90 usages. 2015-03-05 15:19:29 +03:00
Alexey Sedunov a21163b8c4 Change Signature: Add test for KT-4013 "'Change signature' does not add necessary imports"
#KT-4013 Fixed
2015-02-20 19:08:19 +03:00
Valentin Kipyatkov 5d516a5f72 No need to shorten non-affected references in quickfixes 2015-02-09 12:56:00 +03:00
Alexander Udalov 0b64f028b6 Rename jet -> kotlin in idea: quickfixes
org.jetbrains.jet.plugin.quickfix -> org.jetbrains.kotlin.idea.quickfix
2015-01-13 01:14:36 +03:00
Alexey Sedunov 346d9ea0c5 Quick Fixes: Add test for KT-5922 (QuickFix to change lambda signature doesn't work with SAM conversion) 2014-12-11 17:50:31 +03:00