Commit Graph

38571 Commits

Author SHA1 Message Date
Denis Zharkov 62a55b7b00 Fix false-positive resolution ambiguity when using akka
com.typesafe.akka:akka-cluster-sharding_2.12:2.5
akka.cluster.sharding.ClusterSharding  has the following methods:

    public static ClusterSharding get(ActorSystem var0) {
        return ClusterSharding$.MODULE$.get(var0);
    }

    public static Extension get(ActorSystem var0) {
        return ClusterSharding$.MODULE$.get(var0);
    }

NB: ClusterSharding  <: Extension
None of these methods is synthetic or something, but javac allows
calls like ClusterSharding.get(null)  and they get resolved
to the first method returning ClusterSharding

It seems that both javac and IntelliJ resolution algorithms filter out
such clashing declarations choosing the one that has the most
specific return type, the same idea is applied in the change

 #KT-17560 Fixed
2017-04-24 17:54:01 +03:00
Denis Zharkov 40e1d5bc23 Optimize KtFile::isScipt/getScript when file is not kts
`isScript` gets invoked for each call
(see org.jetbrains.kotlin.resolve.calls.CandidateResolver#checkOuterClassMemberIsAccessible)

And currently it may work for O(|top-level-declarations|),
that is rather slow e.g. for native stubs for gtk

 #KT-17562 Fixed
2017-04-24 17:53:20 +03:00
Ilya Chernikov af4caeaf24 Ignore empty lines at the end of the testdata, remove debug dump
should fix source-section plugin tests on windows
2017-04-24 16:50:19 +02:00
Alexey Sedunov fd41e266fb Quick Fixes: Add/remove 'suspend' in hierarchy
#KT-15903 Fixed
2017-04-24 14:55:37 +03:00
Vyacheslav Gerasimov 0d32ac924a Update 1.1.2 changelog 2017-04-24 14:07:49 +03:00
Anton Bannykh 0db3649da1 Added EnvironmentConfigFiles.NATIVE_CONFIG_FILES for Kotlin/Native 2017-04-24 13:20:57 +03:00
Dmitry Jemerov 5315f4d9da Initial implementation of rainbow highlighting for Kotlin
#KT-12629 Fixed
2017-04-22 13:45:36 +02:00
Alexander Udalov c9769ab454 Do not serialize/deserialize CommonCompilerArguments#errors
This prevents .idea/kotlinc.xml from being added with an empty
ArgumentParseErrors object and also fixes
ConfigureKotlinInTempDirTest.testKotlincExistsNoSettingsRuntime11
2017-04-22 02:17:49 +03:00
Ilya Gorbunov e0a4f9ba76 Rewrite precondition samples and refactor precondition tests
Precondition tests are shared for JS target.
Samples do not use assertFailsWith as expression, as it's going to be converted as a special template.
2017-04-21 21:13:25 +03:00
Ilya Gorbunov 2c32bae5ca kotlin-test: Make assertFailsWith<reified T: Throwable>() common 2017-04-21 20:52:14 +03:00
Ilya Gorbunov 307b132015 kotlin-test: Make assertFailsWith(KClass<T: Throwable>) common 2017-04-21 20:52:12 +03:00
Ilya Gorbunov ec8ead754f Run kotlin-test-js tests with kotlin-stdlib-js
Rework kotlin-test common tests to make them runnable with qunit.
Change the way how asserter is overridden in js box tests.
Minor: remove unneeded test configs
2017-04-21 20:51:07 +03:00
Ilya Gorbunov f009e0c665 kotlin-test: Make 'todo { }' function common 2017-04-21 20:50:59 +03:00
Nikolay Krasko 4d0b88e34b Minor: use 'Searching for' instead of 'Searching' 2017-04-21 15:12:08 +03:00
Nikolay Krasko 666ecdb7d6 Don't iterate through classes for Scala and Clojure 2017-04-21 15:12:08 +03:00
Nikolay Krasko 111f0b1e66 Avoid full references search for languages without PsiClass (KT-14974)
Make smart type search work for Groovy.

 #KT-14974 Fixed
2017-04-21 15:12:07 +03:00
Nikolay Krasko 102310e3c2 Skip references for invoke when number of arguments in psi is wrong 2017-04-21 15:08:52 +03:00
Nikolay Krasko d3ff8c12a4 Use dialog wrapper for controlling behaviour from tests
Known issue: can't use same approach for modifying Java dialogs
behaviour
2017-04-21 15:08:40 +03:00
Mikhail Glukhikh 247a571f51 Add test for multi-platform find usages #KT-15665 Obsolete
+ perform minor AbstractFindUsagesTest refactoring
2017-04-21 14:26:41 +03:00
Dmitry Jemerov 4e8fe18ca8 Fix facet validation: change ArgumentParseErrors to a data class
BaseCompilerSettings.validateInheritedFieldsUnchanged() compares
old and new properties of the compiler settings, and the check requires
ArgumentParseErrors.equals() to be correctly implemented
2017-04-21 13:20:49 +02:00
Dmitry Jemerov 7346fee513 Quickfix to enable coroutine support works in Maven projects
#KT-17521 Fixed
2017-04-21 13:20:49 +02:00
Dmitry Jemerov aabd560eef Quickfix to enable language feature works for Maven project
#KT-17520 Fixed
2017-04-21 13:20:48 +02:00
Dmitry Jemerov f389dc068c Import project configuration specified as Maven properties
#KT-17517 Fixed
2017-04-21 13:20:47 +02:00
Dmitry Jemerov 2fd290567c Remove unnecessary use of API which is not intended for clients 2017-04-21 13:20:46 +02:00
Dmitry Jemerov 34b5920225 Fix order of files with fixed data 2017-04-21 13:20:45 +02:00
Dmitry Jemerov 37d5a42b53 Delete some dead code which also happens to crash on test startup 2017-04-21 13:20:44 +02:00
Dmitry Jemerov 794a21aa9c Set default jvmTarget when configuring Kotlin with default configurator 2017-04-21 13:20:34 +02:00
Dmitry Jemerov 98903d4e39 Set default jvmTarget in new JPS projects 2017-04-21 13:20:33 +02:00
Dmitry Jemerov 79f228153c Set default jvmTarget when configuring Kotlin with Maven 2017-04-21 13:20:32 +02:00
Dmitry Jemerov 08dda665aa Ensure that idea-maven tests run on TeamCity 2017-04-21 13:20:31 +02:00
Dmitry Jemerov 372a65570c Set default jvmTarget when configuring Kotlin with Gradle 2017-04-21 13:20:30 +02:00
Dmitry Jemerov 1da1fcceb7 KotlinGradleModuleConfigurator: J2K 2017-04-21 13:20:30 +02:00
Dmitry Jemerov d4b0e85963 KotlinGradleModuleConfigurator: rename to .kt 2017-04-21 13:20:29 +02:00
Dmitry Jemerov 948699a24b Set default jvmTarget when creating new Gradle project
jvmTarget "1.8" is required to be able to use inline functions from
kotlin-stdlib-jre8.
2017-04-21 13:20:28 +02:00
Dmitry Jemerov d3682025cb Reuse repository selection logic in KotlinMavenConfigurator 2017-04-21 13:20:27 +02:00
Alexey Sedunov f575e2710f Move: Fix processing of implicit extension 'invoke' calls
Also fix bogus "unused import" inspection reported on such calls

 #KT-17496 Fixed
2017-04-21 13:32:34 +03:00
Alexey Sedunov c492f339e6 Quick Fixes: Fix AssertionError on rendering type parameter
#KT-17404 Fixed
2017-04-21 13:32:33 +03:00
Alexey Sedunov b80fbe1192 Change Signature: Avoid creating parameters from scratch
#KT-15519 Fixed
2017-04-21 13:32:32 +03:00
Alexey Sedunov c305a42128 Convert Receiver to Parameter: Place new parameter at the start
This affects editor template only since Change Signature already
puts converted receiver at the parameter list start by default

 #KT-15543 Fixed
2017-04-21 13:32:31 +03:00
Alexey Sedunov 6f984d8260 Gradle Support: Do not create facet for module without kotlin plugin
#KT-17265 Fixed
2017-04-21 13:32:30 +03:00
Denis Zharkov 513655239d Introduce initializer-related properties into JavaField
It's much more convenient to use and implement these
properties instead of manual "pattern matching" in the
JavaPropertyInitializerEvaluatorImpl
2017-04-21 12:56:30 +03:00
Denis Zharkov a5c352dc9f Add -Xuse-old-class-files-reading CLI argument
By default we use the fast implementation in CLI compiler,
but in the most of the tests the old one is enabled

Also add tests on CompiledJava with the fast class reading
implementation
2017-04-21 12:56:29 +03:00
Denis Zharkov af202ef5bc Get rid of wrong assumption that Java* classes are always PSI-based
See org.jetbrains.kotlin.load.java.structure.impl.classFiles.BinaryJavaClass
as a counter-example, these classes may be used now in CLI too and they
aren't built upon Java PSI
2017-04-21 12:56:29 +03:00
Denis Zharkov d65af8f951 Introduce custom Java model implementation for class-files
It's only used for CLI compiler, and it should improve performance
of loading Java descriptors from class-files

For IntelliJ, it leads to 10-15% percent speedup of Kotlin Builder

Before this change, we were using a Java model based on Java PSI that
also read class files, but do it less effectively since it performs
some extra work, that we don't need, e.g. eagerly reading all
the inner classes
2017-04-21 12:56:29 +03:00
Denis Zharkov 88950521a8 Refactor KotlinCliJavaFileManager: make it return JavaClass
It seems to be very natural refactoring considering the
following changes: optimizing KotlinCliJavaFileManagerImpl.findClass
to make it read class files manually instead of requesting PSI
2017-04-21 12:48:31 +03:00
Denis Zharkov 506d7ab3d2 Replace JavaClass.innerClasses with innerClassNames
Also add a findInnerClass method that can find an inner class
by its name

This change helps to avoid loading all the inner class files
eagerly (that may be rather slow), while all the names are available
in InnerClass attribute
2017-04-21 12:48:31 +03:00
Denis Zharkov 5936424659 Replace JavaClassifierType.canonicalText with classifierQualifiedName
The reason is that canonicalText requires some additional
computations to be done when reading class files, while
in fact we only need a class name of the type
2017-04-21 12:48:31 +03:00
Denis Zharkov aba8b4e2ba Add cache for top-level classes' virtual files
The reason is that searching for a class in a VirtualFile-based
directory (i.e. in a package) happens for O(|amount-of-files-in-dir|),
and it may be rather crucial for packages with a huge amount
of classes

Note that it was checked that the cache should not take a lot of heap
since we call findClass only for really existing classes:
see org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageScope.kt:48

For example, there are no more than 10k classes for the whole
intelliJ project (but the cache is flushed for each module)
2017-04-21 12:48:31 +03:00
Denis Zharkov 06ffbb7b93 Minor. Avoid repeating calls to isRaw 2017-04-21 12:48:31 +03:00
Denis Zharkov aef1ca10f7 Add additional cache for packages' directories
It's important because even if we know the root where
the package is located we need to go through its parts,
and it's not as fast as it could be since implementation
of VirtualFile.findChild() traverse all files in the directory
to find the relevant one
2017-04-21 12:48:31 +03:00