Commit Graph

44498 Commits

Author SHA1 Message Date
Mikhail Glukhikh fe7b7fb0bd Create actual fix: add empty brackets for classes in super-type lists
Related to KT-21082
2018-03-06 14:32:30 +03:00
Mikhail Glukhikh ef3e0b01c4 Create actual fix: use target module instead of target platform 2018-03-06 14:32:30 +03:00
Mikhail Glukhikh 90e4413fc9 Create actual: put top-level actual declarations in the same file
When multiple expect declarations are in the same file,
and some of them already have actual declarations for this platform,
then "Create actual fix" put other declarations into the same file
with existing actual declarations

So #KT-17058 Fixed
So #KT-21082 Fixed
2018-03-06 14:32:30 +03:00
Mikhail Glukhikh 3ec2dac10b Create actual fix: reformat 2018-03-06 14:32:30 +03:00
Pavel V. Talanov 27d7bb595f CliLightClassGenerationSupport: correctly find facade files
This fixes a problem where JvmPackageName annotation could force file
    facades to be in the package different to declared kotlin package
2018-03-06 12:07:12 +01:00
Pavel V. Talanov 00ee5e3d16 Refactor: extract mapping package to files to a separate component
Make it extensible
2018-03-06 12:07:08 +01:00
Pavel V. Talanov fae0f611a0 Test java resolve against kotlin file with JvmPackageName annotation 2018-03-06 12:07:07 +01:00
Pavel V. Talanov 498431311c Light classes: test "JvmPackageName" and actual declarations 2018-03-06 12:06:59 +01:00
Pavel V. Talanov d2b90b84f8 KotlinFileStubForIde: save full facadeFqName
Prefix is not necessarily same as packageFqName since JvmPackageName was introduced
2018-03-06 12:05:53 +01:00
Nikolay Krasko 9e061555af Use anchor for element to avoid working with invalid element (KT-22631)
Element in constructor can be invalidated when dumb mode begins/ends.
Working with invalid elements can produce nodes without icons and bad
presentation.

 #KT-22631 Fixed
2018-03-06 13:04:26 +03:00
Nikolay Krasko bb9933a8f9 Reformat: structureView package 2018-03-06 13:04:25 +03:00
Pavel V. Talanov 6c4537accc Create InvalidLightClassDataHolder for expect classes
This fixes an exception from duplicateJvmSignature reporter
Fixes "QuickFixTestGenerated$Override.testDontOfferToImplementMembersForExpectedClass" on teamcity
2018-03-05 18:07:38 +01:00
Pavel V. Talanov 89c82a85d0 Do not build light classes for expect classes
#KT-15482 Fixed
2018-03-05 18:07:36 +01:00
Toshiaki Kameyama 3f96e1dabc Move statement up/down fails for multiline declarations with lambdas (KT-21013)
#KT-21013 Fixed
2018-03-05 16:10:59 +03:00
Alexander Udalov f41165c566 Minor, use elvis in deprecationUtil.kt 2018-03-05 13:43:10 +01:00
Alexander Udalov e92e7c6f80 Do not report RequireKotlin-related diagnostics in snapshot compilers
Otherwise it's difficult to use a newly added API annotated with
RequireKotlin with the latest, not yet released, version.

For example, suppose there's a new function added in kotlin-stdlib,
since Kotlin 1.3, which requires 1.3 (Kotlin < 1.3 is supposed to report
an error on usages):

    @SinceKotlin("1.3")
    @RequireKotlin("1.3", COMPILER_VERSION, message = ...)
    fun foo() {}

Until Kotlin 1.3 is released, the latest available compiler in Maven has
the version 1.3-SNAPSHOT, which is _less_ than 1.3 according to Maven
rules which are used in getDeprecationByVersionRequirement. Therefore,
errors will be reported on usages of foo, and there's no Kotlin compiler
version which can be used to verify if the function works correctly,
which is inconvenient.

Since SNAPSHOT versions are effectively "pre-release" in a way, it's OK
for them to skip reporting these diagnostics
2018-03-05 13:39:13 +01:00
Alexander Udalov bbaea6a062 Refactor deprecation by version requirement
- Get rid of ApiVersion in favor of MavenComparableVersion
- Don't crash on invalid versions in RequireKotlin
- Extract to a separate function
2018-03-05 13:39:13 +01:00
Nikolay Krasko 90802f2d7c Refactoring: remove ModuleResolverProvider, inline createModuleResolverProvider 2018-03-05 15:20:53 +03:00
Nikolay Krasko de68607d5f Refactoring: move JavaResolveExtension.kt to util package 2018-03-05 15:20:53 +03:00
Svyatoslav Scherbina 7a2d761a7d Add minor improvements to psi2ir and IR utilities:
* Generate missing IR parameter declarations in external stubs
* Use origin = FAKE_OVERRIDE in external IR stubs for fake overrides
* Set .parent in external IR stubs
* Set .parent in IR generated by some utility methods
2018-03-02 15:41:48 +03:00
Dmitry Petrov 13a7270129 Generate type parameter declarations for property accessors
This requires "scoped" type parameter symbols, because in the ugly world
of descriptors property accessors have no type parameters of their own.
2018-03-02 14:35:35 +03:00
Dmitry Petrov 31996f1139 Update "defaultness" for property accessor with inherited visibility
Property accessor that overrides a non-default property accessor with
visibility different from the property visibility was incorrectly
considered "default". Corresponding metadata was written incorrectly,
and 'internal' setter call caused NSME

 #KT-23044 Fixed Target versions 1.2.40
2018-03-02 10:54:32 +03:00
Dmitry Petrov 8e8c5fae01 Minor: reformat code 2018-03-02 10:54:32 +03:00
Yan Zhulanow 6950c256ce Pill: Replace most of the hardcoded library coordinates with info from Gradle 2018-03-02 03:15:33 +03:00
Yan Zhulanow 6e65a4810e Make a project-wide embeddedComponents configuration for embedding external binaries to project artifacts 2018-03-02 03:15:32 +03:00
Yan Zhulanow 3c06dd7464 Pill, Minor: Move run configurations to the resources source set 2018-03-02 03:15:31 +03:00
Yan Zhulanow 3894afcf0b Pill, Minor: Remove the hardcoded repository, use the available utilities 2018-03-02 03:15:30 +03:00
Yan Zhulanow b24d87f7ed Pill: Merge two "root" and "non-root" Pill plugins 2018-03-02 03:15:30 +03:00
Yan Zhulanow 3da479c1d5 Pill, Small: Pass libraries to 'parse()' directly 2018-03-02 03:15:29 +03:00
Yan Zhulanow 07ede20dc5 Pill: Import KotlinPlugin artifact 2018-03-02 03:15:28 +03:00
Yan Zhulanow bc78d2c417 Pill: Move .iml files out of the module structure 2018-03-02 03:15:27 +03:00
Yan Zhulanow 4c12a4cb11 Pill: Add 'unpill' task 2018-03-02 03:15:25 +03:00
Yan Zhulanow df88acaefd Get rid of test-to-production dependencies as it's not supported in plain IDEA projects 2018-03-02 03:15:24 +03:00
Yan Zhulanow e7a2743dcf Pill: Add "Generate All Tests" run configuration 2018-03-02 03:15:23 +03:00
Yan Zhulanow 55164660a8 Pill: Attach asm sources 2018-03-02 03:15:22 +03:00
Yan Zhulanow ad5a42459a Pill: Apply required changes to the default JUnit configuration on import 2018-03-02 03:15:21 +03:00
Yan Zhulanow 868ef262b8 Pill: Add JPS run configurations 2018-03-02 03:15:20 +03:00
Yan Zhulanow a0c105adbe Fixes to make the project compile when using Pill 2018-03-02 03:15:19 +03:00
Yan Zhulanow 8dad2d30f5 Move the compiler.xml back to IDEA (this fixes almost all IDE tests when running on JPS) 2018-03-02 03:15:18 +03:00
Yan Zhulanow 34d1611ed4 Add Pill support to compiler and IDE modules 2018-03-02 03:15:17 +03:00
Yan Zhulanow af60bcfb47 Initial Pill implementation
Pill is a Gradle-to-JPS model generator for compiler + compiler plugins + IDE project parts.
The generated project model does not know anything about Gradle and is fully operable using only JPS.
2018-03-02 03:15:16 +03:00
Yan Zhulanow 0ebcd0ad40 Remove inline function usages that break JPS compilation 2018-03-01 21:30:51 +03:00
Ilmir Usmanov 07ec704228 Fix modifiers generation for companion objects
when language verion is 1.3

 #KT-23002: Fixed
2018-03-01 20:03:26 +03:00
Alexey Sedunov 30314d43d9 Shorten Reference: Disable ${...} shortening inside completion insert handler 2018-03-01 17:41:10 +03:00
Mikhail Glukhikh 68757fff2e Downgrade "Type parameter can have ... variance" to INFORMATION level 2018-03-01 16:19:21 +03:00
Nikolay Krasko a03470d151 Fix test data for JavaMethodUsedInKotlin.kt test after 173.3.4 update
- Ignore empty lines in actual test data
- Don't generate additional //INFO: in final file diff
2018-03-01 15:41:10 +03:00
Renaud Paquay 94ee78c0ca Hitting breakpoint in Kotlin sometimes doesn't work (KT-22205)
Fix KT-22205 and https://issuetracker.google.com/issues/71556313

Hitting breakpoints in Kotlin JUnit test with an Android Gradle
project sometimes(*) does not work in Android Studio 3.1 beta.

(*) The issue is related to various threads running concurrently
with "dumb" mode background code, so the issue reproduces only
on certain configurations.

In a nutshell, the issue is as follows

* On one hand, gradle build finishes, fires an event ("buildFinished")
  that is processed "later" and that causes the IDE to enter "dumb" mode
  for a shot amount of time (about 300-500 msec on a somewhat up to date
  multi-core computer).

* On the other hand, once the JVM of the debuggee is started, breakpoints
  need to be resolved (on the debugger thread, through a call to
  com.intellij.debugger.engine.CompoundPositionManager.createPrepareRequests.
  This code calls into the "KotlinPositionManager.createPrepareRequests",
  which in turns calls into "PerFileAnalysisCache.analyze". That method
  returns "AnalysisResult.EMPTY" is the project is in dumb mode.
  This return value prevents callers from successfully resolving
  the source location into a breakpoint.

Given that the 2 code paths above execute on separate threads without
explicit synchronization, the "failed to resolve breakpoint" issue
occurs sporadically, to the point it happens 100% of the time on
certain configuration.

The fix is so wrap the kotlin breakpoint resolution code inside
a "runReadActionInSmartMode" so that the debugger thread "waits"
for "dumb" mode to terminates before trying to resolve breakpoint
locations.

 #KT-22205 Fixed
2018-03-01 15:41:09 +03:00
Nikolay Krasko b1bcadd762 Add mandatory dependency to com.intellij.modules.remoteServers
Android studio doesn't have this bundled module, so this should
prevent installing plugins for Intellij to AS.

This patch should be reverted in AS branches.
2018-03-01 15:41:07 +03:00
Egor Neliuba 715d5e90ba Clean up test skips after KT-17137
We need to clean these up since primitive array `is` checks work now

(cherry picked from commit b413e9ef51606c51ebfb21bd7ff646b0fb75470a)
2018-03-01 14:26:13 +03:00
Anton Bannykh 4a5e9bbc7f JS: remove -XtypedArraysEnabled flag (always true now) 2018-03-01 14:26:13 +03:00