Commit Graph

38562 Commits

Author SHA1 Message Date
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
Denis Zharkov e4cb5496b8 Optimize getSingleAbstractMethodOrNull
Searching for the single abstract method leads to computing
whole member scopes of given intrefaces, especially when
they contain a lot of methods (i.e. they're definitely not SAMs)

On the other side this method is very hot because it's called
for each Java interface used as a type for some value parameter
(for building SAM adapters)

The idea is to apply some heuristics to understand using only
JavaMethod and supertypes that this interface is definitely not a SAM
2017-04-21 12:48:31 +03:00
Alexander Udalov db3f70cfe9 Drop unneeded hack relating to matching header class to impl typealias
This is not needed anymore because we use a special TypeCheckerContext
which correctly matches header class to impl typealias.

Also fix 'platformModule' in areCompatibleClassifiers: it's not b's
module (b is already the expansion of a typealias), but the module of
"other", original 'impl' classifier
2017-04-20 22:33:26 +03:00
Alexander Udalov ea727ff3f0 Use header->impl mapping in HeaderImplDeclarationChecker.areCompatibleTypes
Construct a special TypeCheckingContext that is aware of the magic
behind the "impl typealias" that implements a "header class"

 #KT-16986 Fixed
2017-04-20 22:33:25 +03:00
Alexander Udalov 1ce4612f74 Refactor module usages in HeaderImplDeclarationChecker
Instead of a vague name "moduleToCheck", use explicit names
"commonModule" and "platformModule".
2017-04-20 22:13:32 +03:00
Alexander Udalov a2e050a3b9 Use correct function to find header for impl in IDE
Also do not call isHeader/isImpl because the returned declarations are
guaranteed to be isHeader in findCompatibleHeaderForImpl and isImpl in
findCompatibleImplForHeader
2017-04-20 22:13:32 +03:00
Alexander Udalov af4f96fb52 Refactor HeaderImplDeclarationChecker
Build the compatibility map when looking for header given an impl, in
the same way as it's done for the search of impl given a header. The map
is mostly unused now (only its value at key=Compatible is used), but
will be used in the future to improve the diagnostic messages here
2017-04-20 22:13:32 +03:00
Simon Ogorodnik 4978a204f0 Make LibraryDependenciesCache cache again!
#KT-17495 fixed
2017-04-20 20:23:11 +03:00
Mikhail Glukhikh 99653b9afc Refactoring: merge doTest in AbstractMultiModuleHighlightingTest 2017-04-20 19:13:20 +03:00
Mikhail Glukhikh 266d36f289 Refactoring: rename header to common in MultiModuleLineMarkerTest 2017-04-20 19:12:13 +03:00