Commit Graph

7966 Commits

Author SHA1 Message Date
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 eaa07dac17 CreateExpect: shouldn't generate expect declaration from actual function with private, lateinit or const
#KT-33930 Fixed
2019-10-03 16:00:07 +07:00
Dmitry Gridin 9da6dcf840 DescriptorRenderer: shouldn't render private modifier by default
#KT-31587 Fixed
2019-10-03 16:00:06 +07:00
Dmitry Gridin 847295bf1c CreateExpect: shouldn't generate expect declaration from actual function with default implementation from interface
#KT-32737 Fixed
2019-10-03 16:00:06 +07:00
Nikolay Krasko e9f8693a73 as34: Mute several inspection/intention tests in as34 (KT-32856) 2019-10-03 11:56:01 +03:00
Dmitry Gridin 1b7b546249 Tests: fix some tests in quickfix 2019-10-03 15:23:05 +07:00
Dmitry Savvinov 3989f351ff Use modules instead of files for MPP diagnostic
Using files turned to be a bad idea, because people often
use the same name for files with expects and with corresponding actuals.

This commits disambiguiates ambiguous message for
AMBIGUOUS_ACTUALS/AMBGIUOUS_EXPECTS diagnostics by using modules instead
of files

^KT-32582 Fixed
2019-10-02 16:52:40 +03:00
Toshiaki Kameyama d86e87d35e Add quickfix to change object to class
#KT-33586 Fixed
2019-10-02 19:42:30 +07:00
Toshiaki Kameyama 6a329210cb Convert to anonymous object: fix wrong replacement when SAM is nested interface
#KT-33660 Fixed
2019-10-02 19:09:55 +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
Denis Zharkov 18df5d9db0 Support mixed positioned/named arguments in AddNameToArgumentIntention
^KT-7745 Fixed
2019-10-02 11:13:15 +03:00
Igor Yakovlev a19c5f944e Mute tests with new tickets to resolve it later
Muted test with next tickets:
https://youtrack.jetbrains.com/issue/KT-34105
https://youtrack.jetbrains.com/issue/KT-34106
https://youtrack.jetbrains.com/issue/KT-34107
2019-10-01 13:53:21 +03:00
Andrey Uskov 6d9be0ab5d Fix MPP import tests 2019-10-01 08:30:09 +03:00
Denis Zharkov f91db5f0b8 Restore correct overloads ambiguity accidentally removed in 1.3.60
This problem is only relevant when isTypeRefinementEnabled == true (HMPP projects)

Ambiguity accidentally was removed after 471134d
There, for areCallableDescriptorsEquivalent we stopped assuming
as impossible a situation of having identity-different descriptors
in the same containing declaraton that still might be considered equal

So, before 471134d we were comparing
"fun foo(x: String)" with "[substituted] fun foo(x: String)"
and areCallableDescriptorsEquivalent returned false for such case.
Thus, both overrides were left in the resulting set.

After 471134d, those two descriptors
becamed considered as equal thus having a possibility to remove any of them.

The problem is that "areCallableDescriptorsEquivalent" has kind of
unclear contract. Effectively it checks whether two descriptors match
to the same declaration.

But some of the usages expect that it also makes sure that descriptors
have the same substitution (see org.jetbrains.kotlin.resolve.calls.smartcasts.IdentifierInfo.Variable#equals)

So, the straight solution is using original descriptors for the cases
where we need to make sure that descriptors relates to actually different
declarations

^KT-34027 Fixed
2019-09-30 20:09:42 +03:00
Nikolay Krasko 552408e887 Minor: update test data for quick doc with deprecated annotation 2019-09-30 13:38:27 +03:00
Nikolay Krasko 751a18e64b Minor: update test data PartialBodyResolveTestGenerated 2019-09-30 13:38:26 +03:00
Natalia Selezneva 064689b6b7 Merge pull request #2467 from t-kameyama/KT-14756
KT-14756 Move statement down breaks code in argument list
2019-09-30 13:19:07 +03:00
Nikolay Krasko 1804619076 Fix AmbiguousCalls test in 192 2019-09-30 00:53:03 +03:00
Dmitriy Novozhilov 439e8faf94 [NI] Remove outdated intention test according to fixed consistency of OI and NI 2019-09-27 17:20:47 +03:00
Toshiaki Kameyama 82f75c707e "Convert to range check" inspection: apply ReplaceRangeToWithUntilInspection after convertion
#KT-33880 Fixed
2019-09-27 20:33:48 +07:00
Ilya Matveev 95cbb4e8b4 IDE: Add a flag to disable native libraries propagation 2019-09-27 18:06:58 +07:00
Ilya Matveev becdd7a5e6 Add a test for native dependency propagation 2019-09-27 18:06:57 +07:00
Dmitry Gridin 589094377e QualifiedExpressionResolver: change root prefix from _Qfadj4tPV to _root_ide_package_ 2019-09-27 17:52:11 +07:00
Alexander Podkhalyuzin 9a2da67919 ShortenReferences: cleanup code & add tests for property-function conflicts 2019-09-27 17:52:11 +07:00
Andrey Uskov ca75aeb534 Update kotlin gradle plugin version in HMPP tests 2019-09-27 12:00:08 +03:00
Andrey Uskov 715fad849d Importing test tasks and targets is implemented 2019-09-27 11:59:58 +03:00
Toshiaki Kameyama 40dd229021 Join with assignment: place the result at the assignment
#KT-21172 Fixed
2019-09-27 09:16:52 +03:00
Toshiaki Kameyama fdf9acfb6a Introduce subject to when: suggest for qualified, not for obj / constant
#KT-18772 Fixed
2019-09-27 08:26:52 +03:00
Alexander Podkhalyuzin 66bed85176 Fixed testdata for new inference 2019-09-26 16:25:50 +03:00
Dmitry Gridin 57d25fc5f5 Create actual: add type accessibility checker
#KT-28740 Fixed
2019-09-26 20:21:54 +07:00
Dmitry Gridin fcaa897b9f Tests: extract addMissingActualMembers from multiModuleQuickFix/other 2019-09-26 20:21:54 +07:00
Dmitry Gridin a552f06526 Create expect/actual: improve error hint message
#KT-33754 Fixed
2019-09-26 20:21:54 +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
Alex Chmyr b8cce67d2e KT-19355 fix for "Variable expected" error after J2K for increment/decrement of an object field 2019-09-25 10:08:42 +03:00
Toshiaki Kameyama 748e458ad7 "Override members": add semicolon between enum entry and function
#KT-31139 Fixed
2019-09-25 12:34:49 +07:00
Toshiaki Kameyama 7fcca71b4b Replace with dot call quickfix: don't break formatting
#KT-25697 Fixed
2019-09-25 12:06:51 +07:00
Mikhail Zarechenskiy 78affdd2b4 Fix old testdata: add missing operator modifier
This testdata was written when there was no "operator" modifier.

 After a83225218f rules for operators become stricter and now functions without operators are not considered as such
2019-09-25 01:52:55 +03:00
Toshiaki Kameyama 0e1e1e350f "Convert lambda to reference": do not remove required backticks
#KT-15700 Fixed
2019-09-24 19:45:53 +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
Toshiaki Kameyama 784ba69b7a "Cleanup code": remove 'final' keyword for overridden function with non-canonical modifiers order
#KT-33060 Fixed
2019-09-24 18:28:00 +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 998adfb098 Move variable declaration into when: don't report when property has 'break' or 'continue'
#KT-31999
2019-09-24 12:11:41 +03:00
Toshiaki Kameyama 877e583a96 Move variable declaration into when: don't report when property has 'return' or 'throw'
#KT-31999 Fixed
2019-09-24 12:11:41 +03: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