Commit Graph

21429 Commits

Author SHA1 Message Date
Dmitry Savvinov 958a7d9315 Refactor MPP versioning
- Use 'null' as indicator of non-MPP version. Consequently, remove
useless 'isMpp' method, and lift all methods to extensions (to be able
to call them on nullable 'facetSettings.mppVersion')

- Change semantics of extensions to check for exact equality rather than
for "at least specified version"

- Deprecate old MPP-versioning in favour of 'facetSettings.mppVersion'
2019-10-02 16:52:39 +03:00
Dmitry Savvinov dbd352e2ba Minor: simplify condition in KotlinFacetSettings 2019-10-02 16:52:39 +03:00
Nikolay Krasko 343502125b Rename ResolveInWriteActionManager -> ResolveInDispatchThreadManager 2019-10-02 15:58:44 +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
Natalia Selezneva bd6481b9e8 Add support for settings.gradle.kts configuring kotlin in project (KT-34114)
^KT-34114 Fixed
2019-10-02 10:30:42 +03:00
Natalia Selezneva fac49df177 Invoke in CompilerSettingsListeners in invokeLater
script templates that are loaded from compiler settings are subscribed on this topic.
When ScriptTemplatesFromCompilerSettingsProvider invokes KotlinCompilerSettings.getInstance, deadlock may happen if those settings aren't initialized yet.

^KT-25373
2019-10-02 10:25:18 +03:00
Dmitriy Dolovov df6dcd646f Fix ClassCastException in KLIB reader 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov 5985c0c02b KLIB API constants clean-up 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov 781c73335d Use cache everywhere where K/N KLIBs are read in IDE 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov 185b10fa06 Rename module capability: "KotlinLibrary" -> "KotlinNativeLibrary" 2019-10-01 17:38:57 +03:00
Alexander Gorshenev c227c13799 Commonizing klib metadata between native and js 2019-10-01 17:38:57 +03:00
Vyacheslav Gerasimov f38123e78c 193: Update to 193.3793.14-EAP-SNAPSHOT 2019-10-01 17:23:47 +03:00
Igor Yakovlev a68090db5a Fix 191 branch build 2019-10-01 16:27:16 +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
Igor Yakovlev de5fb347e7 Fix SyntheticPropertyUsages tests
testJavaGetterToOrdinaryMethod_JavaGetterToOrdinaryMethod
testSyntheticPropertyUsages1_RenameGetMethod

from 192 disabled to call findReferences(elem), so overload does not worked
2019-10-01 13:53:21 +03:00
Vladimir Dolzhenko 3b563eaca1 Use test path relative to testDataPath in fixture.configureByFile to be complaint with 193, part 2 2019-10-01 11:39:17 +02:00
Andrey Uskov d7a2de59ac Import: support mixing of TaskProviders and Tasks in task executors
#KT-34101 Fixed
2019-10-01 08:30:12 +03:00
Andrey Uskov 6d9be0ab5d Fix MPP import tests 2019-10-01 08:30:09 +03:00
Andrey Uskov c0f2be478f Fix calculation of target platform for common test modules for NMPP
#KT-34070 Fixed
2019-10-01 08:30:07 +03:00
Anton Yalyshev 9af6efcb24 Return old-style DSL for Gradle versions < 5.0 2019-10-01 07:18:00 +02: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
Denis Zharkov 67410f7a57 Parametrize behavior of DescriptorEquivalenceForOverrides::areCallableDescriptorsEquivalent
The changes introduced 471134d31e are only needed
for the case of HMPP project while for other cases it might break the behavior
a bit like in KT-34027

See org.jetbrains.kotlin.resolve.calls.results.OverloadingConflictResolver#filterOutEquivalentCalls

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 straightforward fixing of this exact call-site (using original descriptors)
doesn't help: behavior might change in a very subtle way (see org.jetbrains.kotlin.spec.checkers.DiagnosticsTestSpecGenerated.NotLinked.Dfa.Pos#test72)

So, the main idea is changing the contract for areCallableDescriptorsEquivalent
only when project is HMPP one.

^KT-34027 In Progress
2019-09-30 20:09:42 +03:00
Sergey Rostov 4c579f5286 build.gradle.kts: collect statistics about auto reload, fix 183 as as34 2019-09-30 14:08:43 +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 2ec231f381 Minor: fix CompletionMultiFileHandlerTest test 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
Natalia Selezneva 66a6713577 Tests: extract scripts testdata for light classes in ide to separate test
For compiled scripts there is AbstractIdeCompiledLightClassTest
For now there is a difference in light classes constructed from source and from compiled class (missing baseClass and constructor parameter for script class)
But it doesn't affect users because calling script class from Java isn't supported yet

testData for AbstractIdeLightClassTest and AbstractIdeLightClassForScriptTest can be merged when the difference will be fixed
2019-09-30 09:47:20 +03:00
Sergey Rostov 46f8feaf98 build.gradle.kts: collect statistics about auto reload 2019-09-30 09:44:52 +03:00
Nikolay Krasko 1804619076 Fix AmbiguousCalls test in 192 2019-09-30 00:53:03 +03:00
Nikolay Krasko 7e691a0864 Store project to avoid creating psi factory from invalid element
Fix ConvertLineCommentToBlockCommentIntention tests
2019-09-30 00:53:03 +03:00
Nikolay Krasko 319cabcc88 Remove deprecated InjectorUtils#putInjectedFileUserData in injection (KT-33775)
#KT-33775 Fixed
2019-09-30 00:53:03 +03:00
Ilya Kirillov f70654d16b Fix CreateTypeParameter quick fix tests
Partially reset 21429f0b94
2019-09-29 20:43:19 +03:00
Ilya Kirillov 41fd9fff76 Minor: reformat CreateTypeParameterUnmatchedTypeArgumentActionFactory 2019-09-29 12:27:44 +03:00
Ilya Kirillov 21429f0b94 Do not try to add type parameter to non-writable declaration (EA-209570) 2019-09-29 12:27:43 +03:00
Ilya Kirillov a24da280ca Call update for ScratchAction in EDT thread (EA-210180) 2019-09-29 12:27:43 +03:00
Ilya Kirillov 7831237aaa Minor: reformat KotlinRunConfigurationProducer 2019-09-29 12:27:43 +03:00
Ilya Kirillov 016132c762 Fix NPE in KotlinRunConfiguration & do not throw exception on unknown container type (EA-209426) 2019-09-29 12:27:43 +03:00
Ilya Kirillov c000f33955 New J2K: make initial generating code formatting better 2019-09-29 11:39:36 +03:00
Vladimir Dolzhenko 3e2dac6586 Use test path relative to testDataPath in fixture.configureByFile to be complaint with 193 2019-09-29 09:45:42 +02:00
Vladimir Dolzhenko 7c80c6ba63 Fix performanceTests for 193 2019-09-29 09:38:27 +02:00
Anton Yalyshev 6fa7da57a4 It's better to get plugin version once but not in cycle 2019-09-27 20:06:53 +03:00
Anton Yalyshev db189fa218 Remove Maven and JPS targets collectors that are unused now 2019-09-27 20:06:53 +03:00
Anton Yalyshev d4266e1be6 Bunches for ProjectConfigurationCollector 2019-09-27 20:06:53 +03:00
Anton Yalyshev 21b7d873e7 Move build system and targets statistics collection from StartupActivity to FUS State Collector 2019-09-27 20:06:53 +03:00