Compare commits

..

3087 Commits

Author SHA1 Message Date
Ilya Chernikov
b3a1311f7a Use Void instead of Unit in RMI calls, should fix EA-82064
("Could not initialize class Kotlin.Unit")
2017-02-22 13:54:12 +03:00
Ilya Chernikov
b604f0d851 Use sessions with connection to eliminate async shutdown problems
(cherry picked from commit 78d334b)
2017-02-22 13:54:11 +03:00
Alexey Tsvetkov
9b904db9ac Update changelog for 1.0.7 2017-02-22 08:12:38 +03:00
Alexey Tsvetkov
30487f4901 Replace daemon's message after start with constant string
#KT-15783 fixed

When a daemon client cannot find an existing daemon, it starts a new one.
The client waits for a daemon to start and initialize.
Then the daemon is expected to signal that it is ready for compiling by printing message in stdout.
Before this change the message was the daemons' run path (a directory where all daemons store
their "flag" files).
However the path printed by the daemon was not matched by the path expected by the client somehow
on Windows for a user with a username containing non-English letters.
This commit replaces the message with the constant string.
2017-02-18 19:38:39 +03:00
Alexey Tsvetkov
14a2f30002 Start daemon with explicit server ip address to prevent host name resolution 2017-02-18 19:38:34 +03:00
Alexander Udalov
b457996a69 Suggest to provide explicit dependency on new kotlin-reflect
In case when there's kotlin-stdlib 1.1 and kotlin-reflect 1.0 in the classpath

(cherry picked from commit 8e407d548a)
2017-02-17 12:37:17 +03:00
Alexander Udalov
ab9f8fdce1 Infer API version from older runtime in compiler's classpath
For example, if you invoke kotlinc 1.1 with kotlin-stdlib 1.0 in the classpath,
we now infer -api-version 1.0 automatically

(cherry picked from commit 71fcb07fad)
2017-02-17 12:37:16 +03:00
Alexander Udalov
3c0c4efc80 Filter out files with the same paths in runtime version checker
To prevent listing them several times in the diagnostic message

(cherry picked from commit b56639a775)
2017-02-17 12:37:16 +03:00
Alexander Udalov
24d822b6da Report warnings instead of errors in runtime version checker
(cherry picked from commit 8457ab7c58)
2017-02-17 12:37:16 +03:00
Alexander Udalov
1298a7c183 Fix compilation for 1.1 2017-02-17 12:37:16 +03:00
Ilya Chernikov
7584f96a16 Attempt to make the parallel start test more robust 2017-02-16 22:39:19 +03:00
Ilya Chernikov
35e89a1afb Fix after backporting to 1.0.7 2017-02-16 22:37:23 +03:00
Ilya Chernikov
2711777357 Fixes after review 2017-02-16 22:37:23 +03:00
Ilya Chernikov
0711a991dc Adjust test after introducing shutdown delay 2017-02-16 22:37:23 +03:00
Ilya Chernikov
03f402561f Implement more reliable daemon election, fixes KT-15562
also making shutdown more reliable
2017-02-16 22:37:23 +03:00
Ilya Chernikov
c185af29f6 Add test reproducing "Service is dying" problem (KT-15562) 2017-02-16 22:37:23 +03:00
Pavel V. Talanov
df10cc9bd1 Cls stubs and decompiled text: Do not render parameter names in decompiled text and do not load ParameterName annotation in stubs
Add tests for decompiled text and stubs

 #KT-16271 Fixed
2017-02-16 12:08:27 +01:00
Yan Zhulanow
c399db1b6a Revert "Kapt3: Add generated source files to Java compile task after kapt execution. Filter only .java files."
This reverts commit 82c2ce3a33.
2017-02-15 16:27:15 +03:00
Yan Zhulanow
543349d4be Kapt3: Fix annotation processor option passing 2017-02-15 16:27:04 +03:00
Alexander Udalov
570da1858e Fix unreported deprecation on variables called as functions
#KT-16272 Fixed

(cherry picked from commit 57f2feb6fb)
2017-02-13 14:24:57 +03:00
Alexey Tsvetkov
dcd3dd6e10 Avoid storing absolute paths in SyncOutputTask
#KT-16003 fixed
2017-02-10 00:14:07 +03:00
Yan Zhulanow
da107bdbf8 Kapt3: Generate import statements in stubs 2017-02-08 21:31:36 +03:00
Yan Zhulanow
f0bb8e8fa1 Kapt3: Serialize annotation processor options to base64 to support spaces in option values 2017-02-08 21:31:35 +03:00
Yan Zhulanow
eca4c768cd Kapt3: Invoke integration tests with the Kotlin runtime in the compile classpath (this fixes integration tests, nullability annotations from org.jetbrains were not found) 2017-02-08 21:18:17 +03:00
Yan Zhulanow
a8a3550739 Kapt3: Allow users to disable error type correction (and now it's disabled by default) 2017-02-08 21:18:05 +03:00
Yan Zhulanow
6829143d48 Kapt3: Use the javac's finalCompiler log to determine if there were any annotation processing errors (KT-16176) 2017-02-08 21:13:20 +03:00
Yan Zhulanow
9b6408f2b9 Minor: Update test data because of KT-15697 2017-02-08 21:13:12 +03:00
Yan Zhulanow
67d0526a3c Minor: Remove obsolete JAVA_FILE_PARSING_ERROR constant, fix corresponding test 2017-02-08 21:13:06 +03:00
Yan Zhulanow
d91c67e729 Kapt3: Ignore declarations with illegal Java identifiers (KT-16153) 2017-02-08 21:13:00 +03:00
Yan Zhulanow
10ba8a16bc Kapt3: Fix working in verbose mode (NPE in JavacFiler.java:597) (KT-16146) 2017-02-08 21:12:53 +03:00
Yan Zhulanow
59f8181ff2 Kapt3: Write Intellij annotations (NotNull/Nullable) to stubs 2017-02-08 21:12:47 +03:00
Yan Zhulanow
36b339ad89 Kapt: Fix error messages map name 2017-02-08 21:12:22 +03:00
Yan Zhulanow
08a0bfb371 Kapt3: Allow annotations with Kotlin-only targets, such as PROPERTY (KT-15697) 2017-02-08 21:12:11 +03:00
Yan Zhulanow
f98cb98020 Kapt: Fix javac error reporting in Kotlin daemon, also fix parsing error reporting (KT-15524) 2017-02-08 21:11:26 +03:00
Yan Zhulanow
9d5b4cca49 Kapt3: Add generated source files to Java compile task after kapt execution. Filter only .java files.
This is needed to generate Kotlin files using kapt.
2017-02-08 21:10:16 +03:00
Alexey Tsvetkov
8c48bf4485 Update changelog for 1.0.7 2017-02-07 21:43:11 +03:00
Alexey Tsvetkov
55c7fe9b38 Update changelog for 1.0.6 2017-02-07 21:43:11 +03:00
Alexey Tsvetkov
c013fe0a52 Fix testdata: update verbose ant log 2017-02-07 21:43:11 +03:00
Mikhail Glukhikh
aec5a6f57f Join declaration and assignment: extra descriptor check for assignment of the same property
(cherry picked from commit 81e083a)
2017-02-07 12:51:13 +03:00
Mikhail Glukhikh
0f5e43b636 Join declaration & assignment: do not suggest for non-first line of init / constructor #KT-15545 Fixed
(cherry picked from commit 153bc79)
2017-02-07 12:51:00 +03:00
Mikhail Glukhikh
267aa418ea Join declaration & assignment: treat assignment with this. correctly #KT-16000 Fixed
(cherry picked from commit ea6e3c8)
2017-02-07 12:50:47 +03:00
Alexander Udalov
9dd9c2c5f8 Improve error on runtime of version different than API version
Include the actual runtime version in the error message

(cherry picked from commit ca1ed850b8)
2017-02-07 10:04:08 +03:00
Alexander Udalov
3670d5c6ab Report different runtime versions earlier than incompatibility with API version
Previously if you had kotlin-reflect 1.0 and kotlin-runtime 1.1 in the
classpath, checkCompatibleWithApiVersion was invoked first, and an error was
reported that suggested to pass "-api-version" to the compiler. However, no
correct "-api-version" can be passed in this case, because
checkMatchingVersions would then report that the two libraries have different
versions anyway. So, now we first ensure that all libraries have the same
version, and only then do check if the version is correct

(cherry picked from commit 57f8ef372f)
2017-02-07 10:04:08 +03:00
Alexander Udalov
cd14a8405c Check API version instead of language in JVM runtime versions checker
It should be a valid case to invoke the 1.1 compiler with the 1.0 runtime in
the classpath and "-api-version 1.0". However, previously it was an error and
the message suggested to specify "-language-version 1.0". Language version 1.0
implies API version 1.0, so this effectively made the "-api-version" option
useless

(cherry picked from commit 3a7eec8635)
2017-02-07 10:04:07 +03:00
Ilya Chernikov
80eb741373 Move daemon session flag files to daemon discovery dir by default + minor fixes:
- Move flag files from the temp dir, because right now JPS cleans temp dir on each build start. Should fix KT-15707, also may affect KT-15562.
- change compiler runner to allow the fix above
- Fix flag file name filtering
- Fix ifAlive handling on the new compile method in the daemon.

# Conflicts:
#	compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt
#	compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/ClientUtils.kt
2017-02-06 19:24:46 +03:00
Alexey Tsvetkov
b52aa4b2bb EA-95293: do not report OUTPUT messages to message collector if outputs collector is specified 2017-02-06 19:12:31 +03:00
Ilya Chernikov
3a5282afee Update daemon client with wrappers for basic compiler API
Other changes to extract results for compiler, tests.
2017-02-06 19:12:13 +03:00
Alexey Tsvetkov
32f6260c26 Fix getting daemon connection in JPS 2017-02-06 17:17:59 +03:00
Alexey Tsvetkov
75a6e3792c Fix failing Gradle tests
* Extract ANDROID_HOME_PATH constant
* Set ANDROID_HOME_PATH to dependencies/androidSDK
* Running download_android_sdk.xml is now needed to run Gradle Integration Tests
* Modify download_android_sdk.xml so that tools/android is executable
2017-02-06 11:37:49 +03:00
Alexey Tsvetkov
369e1a162b Avoid having -d and -module set at the same time
#KT-14619 fixed
2017-02-06 11:37:49 +03:00
Alexey Tsvetkov
d7fb2fe4cc Fix annotation processors outputting to classes dir with kapt 3
#KT-15915 fixed

 Annotation processor can access a classes directory provided by AP environment.
Previously kapt 3 was using kotlin-classes directory as a a classes directory.
However compileKotlin task does not expect this.
Also having multiple tasks with the same output dir is a bad practise in Gradle.

This change introduces a separate directory for classes generated by kapt 3.
Its output is copied to a resulting classes dir (just as a kotlin-classes dir).
2017-02-06 11:37:49 +03:00
Alexey Tsvetkov
2ce9cc988e Correct construction of UnicastRemoteObject
#KT-15837 fixed
2017-02-06 11:37:49 +03:00
Alexey Tsvetkov
4795cf91d2 Fix kapt1 with stubs test to main internal references 2017-02-06 11:37:49 +03:00
Vyacheslav Gerasimov
bb0eeeae6c Fixed InvalidMirrorException in uast while getting annotation argument location 2017-02-03 15:16:59 +03:00
Vyacheslav Gerasimov
a7889a81d5 Fixed exception in android lint ApiDetector 2017-02-02 21:28:53 +03:00
Vyacheslav Gerasimov
3647d53c1f Fixed error reporting in AnnotationDetector
#KT-14920 Fixed
2017-02-02 19:48:54 +03:00
Vyacheslav Gerasimov
a8b1511890 Uast 1.0.9 2017-02-02 19:31:43 +03:00
Alexey Tsvetkov
40c89a7cb8 Fix compilation error 2017-02-02 19:03:48 +03:00
Yan Zhulanow
28e91e5206 Fix lint and kapt test running on TeamCity 2017-01-31 21:19:38 +03:00
Yan Zhulanow
cfe653809a Generate enum values with bodies properly (KT-15803) 2017-01-31 21:19:37 +03:00
Yan Zhulanow
beec138086 Kapt: Allow empty .kt files list in kapt in order to support kapt with Java-only source files. (KT-15675) 2017-01-31 21:19:36 +03:00
Alexander Udalov
6d00928d12 Minor, fix typo in assertion message
(cherry picked from commit 7371dc9b54)
2017-01-31 11:14:36 +03:00
Alexander Udalov
52492cd161 Add hint to use "-language-version", when applicable, in JVM runtime checker
(cherry picked from commit 424afba246)
2017-01-31 11:14:32 +03:00
Alexander Udalov
612eb147c0 Refactor JvmRuntimeVersionsConsistencyChecker for readability
(cherry picked from commit 7167139c2e)
2017-01-31 11:14:25 +03:00
Alexander Udalov
158fa377e5 Do not report error on libraries that bundle Kotlin runtime in classpath
Instead, report a strong warning, suggesting to remove such libraries from the
classpath

 #KT-15995 Fixed

(cherry picked from commit 9e877b4a9e)
2017-01-31 11:14:00 +03:00
Alexander Udalov
d16e653085 Promote severity of configuration warnings to STRONG_WARNING
The reason is that these configuration problems may be the reason of
compilation errors, but they were hidden from the output because warnings are
not reported when there's at least one error

(cherry picked from commit e9a737b85a)
2017-01-31 11:13:34 +03:00
Alexander Udalov
f66782cc33 Introduce CompilerMessageSeverity.STRONG_WARNING
This is a severity for mandatory warnings, i.e. those which should be reported
in any case, even if there are compilation errors

(cherry picked from commit 7ac96163ac)
2017-01-31 11:12:02 +03:00
Vyacheslav Gerasimov
11dc0316ad Implemented building Kotlin Android projects with Jack toolchain enabled
#KT-13275 Fixed
Implemented KotlinJillTask for converting kotlin classes to jace format which could be consumed by Jack transform task

(cherry picked from commit 7bd6314)
2017-01-29 23:50:28 +03:00
Dmitry Jemerov
76e5fa9e8f Workaround for compilation issue: don't use a Java shim to access token name, use toString() instead (for all relevant tokens, it will return the name, and for all others, the return value won't match the Java keyword filter regexp) 2017-01-28 00:26:03 +09:00
Yan Zhulanow
52db3926a1 Kapt: Fix extending configurations in Gradle, create "main" configuration if it does not exist yet. Also fix checking kapt configuration dependencies, use allDependencies instead (KT-15814) 2017-01-28 00:24:27 +09:00
Yan Zhulanow
442691f0b1 Kapt3: Write qualified name of classes on error type conversion, handle declaration-site variance properly. 2017-01-28 00:24:20 +09:00
Yan Zhulanow
4800dbe39b Kapt3: As javac now reads stubs from Java files, not from AST, we should provide the valid names for all identifiers (at least names should not clash with Java keywords).
Rename identifiers if it clashes with Java keywords. (KT-15838)
2017-01-28 00:24:12 +09:00
Yan Zhulanow
3dfa16dddd Kapt3: Do not check type for star projection, it causes the infinite recursion. Also limit recursion depth to 10. (KT-15841) 2017-01-28 00:23:34 +09:00
Alexander Udalov
5133e3f4a4 Do not consider Kotlin compiler as library in runtime versions checker
Otherwise because there's no Kotlin-Version in its manifest, it's regarded as a
1.0 runtime library which conflicts with 1.1 libraries

(cherry picked from commit 76fc3b40d5)
2017-01-23 16:34:16 +03:00
Alexander Udalov
7d20f16486 Support "Main" component in JVM runtime version consistency checker
The point here is to disable the "checkNotNewerThanCompiler" check because it
breaks a real life use case of compiling with an old compiler against the new
runtime library (that may come implicitly as a transitive dependency of another
library). However, to keep the possibility of restoring this check in the
future without backporting the needed changes into the old branches, we now
only perform this check for the "Core" runtime components, and all other checks
-- for "Core" and "Main" runtime components. In the follow-up commit, we change
the runtime component of our libraries to "Main". If we decide we need the
"checkNotNewerThanCompiler" behavior in the future, we can change the runtime
component to "Core", effectively restoring this check in the old compilers

(cherry picked from commit 139d37cfd0)
2017-01-21 13:01:01 +03:00
Yan Zhulanow
ca744d7d12 Kapt3, Gradle: Fix kapt execution in tests. Check filtered dependencies list properly (KT-15459) 2017-01-20 00:34:55 +09:00
Yan Zhulanow
ad7b2768ac Kapt3: Replace error/NonExistentClass with the actual type (from PSI) (KT-15421) 2017-01-20 00:34:32 +09:00
Yan Zhulanow
9f822c4914 Minor: Add uast-kotlin to 'idea' module classpath (fix failing Lint tests) 2017-01-20 00:34:16 +09:00
shiraji
37a7d192e4 Fix the problem with ConvertPrimaryConstructorToSecondaryIntention for enum #KT-15406 Fixed
(cherry picked from commit ad9bf16)
2017-01-19 18:02:14 +03:00
Yan Zhulanow
651bcdaa93 Kapt3, Gradle: Prevent circular dependency between kapt and kotlinCompile tasks (KT-15713) 2017-01-19 16:28:44 +03:00
Alexey Tsvetkov
7627c65ab9 Minor fixes after rebase 2017-01-18 17:19:12 +03:00
Alexey Tsvetkov
5547ddb969 Fix passing friend paths from Gradle to Kotlin daemon when compiling with IC 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
7312b9f697 Pass compiler args from facets when compiling in fallback mode from JPS 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
83e504a422 Minor: remove reference to nonexistent target platform 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
7b5ba6a063 Make CompilerMessageLocation serializable 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
bda262cfef Fix handling OUTPUT message from daemon in JPS client 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
a31f18c7b9 Minor: rename CompilationResultSink->CompilationResults 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
561fa5efd9 Fix the build
# Conflicts:
#	compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt
2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
73ebade34f Minor: add comment 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
9746a94611 Minor: fix typo EventManger->EventManager
# Conflicts:
#	compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt
2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
bc8e63177e Minor: rename Storage->Sink 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
3e29b90758 Minor: rename CompilationResult->CompilationResultCategory
# Conflicts:
#	libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt
2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
577c8f4b4c Minor: move CompilerMode 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
ccb5de95e4 Minor: introduce EXCEPTION report category 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
b74c4e4007 Minor: fix naming 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
6ebb7d13d4 Minor rename parameters to match parent constructor 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
45acb1b860 Minor: fix CompilerMessageSeverity order 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
64f7770246 Refactor messages sending
# Conflicts:
#	libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt
2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
6b93e91325 Move CompilerMode and TargetPlatform to CompilationOptions 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
cbea3f2c1d Rename AdditionalCompilerArguments->CompilationOptions 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
e443129ed5 Remove operations tracer from compile() interface 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
1da6dbc53b Refactor JPS daemon client
# Conflicts:
#	compiler/compiler-runner/src/org/jetbrains/kotlin/compilerRunner/KotlinCompilerRunner.kt
#	libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt
2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
0a73bc48e2 Enable verbose messages when debug is enabled
# Conflicts:
#	libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt
2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
bdc9e2d894 Refactor gradle daemon client
# Conflicts:
#	libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt
#	libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/KotlinCompileCommon.kt
2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
deb02ad422 Refactor daemon interface
# Conflicts:
#	compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/CompileService.kt
#	compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt
2017-01-18 16:45:10 +03:00
Ilya Chernikov
7d7eccd2d6 Refactor session accounting in daemon, add REPL to it, write a test (cherry picked with changes)
Cherry picked from ea4a1df839 (master)
REPL related changed are dropped
2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
ef40be27e0 Make ICReporter interface 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
cda45b772a Add integer value to compiler message severity 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
3f475c2bc3 Make compiler arguments serializable 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
a53c85a01b Minor fixes after rebasing kotlin daemon from master 2017-01-18 16:45:10 +03:00
Ilya Chernikov
f4f89fefbe Put native-platform-uberjar.jar into compiler embeddable and remove dependency from the compiler runner 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
77ee58937a Remove reference to removed dependency from pom.xml 2017-01-18 16:45:10 +03:00
Ilya Chernikov
aa582f4d11 Fix TC compilation and kapt3 tests compilation 2017-01-18 16:45:10 +03:00
Alexey Tsvetkov
078bca2459 Minor: remove default value of retryOnConnectionError parameter 2017-01-18 16:44:17 +03:00
Alexey Tsvetkov
dfe83e093d Minor: replace map().flatten()->flatMap() 2017-01-18 16:44:17 +03:00
Alexey Tsvetkov
b185b0adef Minor: rename enableIC->withIC 2017-01-18 16:44:17 +03:00
Alexey Tsvetkov
dd1f1019a5 Minor: fix snapshot version used in kapt test kt15001 2017-01-18 16:44:17 +03:00
Alexey Tsvetkov
9ff79ca58c Report messages from kapt using MessageCollector
This allows to print messages when daemon is used.
System out is not copied to daemon client,
because multiple compilations can occur in parallel.
2017-01-18 16:44:17 +03:00
Alexey Tsvetkov
b80effd85a Optimize searching for compiler jar 2017-01-18 16:41:19 +03:00
Alexey Tsvetkov
fbc79b4aa3 Unify Gradle and Kotlin daemon cache version checking 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
2fc4722f53 Clear jar cache with daemon
# Conflicts:
#	compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/CompileService.kt
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
383fb19e3e Minor: add missing import 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
ac97559483 Fix gradle subplugin example 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
c02ddcbb38 Fix multiproject Gradle IC with daemon 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
93e4f8bdef Set property "idea.plugins.compatible.build" every time production environment is created
Gradle can wipe system properties between the build.
If this property is not set, "idea.properties is not found exception"
can be thrown when creating KotlinCoreEnvironment.
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
dc3e5bd798 Implement server side IC
# Conflicts:
#	compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/CompileService.kt
#	compiler/daemon/daemon.iml
#	compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
8ccbefc382 Refactoring: extract withDaemon 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
89ec937f0a Refactoring: pass MessageCollector, OutputItemsCollector in CompilerEnvironment 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
d9d2d45df0 Minor: move GradleCompilerEnvironment to separate file 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
fa5b094492 Minor: remove redundant call 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
386d9976a5 Move IC tests to compiler
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
6299927946 Move file utils
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
32488567b9 Make IC classes public
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
084121ca52 Remove remaining gradle api references
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
4ca1406bf8 Replace org.jetbrains.kotlin.com.intellij with com.intellij
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
e57bbf108e Move IC from Gradle to compiler
Reasons for moving:
1. Integration with Kotlin daemon for Gradle.
Gradle bundles Kotlin compiler (kotlin-compiler-embeddable) since Gradle 3.2.
There is no plugin isolation in Gradle, so strange compilation errors/exceptions may happen.
We decided to fix this problem by compiling out-of-process using Kotlin daemon.

Reasons for moving IC to the compiler:
* Better isolation from Gradle process.
* Incremental compilation logic is not scattered across two process and multiple modules.
* Makes it possible to implement standalone CLI IC

# Conflicts:
#	build.xml
#	libraries/pom.xml
#	libraries/tools/kotlin-build-common/pom.xml
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
775cd7750e Replace Gradle logger with ICReporter 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
1a7b7d46a7 Refactoring: extract interface AnnotationFileUpdater 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
e1602441fa Rename: IncReporter->ICReporter 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
a4a6858273 Remove source annotations removing (not needed with KAPT3) 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
32a608ae5b Minor: log compiler arguments 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
9b03999294 Use daemon when compiling Kotlin to JS
# Conflicts:
#	libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
6077d2a5ce Fix references from test to main in Gradle JS plugin with default output file 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
e8b51f4aa9 Minor: add debug test util 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
cd85b930b1 Provide default output JS file in Kotlin Gradle plugin 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
bc260b914f Extract throwGradleExceptionIfError 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
3b366b91a8 Rename: SourceRoots.ForJs->KotlinOnly 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
9421e28055 Use ProcessLauncher from native platform for out-of-process compilation 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
3c74abd7a9 Add a way to customize compiler file in build.gradle
# Conflicts:
#	libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt
#	libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt
2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
9ec1ef4444 Implement fallback strategies 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
0bb2cdd490 Test builtins compilation with Gradle 3.2 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
5ce6408669 Run compiler via Kotlin daemon in Gradle plugin 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
7ee501d766 Refactoring: extract JPS specific code from compiler-runner 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
8d33ddf51f Add compiler daemon client and runner to maven build 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
713898f3a9 Minor: remove ImmutableMapBuilder reference from CompilerOutputParser 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
4ba1da9438 Convert CompilerOutputParser: convert to kotlin 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
57b4a3e612 Convert CompilerOutputParser: rename file 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
a497e9c66b Introduce compiler-runner module 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
afb55809cb Convert CompilerEnvironment to Kotlin: actual conversion 2017-01-18 16:38:39 +03:00
Alexey Tsvetkov
93b4175c82 Convert CompilerEnvironment to Kotlin: rename file 2017-01-18 16:38:39 +03:00
Valentin Kipyatkov
9977de9393 Fixed "Offset ... is not registered" exceptions when running under IDEA 2016.3
Cherry-pick: eefa409a1d

Conflicts:
	idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionUtils.kt
2017-01-18 13:43:36 +03:00
Nikolay Krasko
131a6467bc Fix tests
Addition to 5d08e82aaf
2017-01-18 13:43:35 +03:00
Nikolay Krasko
a040fa9621 Fix look up for breakpoint in crossinline lambdas in android (KT-15282)
#KT-15282 Fixed
2017-01-17 20:15:42 +03:00
mglukhikh
ef8ffe6e5a Fixed KNPE in convert primary constructor to secondary #KT-14745 Fixed
(cherry picked from commit 93b2c56)
2017-01-16 17:43:44 +03:00
Simon Ogorodnik
57b3294cc6 KT-15141 Bogus import popup for when function call cannot be resolved fully
#KT-15141 fixed

(cherry picked from commit c5e3f0a)
2017-01-12 14:50:07 +03:00
Simon Ogorodnik
c2fb3ce9df KT-14815 alt + enter -> "import" over a constructor reference is not working
#KT-14815 fixed

(cherry picked from commit db8edb0)
2017-01-12 14:45:29 +03:00
Alexander Udalov
9ef9ddce12 Do not emit pre-release flag if -Xskip-metadata-version-check is used
The -Xskip-metadata-version-check command line argument is supposed to be used
to avoid getting errors only; the side effect that it also caused compiler to
write the pre-release flag to binaries was a mistake and is fixed now

(cherry picked from commit edb4fd1dfd)
2017-01-12 10:56:51 +03:00
Alexander Udalov
53e7a3382a Treat binaries with version 1.1.2 as pre-release
Metadata version is 1.1.2 since the start of Kotlin 1.1 EAP. Because the
pre-release flag was not written to class files compiled with 1.1 EAP, there's
no other way to figure out that they're pre-release except than to look at the
metadata version. This assumes that the version will be advanced to 1.1.3 once
Kotlin 1.1 is released

(cherry picked from commit 88f0c32b2c)
2017-01-12 10:56:43 +03:00
Mikhail Glukhikh
e0cdfe839d Join declaration & assignment is no more suggested in case of potential smart cast available #KT-15412 Fixed
(cherry picked from commit 7c6d5c8)
2017-01-12 10:46:02 +03:00
Mikhail Glukhikh
6f9c01d0eb Clearer diagnostic message for platform type inspection #KT-14630 Fixed
(cherry picked from commit 43a4035)
2017-01-11 16:28:40 +03:00
Alexander Udalov
fdb4fa5685 Fix test data differences between master and 1.0.x 2017-01-11 14:46:35 +03:00
Alexander Udalov
e23e8218e7 Fix generic signature for KFunctionN types on JVM
#KT-15473 Fixed

(cherry picked from commit 0dbb02ec6a)
2017-01-11 13:24:41 +03:00
Mikhail Glukhikh
6173647f42 Control-flow analysis: do-while scope is ended after condition but before jump #KT-15334 Fixed
(cherry picked from commit b81268c)
2017-01-10 18:01:13 +03:00
Alexander Udalov
c295d4284d Fix compilation 2017-01-10 14:08:45 +03:00
Alexander Udalov
ffa3335757 Do not mark class files as pre-release if compiled with -language-version 1.0
#KT-15584 Fixed

(cherry picked from commit f4200e02bc)
2017-01-10 12:28:20 +03:00
Alexander Udalov
839dfa3f44 Do not fail on SinceKotlinInfo table in incremental binaries
(cherry picked from commit 74880a7e8e)
2017-01-10 12:24:26 +03:00
Alexander Udalov
271255b2b5 Prefer package with class files to class with the same name
See comments in JvmDependenciesIndexImpl and in the test

 #KT-15464 Fixed

(cherry picked from commit 164c72e877)
2017-01-10 12:24:16 +03:00
Kirill Rakhman
80c6cfe370 Add quickfix for changing primitive cast to primitive conversion method
Fixes #KT-15564

(cherry picked from commit a0491d5)
2017-01-09 16:51:32 +03:00
Kirill Rakhman
bf33d222a9 "Add names to call arguments" shouldn't appear when the only argument is a trailing lambda
Fixes #KT-15501

(cherry picked from commit 2b54f1a)
2017-01-09 16:49:09 +03:00
Ilya Zorin
1dd8545c20 Format spaces around ::
(cherry picked from commit c5677f0)
2017-01-09 12:20:39 +01:00
Ilya Zorin
9c8d201e0a Format spaces around by keyword (#1016)
(cherry picked from commit ffe80dd)
2017-01-09 11:31:05 +01:00
Valentin Kipyatkov
95d9ad27ec KT-14376 ClassCastException from object with vals
#KT-14376 Fixed

(cherry picked from commit 3d5d2d8)
2017-01-09 12:39:07 +03:00
Yan Zhulanow
fa8bba6a31 Minor: extract uast-kotlin to its own jar file in order to reuse in evaluator tests 2016-12-30 18:50:55 +03:00
Yan Zhulanow
d55552b626 Update Lint diagnostics to Uast 1.0.8 2016-12-30 17:49:36 +03:00
Yan Zhulanow
1a4cf56932 Move uast-kotlin and uast-kotlin-idea back to Kotlin project (cause the implementation is different in Kotlin 1.0.6 and 1.1) 2016-12-30 17:49:35 +03:00
Yan Zhulanow
465b483845 Allopen, Noarg: Implement old classpath elements filtering correctly (KT-15448) 2016-12-29 22:06:32 +03:00
Yan Zhulanow
6de6908b8c Check the backing field before checking accessors in KotlinAnnotatedElementsSearcher. This should be faster, and it fixes the problem with IDEA hangs in DataBinding. 2016-12-29 20:22:45 +03:00
Mikhail Glukhikh
600b73562f 1.0.7-related test file fix 2016-12-29 12:40:37 +03:00
Mikhail Glukhikh
fce09d85ba More accurate check of repeated use-site annotations #KT-13859 Fixed
(cherry picked from commit 5f3c1df)
2016-12-29 10:34:03 +03:00
shiraji
7bb69d1c1a Add inspection that reports unused equals expression #KT-6217 Fixed
(cherry picked from commit 778289f)
2016-12-29 10:33:48 +03:00
Yan Zhulanow
40d618e9b2 Kapt3: Always write Kotlin stubs to .java files, and make javac always parse them from source files, not from JCTree (in order to support incremental compilation). 2016-12-28 21:10:31 +03:00
Yan Zhulanow
db21d82b34 Kapt3: Kapt task should depend on all Java task dependencies 2016-12-28 21:10:30 +03:00
Yan Zhulanow
0d8b0a351f Kapt3: Generate incremental compilation metadata (light classes with Kotlin metadata) 2016-12-28 21:10:30 +03:00
Yan Zhulanow
332588e98a Kapt3: Fix stack trace reporting (KT-15433) 2016-12-28 21:09:20 +03:00
Yan Zhulanow
5329011ad0 Kapt3: Force annotation processing classpath entries to be unique 2016-12-28 21:09:20 +03:00
Yan Zhulanow
a6c45add3a Kapt3: Write stub class files with metadata (needed for incremental compilation) 2016-12-28 21:09:18 +03:00
Yan Zhulanow
51bf9604ee Add DataBindingComponentShortNamesCache and DataBindingShortNamesCache to ignored caches for Java callables sources. Extract filteredShortNamesCaches property 2016-12-28 21:09:16 +03:00
Yan Zhulanow
92ec270172 Exclude BrShortNamesCache from processJvmCallablesByName() because of the severe lags in Java static member import quickfix. (KT-14308)
Also exclude Kotlin light classes cache because light classes are filtered out anyway.
2016-12-28 21:09:14 +03:00
Yan Zhulanow
16dff1ee6d Kapt3: Nested class inside an interface should always be public and static (KT-15145) 2016-12-28 21:09:13 +03:00
Yan Zhulanow
b76c83bce7 Kapt3: Attach additional compiler plugins to kapt<sourceSetName>Compile task 2016-12-28 21:09:12 +03:00
Yan Zhulanow
5e47c20d8d Kapt: Fix kapt3 on Linux (KT-15375) 2016-12-28 21:09:11 +03:00
Yan Zhulanow
e7b4a4686d Minor: review changes 2016-12-28 21:09:10 +03:00
Yan Zhulanow
71185c5538 Android Gradle plugin: Fix compatibility with Android Studio 2.3 (KT-15376) 2016-12-28 21:09:09 +03:00
Alexander Udalov
7fbdb99184 Fix "Rewrite at slice LEXICAL_SCOPE" for callable references
For special calls (when-expressions, if-expressions, etc.), do not attempt to
get type of the argument expression, which is the block with the callable
reference, instead get type of the callable reference itself. The difference
matters because for block expressions, a new lexical scope is created for each
getTypeInfo (see ExpressionTypingServices.getBlockReturnedType), and we do not
support rewrites of this value in the binding trace

 #KT-12044 Fixed
2016-12-26 16:49:04 +03:00
Mikhail Glukhikh
13b79b35c1 1.0.7-related test file fix 2016-12-26 11:17:04 +03:00
Mikhail Glukhikh
fb692607c3 USELESS_ELVIS_RIGHT_IS_NULL is no more reported for flexible left argument #KT-13593 Fixed
(cherry picked from commit 0e70e3f)
2016-12-23 15:14:17 +03:00
Mikhail Glukhikh
ec654c41a6 Inspection to convert two comparisons to range check #KT-5045 Fixed
(cherry picked from commit 4a1e6d3)
2016-12-22 17:28:58 +03:00
Mikhail Glukhikh
7c0199ead6 Fold initializer & if to elvis: search for variable usage inside if first #KT-14889 Fixed
(cherry picked from commit 67788e3)
2016-12-22 17:28:43 +03:00
Mikhail Glukhikh
afd45cc25f More accurate handling of Elvis in areParenthesesNecessary #KT-15227 Fixed
(cherry picked from commit ee1b741)
2016-12-22 17:27:36 +03:00
shiraji
9da2f39b49 KT-5045: intention to convert between two comparisons and range check and vice versa
(cherry picked from commit 6d6a16f)
2016-12-22 17:27:22 +03:00
Nikolay Krasko
f93ad4e7e9 Take new name when layout rename started from reference
Cherry-picked from 49d5712.
2016-12-22 16:46:24 +03:00
Nikolay Krasko
d891933fde Always return identifier from handleElementRename() (KT-14358)
Returning reference will lead to replacing identifier with reference, that result bad psi, bad stubs, and failure at some point.

Cherry-picked from da5f2a0784

 #KT-14358 Fixed
2016-12-22 16:46:22 +03:00
Nikolay Krasko
470f4c5073 Use JavaRegExpHost for Kotlin RegExp injection (KT-15329)
#KT-15329 Fixed

(cherry picked from commit 8a49a017ff)
2016-12-22 16:46:21 +03:00
Nikolay Krasko
2462b985ea Increment relative to 1.0.7 branch 2016-12-21 20:23:14 +03:00
Nikolay Krasko
1e1fe7aee7 "Go to Type Declaration" is broken for stdlib types (KT-13001)
#KT-13001Fixed

(cherry picked from commit 2500dc9bb1)
2016-12-21 20:19:42 +03:00
Nikolay Krasko
f1d3435f9d Don't call getClassDescriptor for local declarations (KT-15259)
#KT-15259 Open

(cherry picked from commit 6ca5ba3615)
2016-12-21 20:19:41 +03:00
Yan Zhulanow
ca7d965817 Kapt: Parse generic signatures with inner class types correctly 2016-12-20 18:14:00 +03:00
Nikolay Krasko
ff3b7b2df4 Don't assign type parameters from original proto if type is substituted with Any (KT-15128)
#KT-15128 Fixed

(cherry picked from commit c076ad5)
2016-12-20 17:23:15 +03:00
Yan Zhulanow
4638ac40da Kapt3: Set correct compiler options when the annotation processing classpath is empty (KT-15146). Disable annotation processing in Javac task a bit earlier 2016-12-19 20:56:45 +03:00
Yan Zhulanow
f947a50088 Allopen, Noarg: Support transitive meta-annotations 2016-12-19 16:25:29 +03:00
Yan Zhulanow
34617246bb Allopen, minor: Add test for anonymous object 2016-12-19 15:01:07 +03:00
Yan Zhulanow
be63e9b754 Update changelog for 1.0.6 2016-12-16 17:57:38 +03:00
Alexander Udalov
f8fc7e94ac Report JVM runtime version inconsistency as errors instead of warnings 2016-12-16 16:15:56 +03:00
Mikhael Bogdanov
57f1751aec Fix for KT-14774: Incorrect inner class modifier generated for sealed inner classes
#KT-14774 Fixed

(cherry picked from commit 004ff86)
2016-12-16 11:24:11 +01:00
Alexander Udalov
20495c4ed5 Fix kotlinFunction for inline reified methods in reflection
Inline functions with reified type parameters are generated as private (see
AsmUtil.specialCaseVisibility), so we should treat them as "declared" in
reflection to look them up via getDeclaredMethod, not getMethod

 #KT-14721 Fixed

(cherry picked from commit 49de52e7ef)
2016-12-16 13:15:50 +03:00
Alexander Udalov
c540f24f83 Minor, move isInlineOnlyOrReified to module descriptors
(cherry picked from commit 3a0100f604)
2016-12-16 13:14:32 +03:00
Yan Zhulanow
3c0287bbec Move Maven subplugin test to kotlin-maven-plugin-test module 2016-12-15 18:35:11 +03:00
Nikolay Krasko
a734081d42 Do indent adjustment on the fly only for the first element in the line (KT-15123)
Don't interfere spacing for dot in range operator.

 #KT-15123 Fixed

(cherry picked from commit d0d583e8ee)
2016-12-15 14:41:30 +03:00
Nikolay Krasko
e95fd8515f Remove the code for idea 144
(cherry picked from commit e359b9b6de)
2016-12-15 14:41:28 +03:00
Nikolay Krasko
17f110d43b Make sdk info and library info difference more clear in debugger
(cherry picked from commit 88b3d9ff3f)
2016-12-15 14:41:27 +03:00
Alexander Udalov
5f5f45c5d6 Fix compilation 2016-12-15 13:18:04 +03:00
Alexander Udalov
a8682b3ac2 Run Make without error check before "Generate Tests"
This is needed to simplify merge conflict resolution in case when only
generated tests have conflicts
2016-12-15 11:52:51 +03:00
Alexander Udalov
8ce55deed6 Treat absence of version in SinceKotlinInfo as infinite version
This may be needed in the future to make some declarations erroneous for all
versions of compilers
2016-12-15 11:52:50 +03:00
Alexander Udalov
1ed44c22d5 Support SinceKotlinInfo for deserialized classes 2016-12-15 11:52:49 +03:00
Alexander Udalov
b2fc9abf09 Check language version for deprecation via SinceKotlinInfo 2016-12-15 11:52:49 +03:00
Alexander Udalov
ee02bc9a01 Serialize SinceKotlinInfo and SinceKotlinInfoTable 2016-12-15 11:52:48 +03:00
Alexander Udalov
739651eef3 Introduce SinceKotlinInfo, load from serialized metadata
This is a way for future compilers to cause previous compilers to report
diagnostics on usages of some declarations. Diagnostic can have a message
(and/or error code), level (error, warning, or completely hide the declaration
from the resolution), and Kotlin version, since which the diagnostic should no
longer be reported
2016-12-15 11:52:47 +03:00
Alexander Udalov
8afa2bb314 Collect all deprecations, do not stop on the first found one
#KT-15245 In Progress
2016-12-15 11:48:24 +03:00
Alexander Udalov
e2e87dcca0 Minor refactoring in deprecationUtil.kt
Split getDeclaredDeprecatedAnnotation into two methods for clarity
2016-12-15 11:48:24 +03:00
Alexander Udalov
8f936b370e Refactor getDeprecation() -> getDeprecations()
In subsequent commits, another kind of deprecation is introduced which should
be reported alongside with deprecation by the `@Deprecated` annotation
2016-12-15 11:48:24 +03:00
Yan Zhulanow
69dddf1769 Minor: Fix Android Extensions IDE tests (enable synthetic package fragment provider in tests) 2016-12-15 02:37:35 +03:00
Yan Zhulanow
f389cf0bdd Get rid of AS1.5/AS2.0 reflection magic in NewKotlinActivityAction (EA-92846) 2016-12-14 21:19:52 +03:00
Yan Zhulanow
bedee38a8c Android Extensions: Enable IDE plugin only if it is enabled in the build.gradle file (KT-12741) 2016-12-14 21:19:51 +03:00
Yan Zhulanow
9b7e3de3d1 Minor: Move all Android Extensions-related classes to org.jetbrains.kotlin.androidExtensions 2016-12-14 21:19:50 +03:00
Yan Zhulanow
73eafe100a Remove Android Extensions JPS plugin (KT-14067) 2016-12-14 21:15:03 +03:00
Yan Zhulanow
ec85b1c48a Kapt3: Set javac codepage to UTF-8 2016-12-14 20:49:30 +03:00
Yan Zhulanow
23460946d0 Android Gradle plugin: Fix compatibility with Android Gradle Plugin 2.3 2016-12-14 20:49:29 +03:00
Nikolay Krasko
d23b3ce1ab Allow empty single-line bodies in property accessors
(cherry picked from commit 2bb48fc)
2016-12-14 13:48:50 +03:00
Nikolay Krasko
836f6fa23d Do not force new line in body for empty functions and function expressions (KT-10828)
#KT-10828 Fixed

(cherry picked from commit 2841931ffa)
2016-12-14 13:48:48 +03:00
Yan Zhulanow
ba97e8bc5d Update changelog for 1.0.6 2016-12-13 22:18:10 +03:00
Alexander Udalov
5c1584054c Minor, capitalize entry names in manifest 2016-12-13 17:40:08 +03:00
Alexander Udalov
a898eaf655 Fix compilation for 1.0.* 2016-12-13 17:39:26 +03:00
Alexander Udalov
acf7b46286 Introduce '-Xskip-runtime-version-check' command line option 2016-12-13 17:39:25 +03:00
Alexander Udalov
36d7d8d5a6 Decrease number of reported runtime version diagnostics
If there's at least one runtime newer than the compiler, do not report that
it's inconsistent with the correct runtime
2016-12-13 17:39:24 +03:00
Alexander Udalov
e651f1ff96 Improve diagnostics for runtime versions consistency checker
- report the diagnostic on the actual problematic file
- output the list of all runtime jars if min version != max version
2016-12-13 17:39:23 +03:00
Alexander Udalov
2fb008e64d Use MavenComparableVersion in runtime version consistency checker
LanguageVersion is an enum consisting of the current and all previous versions
only, so with it we won't be able to detect the language version of a future
runtime
2016-12-13 17:39:22 +03:00
Dmitry Petrov
5dd147fa60 Check classpath version consistency.
Add 'Kotlin-version' attribute to kotlin-runtime and kotlin-reflect JARs.
2016-12-13 17:39:22 +03:00
Dmitry Jemerov
2e7ad8fd0e Don't offer updates for @snapshot@ plugin version
(cherry picked from commit e7cf646)
2016-12-13 14:42:04 +01:00
Dmitry Jemerov
e580aac6fc Check for plugin update before allowing to submit exception
(cherry picked from commit 0cfc4db)
2016-12-13 14:41:57 +01:00
Valentin Kipyatkov
19e77b8361 KT-14732 Slow typing, copy-pasting, highlighting in Kotlin files due to auto-import suggestion calculation in EDT
#KT-14732 Fixed

(cherry picked from commit 0ef5f66)
2016-12-13 13:59:18 +01:00
Dmitry Jemerov
a893460ce5 Fix expected test data 2016-12-13 13:57:09 +01:00
Simon Ogorodnik
6dca2c43a5 Fix for EA-89556 - (from J2K) ROME: DocumentImpl.replaceString
(cherry picked from commit 7a4b6a1)
2016-12-12 21:52:58 +03:00
Simon Ogorodnik
be45161524 Fix for KT-14885 J2K on paste adds duplicated imports
(cherry picked from commit fb5398c)
2016-12-12 21:52:58 +03:00
Dmitry Jemerov
aab68bec5b Add element validity check to KotlinRunConfigurationProducer.getStartClassFqName() (EA-86393 - PIEAE: PsiFileImpl.getText)
(cherry picked from commit b4dd54f)
2016-12-12 18:07:04 +01:00
Dmitry Jemerov
df6f5532cd Highlight code fragments only when they have a context (part of EA-84233 - assert: GetModuleInfoKt$getModuleInfo$.invoke) 2016-12-12 18:07:04 +01:00
Dmitry Jemerov
06526f003b Implement supertype access methods in KtLightClassForFacade without delegate access (EA-92490 - ISE: KtLightClassForFacade.getClsDelegate)
(cherry picked from commit d6cd148)
2016-12-12 18:07:04 +01:00
Dmitry Jemerov
acf20cfbb4 Better diagnostics for "no resolver for module descriptor" situation (EA-72838 - ISE: EmptyResolverForProject.resolverForModuleDescriptor)
(cherry picked from commit 48513c7)
2016-12-12 18:07:04 +01:00
Dmitry Jemerov
5d6f07a669 Avoid committing document in KDoc beforeCharTyped handler (EA-88521 - assert: PsiDocumentManagerBase.commitDocument)
(cherry picked from commit bd0aa5a)
2016-12-12 18:07:04 +01:00
Dmitry Jemerov
6d4ddfc2b5 Avoid NPE while calculating assertion message (EA-92384 - NPE: KtElementImpl.getContainingKtFile)
(cherry picked from commit 7f02c67)
2016-12-12 18:07:04 +01:00
Dmitry Jemerov
12b04e6407 Remove unnecessary uses of getContainingKtFile() (EA-83360 - CCE: KtElementImplStub.getContainingKtFile)
(cherry picked from commit d5e90b4)
2016-12-12 18:07:04 +01:00
Ilya Gorbunov
92904822ab Add non-compiled sources to runtime before packaging sources jar.
(cherry picked from commit 2e7456c)
2016-12-12 19:46:19 +03:00
Dmitry Jemerov
06c18c5287 Remove unnecessary cyclic dependency between KtStubElementTypes and KtNodeTypes
#KT-15074 Fixed

(cherry picked from commit 13b8494)
2016-12-12 16:27:48 +01:00
Dmitry Jemerov
d2b97bf4fa Don't try to calculate icon for invalid PSI elements
#KT-13443 Fixed

(cherry picked from commit a7bd910)
2016-12-12 16:25:42 +01:00
Alexey Sedunov
a103d9d96a Minor: Fix compilation after rebase 2016-12-12 14:00:19 +03:00
Alexey Sedunov
25eb7cdcde Intentions: Convert function type receiver to parameter
#KT-14246 Fixed
(cherry picked from commit e9d29c0)
2016-12-12 14:00:18 +03:00
Alexey Sedunov
d9b0bf416b Intentions: Convert function type parameter to receiver
#KT-14246 In Progress
(cherry picked from commit c5907c4)
2016-12-12 14:00:17 +03:00
Alexey Sedunov
2a4e61438b Introduce Variable: Allow extraction to class body/file
(cherry picked from commit dadab9c)
2016-12-12 14:00:15 +03:00
Alexey Sedunov
764b6fb587 Create from Usage: Support adding type parameters to the referenced type
#KT-11760 Fixed
(cherry picked from commit b6d4bb4)
2016-12-12 14:00:14 +03:00
Alexey Sedunov
42ccf1163d Intentions: Implement "Add names to call arguments" intention
#KT-14729 Fixed
(cherry picked from commit c773afd)
2016-12-12 14:00:13 +03:00
Alexey Sedunov
fc650bb0a6 Create from Usage: Support generation of abstract members for superclasses. Skip non-abstract superclasses when generating abstract member
#KT-14019 Fixed
(cherry picked from commit 2a594a5)
2016-12-12 14:00:12 +03:00
Alexey Sedunov
a5897e29c8 Extraction Engine: Do not wrap companion member references inside of the with call if it's disabled in extraction options
#KT-13781 Fixed
(cherry picked from commit 25cebba)
2016-12-12 14:00:11 +03:00
Alexey Sedunov
795ce27573 Move: Fix callable reference processing when moving to another package
#KT-14197 Fixed
(cherry picked from commit 61210d6)
2016-12-12 14:00:10 +03:00
Alexey Sedunov
51afef1733 Unused Symbol Inspection: Fix exception on deleting unused declaration in IDEA 2016.3
(cherry picked from commit 313d838)
2016-12-12 14:00:09 +03:00
Alexey Sedunov
f8513abfa1 Rename: Fix exceptions on moving file with facade class to another package
#KT-14325 Fixed
(cherry picked from commit 1bde0e1)
2016-12-12 14:00:08 +03:00
Alexey Sedunov
f629340b29 Safe Delete: Fix exception on deleting Java class used in Kotlin import directive(s)
#KT-14596 Fixed
(cherry picked from commit cedbac6)
2016-12-12 14:00:07 +03:00
Alexey Sedunov
195cc9fd7a Initialize with Constructor Parameter Intention: Fix IDE freeze on properties in generic class
#KT-14459 Fixed
(cherry picked from commit 465138c)
2016-12-12 14:00:06 +03:00
Alexey Sedunov
756f27d5e5 Rename: Do not report redeclaration conflict for private top-level declarations located in different files
#KT-14361 Fixed
(cherry picked from commit b29c704)
2016-12-12 14:00:05 +03:00
Alexey Sedunov
0d25409d62 Project Settings: Expose JVM target setting in IntelliJ IDEA plugin compiler configuration UI
#KT-13811 Fixed
(cherry picked from commit 21c6e97)
2016-12-12 14:00:04 +03:00
Alexey Sedunov
4153fed2da Rename: Fix renaming of .kts file to .kt and vice versa
#KT-14814 Fixed
(cherry picked from commit 740f769)
2016-12-12 14:00:03 +03:00
Alexey Sedunov
93d989e792 Extract Interface: Fix NPE on dialog opening
#KT-14854 Fixed
(cherry picked from commit ddb5308)
2016-12-12 14:00:02 +03:00
Alexey Sedunov
c8f6e56265 Move: Fix EA-1266148
(cherry picked from commit 9967d4c)
2016-12-12 14:00:01 +03:00
Alexander Udalov
95b4b6e7d9 Fix test on IS_PRE_RELEASE
Use DeserializedDescriptorResolver.IS_PRE_RELEASE instead of
KotlinCompilerVersion.IS_PRE_RELEASE because the former is updated correctly in
tests
2016-12-12 11:28:27 +03:00
Ilya Gorbunov
15490ebad6 Exclude builtins module from idea project build
(cherry picked from commit 9e238d26f2)
2016-12-12 11:05:50 +03:00
Alexander Udalov
8dba4f8fe9 Set isPreRelease = false for 1.0.6
1.0.* is a stable branch
2016-12-10 10:10:09 +02:00
Yan Zhulanow
e379d78e6b Kapt3: Add property annotation holder methods to Java stubs (KT-13767) 2016-12-09 19:38:31 +03:00
Yan Zhulanow
94518b686e Kapt3: Allow to use ':' in annotation processor option value (KT-15139) 2016-12-09 19:38:29 +03:00
Yan Zhulanow
21c7bcb8a0 Kapt3: Make 'kaptTest' configuration extend 'kapt' (KT-10190) 2016-12-09 19:38:28 +03:00
Yan Zhulanow
258ec264c6 Kapt3: Fix '$' in function generic signatures (KT-15148) 2016-12-09 19:38:26 +03:00
Yan Zhulanow
ec9c7e0f4e Kapt3: Use annotation processor options from variant data options. This fixes DataBinding on Android Gradle plugin 2.3 (KT-14816) 2016-12-09 19:38:25 +03:00
Yan Zhulanow
50bca3e83c Kapt3, Minor: Flush logs before throwing parse error exception 2016-12-09 19:38:24 +03:00
shiraji
5caf3d551d KT-15142 Remove redundant calls of the conversion method wrongly shown for Any?.toString
#KT-15142 Fixed

(cherry picked from commit 44ca451)
2016-12-09 14:50:30 +03:00
Alexander Udalov
68ad51056a Remove type aliases from newly added test data 2016-12-09 02:00:24 +03:00
Alexander Udalov
271da44837 Suggest to use "-Xskip-metadata-version-check" on incompatible classes in classpath 2016-12-09 02:00:24 +03:00
Alexander Udalov
c72d349c9f Do not fail when deserializing incompatible metadata
Catch all exceptions when deserializing metadata with an incompatible version
to prevent the compiler from failing on discovering incompatible classes on the
classpath. Note that this is not the perfect solution: any invariant may be
broken in the incompatible metadata and it may result in a later exception
2016-12-09 02:00:24 +03:00
Alexander Udalov
f115359de9 Remove old mechanism of metadata version error reporting 2016-12-09 02:00:23 +03:00
Alexander Udalov
6e0122b978 Report incompatible metadata version error correctly
Similarly to pre-release classes, load metadata for the class anyway and allow
the resolution to select it as the result and prohibit its usage in the end
with the special diagnostic reported in MissingDependencyClassChecker
2016-12-09 02:00:23 +03:00
Alexander Udalov
9c8986da4b Use "-Xskip-metadata-version-check" to load pre-release classes 2016-12-09 02:00:22 +03:00
Alexander Udalov
328c0be5af Report error on pre-release top level members 2016-12-09 02:00:22 +03:00
Alexander Udalov
75d26dcb7e Add classifier usage checker for missing dependency classes
This has no effect for the original use case of mock class descriptors
(unresolved classes used in libraries), but is necessary for pre-release
classes in case the compiler is a release, because such classes end up in scope
and can be the result of the resolution
2016-12-09 02:00:22 +03:00
Alexander Udalov
39b85188ee Write "pre-release" flag to class files, do not allow usages in release 2016-12-09 02:00:21 +03:00
Alexander Udalov
271fc1a6b4 Add KotlinVersion.IS_PRE_RELEASE and a flag to kotlin/Metadata 2016-12-09 02:00:21 +03:00
shiraji
cf1491ad8e KT-15030 Remove redundant calls of conversion methods: false positive for 'toList()'
#KT-15030 Fixed

(cherry picked from commit 2815b5e)
2016-12-08 18:48:31 +03:00
Mikhail Glukhikh
73b150094c "Change return type for enclosing fix" now handles TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH correctly #KT-14063 Fixed
(cherry picked from commit 268702e)
2016-12-08 18:47:04 +03:00
Mikhail Glukhikh
c7f2eccdcd "Change return type fix" now handles data class properties correctly #KT-15028 Fixed
(cherry picked from commit 2ac8e5b)
2016-12-08 18:46:59 +03:00
Mikhail Glukhikh
b2d2e05f59 Convert reference to lambda: handle special case of extension functional type #KT-14985 Fixed
(cherry picked from commit 0994d46)
2016-12-08 18:46:47 +03:00
Mikhail Glukhikh
2d8a6f6529 Convert reference to lambda: correct handling of static method references #KT-14982 Fixed
(cherry picked from commit e904e56 - a pair of unnecessary tests)
2016-12-08 18:46:04 +03:00
Mikhail Glukhikh
baf2b9fe47 Simplify boolean == true / false is no longer applicable on flexible boolean #KT-15087 Fixed
(cherry picked from commit ea8548c)
2016-12-08 17:58:38 +03:00
Mikhail Glukhikh
64e6ce608b Infrastructure test for intention descriptions availability added
(cherry picked from commit 4b86c4a)
2016-12-08 17:58:27 +03:00
Nikolay Krasko
42e3028736 Wrap options for constructor parameters
#KT-12176 In Progress

(cherry picked from commit 43948a0170)
2016-12-08 15:22:44 +03:00
Nikolay Krasko
ec63ee3cab Indent () in if, when, while and do-while with continuation indent (KT-5897)
#KT-5897 Fixed

(cherry picked from commit 300601da54)
2016-12-08 15:22:44 +03:00
Nikolay Krasko
28fbbc6f3d Refactoring: use when instead of if
(cherry picked from commit 211cae2ad2)
2016-12-08 15:22:44 +03:00
Nikolay Krasko
b7ea9b80ca Refactoring: move runSynchronouslyWithProgress to ProgressUtil
(cherry picked from commit 06172e7)
2016-12-08 15:22:44 +03:00
Nikolay Krasko
10b9f1ed91 Use lazy resolve for counting list of inlined function during step out (KT-14892)
#KT-14892 Fixed

(cherry picked from commit fd8d616)
2016-12-08 15:22:44 +03:00
Nikolay Krasko
0b1e222822 Run full resolve in debugger with write action priority (KT-14602)
#KT-14602 Fixed

(cherry picked from commit fc5b493)
2016-12-08 15:22:44 +03:00
Nikolay Krasko
669995ed49 Remove repeating contexts in CompositeBindingContext creation
(cherry picked from commit 45532e480f)
2016-12-08 15:22:44 +03:00
Nikolay Krasko
d24ea4fc29 Avoid requesting line number for bad offset (EA-87678)
Example of stack trace:
java.lang.IndexOutOfBoundsException: Wrong offset: 14847. Should be in range: [0, 14846]
	at com.intellij.openapi.editor.impl.LineSet.findLineIndex(LineSet.java:141)
	at com.intellij.openapi.editor.impl.DocumentImpl.getLineNumber(DocumentImpl.java:919)
	at org.jetbrains.kotlin.idea.refactoring.KotlinRefactoringUtilKt.getLineCount(kotlinRefactoringUtil.kt:344)
	at org.jetbrains.kotlin.idea.debugger.KotlinPositionManager.getSourcePosition(KotlinPositionManager.kt:125)

(cherry picked from commit 76916b0877)
2016-12-08 15:22:44 +03:00
Nikolay Krasko
0eb3433a99 Don't resolve reference if result is useless
(cherry picked from commit ee1ce184f9)
2016-12-08 15:22:44 +03:00
Alexander Udalov
179d2c6ad7 Fix compilation of module generators
(cherry picked from commit 65e01f2fdb)
2016-12-08 14:30:55 +03:00
Alexander Udalov
19508a8261 Fix compilation of module android-tests
(cherry picked from commit 751f546a70)
2016-12-08 14:27:20 +03:00
Alexander Udalov
fb163f2495 Minor refactoring in frontend/resolution
Fix typos, formatting, diagnostic message

(cherry picked from commit d5c75ae764)
2016-12-08 13:41:53 +03:00
Alexander Udalov
497cb1b41d Deduplicate code in JavaClassDataFinder
(cherry picked from commit 921694e13a)
2016-12-08 13:41:46 +03:00
Alexander Udalov
446d0beb0d Minor, introduce DeserializedContainerSource
(cherry picked from commit 41f2048f96)
2016-12-08 13:41:38 +03:00
Alexander Udalov
c8e105ed55 Move "missing dependency class" diagnostic from JVM to common front-end
(cherry picked from commit 228d0a1c43)
2016-12-08 13:40:42 +03:00
Alexander Udalov
533e1f5536 Add expectedVersion to IncompatibleVersionErrorData, move to deserialization
(cherry picked from commit 3b18531b20)
2016-12-08 13:40:09 +03:00
Alexander Udalov
b5238ddf81 Rename KotlinVersion->KotlinCompilerVersion, move to module util.runtime
Rename to avoid confusion with the recently added kotlin.KotlinVersion

(cherry picked from commit 414daef001)
2016-12-08 13:39:58 +03:00
Vyacheslav Gerasimov
e830e8b55f Fixed several bugs in Android lint ApiDetector (KT-15002, KT-12024, KT-14737, KT-14825, KT-12023, KT-15018)
Merged IntelliJApiDetector to ApiDetector

#KT-15002 Fixed
#KT-12024 Fixed
#KT-14737 Fixed
#KT-14825 Fixed
#KT-12023 Fixed
#KT-15018 Fixed
2016-12-07 17:50:17 +03:00
Vyacheslav Gerasimov
f591b4958e Fixed bugs in Kotlin Android Lint CleanupDetector
#KT-14780 Fixed
#KT-14677 Fixed
2016-12-07 17:50:06 +03:00
Vyacheslav Gerasimov
9699ca5175 Invoke rename handler with editor if possible in IllegalIdentifierInspection.RenameIdentifierFix
#KT-14760 Fixed
#KT-11646 Fixed
2016-12-07 17:49:54 +03:00
Vyacheslav Gerasimov
36b3708e23 Uast 1.0.6 2016-12-07 17:49:42 +03:00
Yan Zhulanow
bf596c494e Check if modality is refined in "Redundant modifier" inspection 2016-12-06 21:47:26 +03:00
Yan Zhulanow
6ecfda886d Minor: Add allopen-ide and allopen-noarg to "idea" module test classpath 2016-12-06 21:47:25 +03:00
Yan Zhulanow
e3a05e8609 NoArg: Add Maven plugin 2016-12-06 21:47:24 +03:00
Yan Zhulanow
90ba8861d6 NoArg: Add IDE integration 2016-12-06 21:47:23 +03:00
Yan Zhulanow
c98efdd32b Noarg: Add a kotlin-noarg Gradle plugin 2016-12-06 21:34:47 +03:00
Yan Zhulanow
ec9bdfc0f3 NoArg: Add compiler plugin 2016-12-06 21:34:46 +03:00
Yan Zhulanow
13d8cb3e96 AllOpen: Add IDE integration 2016-12-06 21:34:45 +03:00
Yan Zhulanow
0dafa4c502 Allopen: Add Maven plugin for all-open
(cherry picked from commit f0f0c69)
2016-12-06 21:34:43 +03:00
Sergey Mashkov
95d1b8b277 Resolve dependency jars
(cherry picked from commit 7cc9447)

(cherry picked from commit 41a9270)
2016-12-06 21:34:42 +03:00
Sergey Mashkov
a6a6aef352 Add integration test for Kotlin compiler plugin for Maven
(cherry picked from commit 1e146a4)

(cherry picked from commit b50a336)
2016-12-06 21:34:41 +03:00
Sergey Mashkov
df938cf67d Initial Kotlin plugin support in Maven
(cherry picked from commit 46a7263)

(cherry picked from commit c58ac8f)
2016-12-06 21:34:40 +03:00
Yan Zhulanow
2bf28d90c9 Allopen: Add allopen Gradle subplugin
(cherry picked from commit 2287e80)
2016-12-06 21:34:39 +03:00
Yan Zhulanow
e98b8a8c92 Allopen: Handle allopen annotations on classes (KT-12149)
(cherry picked from commit e82cbd7)
2016-12-06 21:34:37 +03:00
Yan Zhulanow
ff6eafceee Allopen: Add allopen compiler plugin 2016-12-06 21:34:36 +03:00
Sergey Mashkov
97b04372d6 KT-15120 Gradle JS test compile task doesn't pick up production code 2016-12-06 16:57:34 +03:00
Sergey Mashkov
2bd462134f IDL2K: properly handle clash or val and var attributes 2016-12-06 15:01:25 +03:00
Mikhail Glukhikh
7358c4e7be Call method references search in UnusedSymbolInspection.hasReferences to fix secondary constructor search
Makes #KT-12500 Fixed
Makes #KT-12501 Fixed

(cherry picked from commit 299f477)
2016-12-06 13:46:58 +03:00
Mikhail Glukhikh
9503c1a7d4 Cleanup: remove empty primary constructor applied
(cherry picked from commit 729a3a3)
2016-12-06 13:46:16 +03:00
Mikhail Glukhikh
af785a5320 Cleanup: remove empty constructor body applied
(cherry picked from commit f71ea88)
2016-12-06 13:46:00 +03:00
Mikhail Glukhikh
689cd880fb Cleanup: redundant if statement applied
(cherry picked from commit d5638df)
2016-12-06 13:45:46 +03:00
Mikhail Glukhikh
1c749d5d40 Cleanup: join declaration & assignment applied
(cherry picked from commit 96ae881)
2016-12-06 13:45:29 +03:00
Nikolay Krasko
75600fb73a Avoid loading psi for compiled kotlin file if it's possible to get declaration by name from stubs
(cherry picked from commit 726471d98e)
2016-12-05 19:01:01 +03:00
Nikolay Krasko
8d4fca1357 Allow to search builtins descriptors in stubs by name 2016-12-05 16:19:51 +03:00
Nikolay Krasko
9b8f8ae083 Don't enable search stub declaration by name if file doesn't contain descriptor key
This might cause irrelevant declarations found with the same name.
2016-12-05 16:19:49 +03:00
Nikolay Krasko
3f4535fef2 Try to avoid loading ast for decompiled files (KT-14804)
#KT-14804 Fixed
2016-12-05 16:19:47 +03:00
Yan Zhulanow
ba48dda523 Minor: Fix tests (kapt3-related) 2016-12-02 22:58:58 +03:00
Yan Zhulanow
8da309fdb2 Update ChangeLog for 1.0.6 2016-12-02 21:58:05 +03:00
Mikhail Glukhikh
2a065ff2d7 Plugin fix: intention description ConvertFinallyToUseCallIntention --> ConvertTryFinallyToUseCallIntention
(cherry picked from commit 0e9b024)
2016-12-02 14:06:35 +03:00
Mikhail Glukhikh
cd2e128f33 KT-12100 (1.0.x only): safe calls in finally are forbidden (use has nullable receiver in 1.1 but not-null in 1.0.x) 2016-12-02 13:01:28 +03:00
Mikhail Glukhikh
31ece45a43 KT-12100 convert try / finally to use: select use parameter after application
(cherry picked from commit 4af9b27)
2016-12-02 09:45:05 +03:00
Mikhail Glukhikh
4ddd083c1d KT-12100 convert try / finally to use: report intention only at try {
(cherry picked from commit 9ea3268)
2016-12-02 09:44:50 +03:00
Mikhail Glukhikh
43811f6eee KT-12100 convert try / finally to use: safe close() is allowed in finally + correct new lines
(cherry picked from commit 0cc52e2)
2016-12-02 09:44:31 +03:00
Mikhail Glukhikh
093ab7bc3b KT-12100 convert try / finally to use: 'this' receiver is now left as is
(cherry picked from commit 0ac4430)
2016-12-02 09:44:15 +03:00
Mikhail Glukhikh
19899bb047 KT-12100 convert try / finally to use: 'this' cases, implementation via resolved call
(cherry picked from commit f513514)
2016-12-02 09:43:57 +03:00
Mikhail Glukhikh
27181ac2f6 KT-12100 related: convert try / finally to use() call inspection introduced
(cherry picked from commit 468e975)
2016-12-02 09:43:08 +03:00
Mikhail Glukhikh
e36e105348 "Convert try / finally to .use { } call intention introduced" #KT-12100 Fixed
(cherry picked from commit 59b2608)
2016-12-02 09:42:44 +03:00
Anton Bannykh
c9c578613e Fix codegen tests 2016-12-01 20:00:12 +03:00
Yan Zhulanow
329c6f60f1 Kapt3: Fix signature clash (return type is different) for non-generic methods 2016-12-01 16:33:10 +03:00
Yan Zhulanow
5f928895c2 Kapt3: Clear javac's boot classpath (KT-15001) 2016-12-01 16:33:09 +03:00
Yan Zhulanow
a854e27d4f Kapt3: Separate classpaths for compilation and for annotation processing 2016-12-01 16:33:08 +03:00
Yan Zhulanow
ae001ed048 Kapt3: Fix parameter names in JvmOverloads-generated methods (KT-15024) 2016-12-01 16:33:07 +03:00
Yan Zhulanow
84f6cbe822 Kapt3: Fix "Parameter names are clashing in inner class constructor" (KT-14998) 2016-12-01 16:33:06 +03:00
Yan Zhulanow
c9786122b8 Kapt3: Ensure that field types and method return types are not anonymous (KT-14997) 2016-12-01 16:33:05 +03:00
Yan Zhulanow
3953e81299 Kapt3: Allow function overloads based on return type (KT-14996). Fix wrong facade class name inside the default package 2016-12-01 16:33:04 +03:00
Nikolay Krasko
17b7499b11 Filter also by kind to avoid getting enum descriptors from compiled code 2016-12-01 15:46:31 +03:00
Ilya Chernikov
18916b8f66 Generalize error processing on daemon connection, attempt to fix #EA-82064 again 2016-11-30 13:34:17 +01:00
Nikolay Krasko
bab26d4841 Check no runtime markers are misused in quick fix tests 2016-11-30 15:20:22 +03:00
Nikolay Krasko
61730ee641 Auto-import does not suggest enum constant (KT-14100)
#KT-14100 Fixed
2016-11-30 15:20:20 +03:00
Natalia Ukhorskaya
ad53f49b4e Debugger: ability to set breakpoint to lambda in return statement (KT-14615)
#KT-14615 Fixed

(cherry picked from commit 01d4ec4187)
2016-11-30 14:02:25 +03:00
Nikolay Krasko
88dea7dfdf Navigation to inline functions doesn't work for thread dump captured using "Get thread dump" (KT-14916)
#KT-14916 Fixed

(cherry picked from commit 730e561177)
2016-11-30 14:02:23 +03:00
Simon Ogorodnik
e42944c56b Fix compilation 2016-11-29 17:06:03 +03:00
Simon Ogorodnik
ffbe323255 Fix for KT-10665, now only signature + deprecation info shown in quick navigation tooltip
Fix tests, to use full documentation mode instead of quick navigate

(cherry picked from commit e4a383f)
2016-11-29 14:18:47 +03:00
Simon Ogorodnik
d2ae5f49c5 Fix for KT-13699 Quick documentation doesn't show supertype docs for overridden Java
(cherry picked from commit 1c75c02)
2016-11-29 14:18:42 +03:00
Simon Ogorodnik
7ff30d71a1 Added tests to prove, that KT-8547 fixed
(cherry picked from commit b93c37f)
2016-11-29 14:18:38 +03:00
Simon Ogorodnik
afe73a7938 Fix for KT-11032 Samples not rendered in Quick Doc
Now samples included as code blocks into quick doc

(cherry picked from commit 2824c8d)
2016-11-29 14:18:34 +03:00
Simon Ogorodnik
d46af79513 Fix for KT-13197 Markdown indented code blocks are not recognized by quick doc
Expanded code blocks lexer test, to cover indented code blocks

(cherry picked from commit 94770f8)
2016-11-29 14:18:30 +03:00
Simon Ogorodnik
a532b21834 Fix for KT-7995 Quick doc should show deprecation info and ReplaceWith
(cherry picked from commit 3376dbb)
2016-11-29 14:16:59 +03:00
Simon Ogorodnik
7c2e28ff2e Completion for fqNames in KDoc links
Tests, also proved that KT-14432 are fixed
Added completion and tests for extension functions.

(cherry picked from commit 1a211ee)
2016-11-29 14:16:55 +03:00
Simon Ogorodnik
2eec2c8095 Fix resolving of packages in FQN kdoc links
Assume link [pack.SomeType], pack no more will be marked as unresolved reference

(cherry picked from commit 62077da)
2016-11-29 14:16:13 +03:00
Simon Ogorodnik
379f3bc55d Feature KT-7739 Type names in Quick Documentation should be clickable and navigate to their documentation
Filter out 'boring builtin classifiers' (kotlin.Int for ex) from signature hyperlinks

(cherry picked from commit c93e47f)
2016-11-29 14:16:09 +03:00
Simon Ogorodnik
39f318682c Fix for KT-13400, KT-13389 Resolving FQN in quick doc
Problem related to not complete fix in KT-10398

(cherry picked from commit 68d4a7a)
2016-11-29 14:16:01 +03:00
Simon Ogorodnik
fdc45daeaa Fix for KT-13038 Quick doc should escape HTML entities in code blocks
(cherry picked from commit b007d9b)
2016-11-29 14:15:55 +03:00
Mikhail Glukhikh
ac46f02915 KT-12633 related test fix
(cherry picked from commit 904ea33)
2016-11-28 17:36:02 +03:00
Kirill Rakhman
1fccf8f539 Intention "Specify type explicitly" should offer all bounds for platform types #KT-12633 Fixed
(cherry picked from commit 68df8c5)
2016-11-28 11:40:32 +03:00
shiraji
904060d6a5 KT-14890 Fix the problem with RemoveEmptyClassBodyIntention for nested class followed by a secondary constructor
#KT-14890 Fixed

(cherry picked from commit ba92dcb)
2016-11-28 11:11:27 +03:00
Natalia Ukhorskaya
126475e4ff Debugger: cannot call member extension in an object in Evaluate Expression
#KT-14822 Fixed
2016-11-26 00:41:11 +03:00
Dmitry Jemerov
6fc4c56c38 add Gradle wrapper to project
(cherry picked from commit 3d3c3b9)

(cherry picked from commit 944766f)
2016-11-25 19:52:34 +03:00
Ilya Chernikov
902b877119 Sort plugin artifacts before upload to publish AS ones after IDEA ones 2016-11-25 19:08:44 +03:00
Nikolay Krasko
b524193ea9 Make breakpoints work inside nameless function bodies in inline calls
(cherry picked from commit b007306740)
2016-11-25 18:23:50 +03:00
Nikolay Krasko
7d57abefa1 Fix breakpoints in secondary constructors
(cherry picked from commit 89ac89f0c6)
2016-11-25 18:23:48 +03:00
Yan Zhulanow
35c8c90400 Kapt3: Kapt3 fails on several top-level functions in one package (KT-14991) 2016-11-25 16:47:08 +03:00
Mikhail Glukhikh
2085365d9d Simplify boolean with constants intention supports now == (!=) true (false) cases #KT-13777 Fixed
(cherry picked from commit 2bb81e6)
2016-11-25 12:55:56 +03:00
Yan Zhulanow
27fffb728a 1.0.6 Changelog: fix wording, resort issues 2016-11-24 18:48:09 +03:00
Mikhail Glukhikh
a1d0916aca Changelog: 1.0.6 minor update 2016-11-24 17:57:42 +03:00
Mikhail Glukhikh
d8b4c0e0e2 Changelog: deleted feature from 1.1 only 2016-11-24 17:53:28 +03:00
Yan Zhulanow
91c872bed2 Update changelog for 1.0.6 2016-11-24 17:37:17 +03:00
Nikolay Krasko
4e43b69cd5 Filter out variables with null values (EA-87276)
(cherry picked from commit efeccd0929)
2016-11-24 17:31:12 +03:00
Yan Zhulanow
12e6ceb331 Kapt3: Close annotation processing ClassLoader (KT-9440) 2016-11-24 16:25:07 +03:00
Mikhail Glukhikh
61fe6076fb KT-13393 related: convert reference to lambda inspection (off by default) introduced
(cherry picked from commit 5c09e1c)
2016-11-24 16:06:51 +03:00
Mikhail Glukhikh
9d777fa001 Minor: rename in KtPsiFactory
(cherry picked from commit 9c75324)
2016-11-24 16:06:46 +03:00
Mikhail Glukhikh
c7834cf3f4 Convert reference to lambda intention introduced #KT-13393 Fixed
(cherry picked from commit b111d1b) (a bit rewritten due to non-existent bound references)
2016-11-24 16:06:18 +03:00
Mikhail Glukhikh
fb1c064197 Minor: typo fixed
(cherry picked from commit 27df76b)
2016-11-24 16:06:07 +03:00
Mikhail Glukhikh
c904384773 Redundant if inspection supports now assignments and just if (...) true else false #KT-13259 Fixed
(cherry picked from commit c6997a1)
2016-11-24 16:06:02 +03:00
Mikhail Glukhikh
a9e5339676 VarianceChecker: correct handing of nested classes and their methods #KT-14733 Fixed
(cherry picked from commit 14787e3) (slightly modified)
2016-11-24 16:05:43 +03:00
Sergey Mashkov
56438c6d78 IDL2K: regenerate stubs 2016-11-24 15:10:00 +03:00
Sergey Mashkov
257ea9eeed IDL2K: consider attribute ignores (from config.kt) before merge 2016-11-24 15:10:00 +03:00
Sergey Mashkov
cdaed80991 IDL2K: render dictionaries as interfaces, always use nullable types 2016-11-24 15:10:00 +03:00
Sergey Mashkov
7568e5428b Update tests expected files 2016-11-24 15:09:59 +03:00
Sergey Mashkov
008689ba05 Upgrade example 2016-11-24 15:09:59 +03:00
Sergey Mashkov
04d428d83c IDL2K: generate declarations for partial interfaces 2016-11-24 15:09:59 +03:00
Sergey Mashkov
5fbde357c5 IDL2K: manually fix SVGUseElementShadowRoot due to error in the SVG 2 specification 2016-11-24 15:09:59 +03:00
Sergey Mashkov
5bb487c0ca IDL2K: rename trait to interface, render NoInterfaceObject as native interface 2016-11-24 15:09:59 +03:00
Sergey Mashkov
f84a84daa1 IDL2K: update downloaded IDLs 2016-11-24 15:09:59 +03:00
Sergey Mashkov
d46c9c76aa IDL2K: better logging 2016-11-24 15:09:59 +03:00
Sergey Mashkov
7daa4b480c IDL2K: better property duplicates handling, better reserved words handling 2016-11-24 15:09:59 +03:00
Sergey Mashkov
ef27b5cae4 IDL2K: map array literal 2016-11-24 15:09:59 +03:00
Sergey Mashkov
ed3f9624d8 IDL2K: remove dfn-panel class during IDL extraction 2016-11-24 15:09:59 +03:00
Sergey Mashkov
22d1824bc0 IDL2K: update download urls 2016-11-24 15:09:59 +03:00
Sergey Mashkov
30ade56e51 IDL2K: fix grammar for better generic types supprt 2016-11-24 15:09:58 +03:00
Sergey Mashkov
9ab4788fbe IDL2K: upgrade antlr 2016-11-24 15:09:58 +03:00
Alexey Andreev
bf6310fba0 JS: when possible, treat WebIDL interfaces as abstract classes, not interfaces 2016-11-24 15:09:05 +03:00
Mikhail Glukhikh
9d9f0d66d8 Revert: remove single lambda parameter fix was removed from 1.0.x branch (because UNUSED_PARAMETER is not reported for lambda parameters) 2016-11-24 13:27:17 +03:00
Dmitry Jemerov
ecf114cf7b Workaround for Android databinding issue: apply extra scope filtering to classes returned from getClassesByName() (part of EA-75803 assert: ResolverForProjectImpl.descriptorForModule)
(cherry picked from commit 7f80a1f)
2016-11-24 11:18:16 +01:00
Dmitry Jemerov
2cb6209542 Don't throw exception when resolving out-of-content-root PSI elements to descriptors (EA-92177 assert: ResolverForProjectImpl.descriptorForModule)
(cherry picked from commit 1570886)
2016-11-24 11:18:12 +01:00
Dmitry Jemerov
2298978148 Implement KtLightTypeParameter.isEquivalentTo() without referencing delegate (this is faster and more correct)
(cherry picked from commit 7637820)
2016-11-24 11:18:11 +01:00
Dmitry Jemerov
92e286776b Provide toString() for classes that extend GlobalSearchScope (to diagnose package fragment errors)
(cherry picked from commit 956e1c7)
2016-11-24 11:18:04 +01:00
Dmitry Jemerov
cbeac625a9 KtFile.getPackageFqNameByTree() never tries to access stub (EA-82168)
(cherry picked from commit 32be194)
2016-11-24 11:13:32 +01:00
Dmitry Jemerov
390d538176 Retrieve virtual file for PsiFile via FileViewProvider, which always has a non-null vFile (EA-89047 - assert: LightClassDataProvider.getRepresentativeVirtualFile)
(cherry picked from commit c56a72d)
2016-11-24 11:13:32 +01:00
Dmitry Jemerov
71c6d52a53 Include exception in report, not only log it (EA-90231 - assert: ClsJavaStubByVirtualFileCache.createStub)
(cherry picked from commit ebbbe1b)
2016-11-24 11:13:32 +01:00
Dmitry Jemerov
3354e45a51 Don't store PsiElement in LocalQuickFix instance (EA-90970 - PIEAE: PsiInvalidElementAccessException.createByNode)
(cherry picked from commit 58d725d)
2016-11-24 11:13:32 +01:00
Dmitry Jemerov
9f3df0f4d0 More diagnostics for EA-85926 and EA-77163
(cherry picked from commit f9f590d)
2016-11-24 11:13:32 +01:00
Dmitry Jemerov
349ea062aa Restore element after running postprocess (EA-91562 - PIEAE: ASTDelegatePsiElement.getManager)
(cherry picked from commit 2d2f439)
2016-11-24 11:13:32 +01:00
Dmitry Jemerov
e4f36297e1 A facade light class inherits only java.lang.Object (EA-91597 - NPE: KtLightClassForFacade.getClsDelegate)
(cherry picked from commit d803831)
2016-11-24 11:13:32 +01:00
Dmitry Jemerov
80725204a6 Handle INRE in breadcrumbs tooltip calculation (EA-91631 - INRE: FileBasedIndexImpl.handleDumbMode)
(cherry picked from commit b696f9e)
2016-11-24 11:13:32 +01:00
Dmitry Jemerov
c1e181c77e Use ModalityState.NON_MODAL for invokeLater() actions (EA-91730 - assert: PsiModificationTrackerImpl.fireEvent)
(cherry picked from commit 56cb448)
2016-11-24 11:13:32 +01:00
Alexey Sedunov
15ed0f41ee Minor: Fix testdata after rebase 2016-11-24 11:09:27 +03:00
Alexey Sedunov
427865d221 Minor: Fix compilation after rebase 2016-11-24 11:09:26 +03:00
Alexey Sedunov
e4390346b4 Kotlin Facet: Access Gradle files under read action (fixes failure of GradleInspectionTest)
(cherry picked from commit 3eea735)
2016-11-24 11:09:25 +03:00
Alexey Sedunov
93c129b0e8 Minor: Use mutable empty list (as IDEA may attempt to modify it after calling detector)
(cherry picked from commit 6881d07)
2016-11-24 11:09:24 +03:00
Alexey Sedunov
e09c0a1dbe Kotlin Facet: Configure facet automatically on Gradle project import
(cherry picked from commit 075a0bc)
2016-11-24 11:09:23 +03:00
Alexey Sedunov
4d89d42c0c Kotlin Facet: Configure facet automatically on Maven project import
(cherry picked from commit e59754e)
2016-11-24 11:09:22 +03:00
Alexey Sedunov
352efae074 Kotlin Facet: Implement automatic facet configuration
(cherry picked from commit dc33436)
2016-11-24 11:09:22 +03:00
Alexey Sedunov
41f8748aca Kotlin Facet: Track configuration version
(cherry picked from commit 4613eed)
2016-11-24 11:09:21 +03:00
Alexey Sedunov
ae2ba12eb7 Kotlin Facet: Infer 1.6 platform version for modules with JDK 1.7 dependency
#KT-14741 Fixed
(cherry picked from commit 27aaac5)
2016-11-24 11:09:20 +03:00
Alexey Sedunov
46c728f0a3 Kotlin Facet: Fix platform detection for Gradle project
(cherry picked from commit b1fbf9f)
2016-11-24 11:09:19 +03:00
Alexey Sedunov
657c2aeff4 Create from Usage: Add test for KT-14500
(cherry picked from commit 2ff8e92)
2016-11-24 11:09:18 +03:00
Alexey Sedunov
be49dab704 Control-Flow Analysis: Use PSI to generate pseudocode if nested resolved call is confused with outer one (e.g. a {} when invoke() is missing)
#KT-14500 Fixed
(cherry picked from commit a414843)
2016-11-24 11:09:17 +03:00
Alexey Sedunov
88e7df1549 Create from Usage: Support array access expressions/binary expressions with type mismatch errors
#KT-14501 Fixed
(cherry picked from commit e8b5387)
2016-11-24 11:09:16 +03:00
Alexey Sedunov
4b476a6729 Control-Flow Analysis: Do not skip pseudocode for value arguments if they are matched with errors
(cherry picked from commit 0159ddb)
2016-11-24 11:09:15 +03:00
Alexey Sedunov
79bfa84b0f Quick Fixes: Replace strong references to PSI elements with smart pointers
#KT-14552 Fixed
(cherry picked from commit df38c70)
2016-11-24 11:09:15 +03:00
Alexey Sedunov
231f8e3f58 Change Signature: Use new signature when looking for redeclaration conflicts
#KT-14583 Fixed
(cherry picked from commit 8ceeff0)
2016-11-24 11:09:13 +03:00
Alexey Sedunov
5bfb817895 Convert Property to Function Intention: Search occurrences using progress dialog
#KT-14569 Fixed
(cherry picked from commit f4e8242)
2016-11-24 11:09:12 +03:00
Alexey Sedunov
2246dcbe16 Kotlin Facet: Use facet configuration to provide language version for IDE analyzer
(cherry picked from commit 30d08c9)
2016-11-24 11:09:11 +03:00
Alexey Sedunov
a8a1e08bed Kotlin Facet: Use facet configuration in JPS build
(cherry picked from commit 6dd950c)
2016-11-24 11:09:10 +03:00
Alexey Sedunov
679ab06dbc Kotlin Facet: Get rid of copy constructors for compiler arguments/settings and use reflection-based copying instead
(cherry picked from commit d0de9dd)
2016-11-24 11:09:10 +03:00
Alexey Sedunov
2903db3de1 Kotlin Facet: Reuse JvmTarget and LanguageVersion in facet configuration
(cherry picked from commit a2948a6)
2016-11-24 11:09:09 +03:00
Alexey Sedunov
eb71c6f865 Convert to Kotlin: Compiler arguments/settings JPS serializers
(cherry picked from commit b6de7d3)
2016-11-24 11:09:08 +03:00
Alexey Sedunov
43ae0ec0fe Convert to Kotlin: Compiler arguments/settings JPS serializers (rename to .kt)
(cherry picked from commit 9e4fcf9)
2016-11-24 11:09:07 +03:00
Alexey Sedunov
da99516088 Convert to Kotlin: JpsKotlinCompilerSettings.java
(cherry picked from commit b88573e)
2016-11-24 11:09:06 +03:00
Alexey Sedunov
7247dbe34f Convert to Kotlin: JpsKotlinCompilerSettings.java (rename to .kt)
(cherry picked from commit 7cb2f04)
2016-11-24 11:09:05 +03:00
Alexey Sedunov
8a623d3e3a Refactoring: Move facet configuration classes to idea-jps-common module
(cherry picked from commit a6dbdbd)
2016-11-24 11:09:04 +03:00
Alexey Sedunov
c996b32ba9 Kotlin Facet: Validate dialog on language/API version change
(cherry picked from commit 68e293b)
2016-11-24 11:09:04 +03:00
Alexey Sedunov
331b4a8d0f Introduce Type Parameter: Disable shortcut (to avoid interference with IntelliJ API Watcher plugin)
(cherry picked from commit 416569c)
2016-11-24 11:09:03 +03:00
Alexey Sedunov
c0587bc5f5 Kotlin Facet: Fix serialization/deserialization
(cherry picked from commit dc9c988)
2016-11-24 11:09:02 +03:00
Alexey Sedunov
e707d83039 Kotlin Facet: Refactor TargetPlatform to sealed class. Move settings-related classes to top level
(cherry picked from commit 3fcdda2)
2016-11-24 11:09:01 +03:00
Alexey Sedunov
34eb3b37a4 Kotlin Facet: Add compiler settings to facet configuration
(cherry picked from commit ea13456)
2016-11-24 11:09:00 +03:00
Alexey Sedunov
53fa814204 Kotlin Facet: Add extension point for compiler/stdlib version info with implementations for Maven and Gradle project models
(cherry picked from commit 03f4d9f)
2016-11-24 11:08:59 +03:00
Alexey Sedunov
230d39360d Kotlin Facet: Extract VersionInfo class and getVersionInfo() utility function
(cherry picked from commit e0285b9)
2016-11-24 11:08:58 +03:00
Alexey Sedunov
878009acc9 Kotlin Facet: Add API version setting
(cherry picked from commit 37286d5)
2016-11-24 11:08:57 +03:00
Alexey Sedunov
6b8448fc29 Kotlin Facet: Add custom settings and configuration extension point
(cherry picked from commit 2326e3e)
2016-11-24 11:08:57 +03:00
Alexey Sedunov
94cf99b8d0 Kotlin Facet: Initial implementation 2016-11-24 11:08:56 +03:00
Ilya Gorbunov
1db1212db0 Fix the links to the language docs from JvmStatic and JvmName annotations. Add a link from JvmField annotation.
#KT-14953 Fixed

(cherry picked from commit 03bbe87)
2016-11-23 23:42:22 +03:00
Vyacheslav Gerasimov
47ef240bc1 Fixed testOnDestroyFragment
(cherry picked from commit 663d999)
2016-11-23 23:32:01 +03:00
Ilya Gorbunov
9d7653d4c8 Use InputStream as another guess for estimated size in InputStream.readBytes()
(cherry picked from commit 0eba064)
2016-11-23 18:57:47 +03:00
Ilya Gorbunov
7edf4a1b5c Check that the length of a file can be represented as Int.
(cherry picked from commit e41cbe6)
2016-11-23 18:57:47 +03:00
Ilya Gorbunov
4fbff58c02 Performance: use byte array buffer directly to read the entire contents of a file.
#KT-14883 Fixed

(cherry picked from commit c90ee13)
2016-11-23 18:57:47 +03:00
Vyacheslav Gerasimov
de227f2d24 Added ACC_SYNTHETIC flag to generated by kotlin Android extensions onDestroyView method
#KT-14610 Fixed

(cherry picked from commit da87efe)
2016-11-23 18:35:05 +03:00
Ilya Gorbunov
8b95b43ad9 Make tools.jar system dependency, since classpath property is readonly. 2016-11-23 18:34:00 +03:00
Nikolay Krasko
a1ccad21cd Make breakpoints work in local functions in secondary constructors
(cherry picked from commit 60e3c8eecd)
2016-11-23 17:59:25 +03:00
Nikolay Krasko
4337e1679b Fix breakpoints in function literals in inline calls (KT-11521, KT-12734, KT-12470)
#KT-11521 Fixed
 #KT-12734 Fixed
 #KT-12470 Fixed

(cherry picked from commit 1889f4f7b1)
2016-11-23 17:59:24 +03:00
Nikolay Krasko
8328125733 Test breakpoint is hit inside crossinline lambda called from anonymous object (KT-12612)
#KT-12612 Fixed

(cherry picked from commit 59a349a4ae)
2016-11-23 17:59:22 +03:00
Yan Zhulanow
8204937289 Minor: Fix testDeprecatedJvmOverloads test (Kotlin runtime is not enabled by default now in bytecode listing tests) 2016-11-23 17:17:15 +03:00
Yan Zhulanow
3907724e90 Kapt3, Minor: Add tools.jar to kotlin-annotation-processing classpath (Maven) 2016-11-23 15:56:03 +03:00
Yan Zhulanow
dbd2007dde Minor: Update tests for light analysis mode (rebase) 2016-11-22 23:38:32 +03:00
Yan Zhulanow
6bd03c3e62 Kapt3: Fix literal expressions for byte and short 2016-11-22 23:38:31 +03:00
Yan Zhulanow
6fcbd35bb4 Kapt3: Add tests for primitive values and NonExistentClass 2016-11-22 23:38:30 +03:00
Yan Zhulanow
9d3f48e64e Kapt3: Generate stub for error.NonExistentClass to make javac happy 2016-11-22 23:38:29 +03:00
Yan Zhulanow
5d10569cf8 Minor: Rebase to 1.0.6, re-generate tests 2016-11-22 23:38:28 +03:00
Yan Zhulanow
ba7e22856a Kapt3: Add 'useLightAnalysis' option to compiler and Gradle plugins 2016-11-22 23:38:27 +03:00
Yan Zhulanow
2506c04cdb Kapt3: Add friend paths to kapt tasks 2016-11-22 23:38:26 +03:00
Yan Zhulanow
12b2716127 Kapt3: Minor: Changes on review 2016-11-22 23:38:25 +03:00
Yan Zhulanow
ffec71aa52 Kapt3: Extract annotation processing to its own task in Gradle. Now the kotlinCompile task should know nothing about kapt, for the main task it's just a regular Java source root. 2016-11-22 23:38:24 +03:00
Yan Zhulanow
a6e60f5f6f Enable light class analysis mode for AbstractLightAnalysisModeCodegenTest. See also the previous commit.
Note that no test data files are changed, it means that light classes with the light analysis mode enabled are the same as with the full analysis.
2016-11-22 23:38:23 +03:00
Yan Zhulanow
bbd24945fa Use box tests to check if the light analysis mode (without analyzing bodies when possible) produces the same result as the complete analysis. See also the next commit in which light analysis mode is applied. Note that no tests were changed. 2016-11-22 23:38:22 +03:00
Yan Zhulanow
6552b2b893 Fix @JvmMultifileClass in ClassBuilderMode=LIGHT_CLASSES 2016-11-22 23:38:21 +03:00
Yan Zhulanow
2d18cfbd35 Kapt3: Support processor arguments. Add integration tests. 2016-11-22 23:38:20 +03:00
Yan Zhulanow
13306ae191 Kapt3: Do not resolve declaration bodies if possible in kapt 2016-11-22 23:38:19 +03:00
Yan Zhulanow
1f409e782a Allow to avoid declaration body resolution for function and property initializers if the return type is explicitly specified. This significantly reduces the analysis time in kapt3. 2016-11-22 23:38:18 +03:00
Yan Zhulanow
8b6b1a9c0a Kapt3: Use annotation simple name if the annotation declaration is inside the same package as the current source file's package 2016-11-22 23:38:17 +03:00
Yan Zhulanow
6ee143ceca Kapt3: Fix a number of errors in ClassFileToSourceStubConverter:
1. Support strictfp modifier for methods.
2. Support Kotlin top-level methods and properties.
3. Fix visibility modifiers on enum methods.
2016-11-22 23:38:16 +03:00
Yan Zhulanow
8edba094ca Kapt3: Review fixes 2016-11-22 23:38:15 +03:00
Yan Zhulanow
d07917fc1c Minor: Add 'impls' to dictionary 2016-11-22 23:38:14 +03:00
Yan Zhulanow
406b6309d9 Kapt3: Minor: Refactor kapt3 module (move/rename) 2016-11-22 23:38:13 +03:00
Yan Zhulanow
40ff3ec384 Kapt3: Minor: Annotation processor classes may be initialized only once, so SIMPLE_PROCESSOR became a factory method 2016-11-22 23:38:12 +03:00
Yan Zhulanow
b1a00b03d0 Kapt3: Minor: Measure stub generation time 2016-11-22 23:38:11 +03:00
Yan Zhulanow
e50f14f459 Kapt3: Output stubs to .java files in verbose mode 2016-11-22 23:38:10 +03:00
Yan Zhulanow
67a50ff9e9 Kapt3: Run Javac annotation processing in the kapt3 plugin.
There are two modes:
1. Run only annotation processing (like kapt1 with stubs + javac). Seems that it may be faster to process annotations once before Kotlin compilation than launching AP on each IC round.
2. Run AP, repeat analysis and compile Kotlin classes (like kapt2). This mode doesn't support IC for now.
2016-11-22 23:38:10 +03:00
Yan Zhulanow
9f4e7b897f Kapt3: Replace kapt2 in Ant and Maven artifacts with kapt3 2016-11-22 23:38:09 +03:00
Yan Zhulanow
cf8843ea9e Kapt3: Add simple AP test with Kotlin 2016-11-22 23:38:08 +03:00
Yan Zhulanow
eabfba922b Kapt3: Parse generic signatures of methods and fields 2016-11-22 23:38:07 +03:00
Yan Zhulanow
fbc4e2ad0c Kapt3: Parse generic signatures of classes.
Refactoring (move TreeMaker helper functions to KaptTreeMaker, mapValues() and others to utils.kt).
2016-11-22 23:38:06 +03:00
Yan Zhulanow
64ab512f62 Kapt3: Number of bugfixes in JCTreeConverter:
Convert Java primitive and array types properly.
Enums: ignore first two synthetic constructor parameters, do not generate super class constructor call, add ACC_ENUM flag to enum values, do not generate "values" and "valueOf" methods.
Provide a JavaFileObject for JCCompilationUnit.
Handle DefaultImpls, ignore empty DefaultImpls classes.
Use a name table from Javac Names.
2016-11-22 23:38:05 +03:00
Yan Zhulanow
95dc898f6e Kapt3: Put static modifiers on nested non-inner classes.
Do not initialize synthetic and static fields in constructor.
2016-11-22 23:38:04 +03:00
Yan Zhulanow
05800c65d0 Kapt3: Do not generate body for abstract methods.
Add java.lang.Override annotation for overrides.
Ignore java.lang.Synthetic annotation.
2016-11-22 23:38:03 +03:00
Yan Zhulanow
0fb08351db Kapt3: Call super class constructor with some default parameters.
Allow interface, annotation, enum modifiers on class.
2016-11-22 23:38:02 +03:00
Yan Zhulanow
28687a0bf0 Do not create local variables in an abstract class inside OptimizationMethodVisitor, MethodNode forbids this. 2016-11-22 23:38:01 +03:00
Yan Zhulanow
72bccb2608 Kapt3: Initialize final fields in class constructors 2016-11-22 23:38:00 +03:00
Yan Zhulanow
69560ef5be Kapt3: Generate empty body for constructor and void methods 2016-11-22 23:37:59 +03:00
Yan Zhulanow
18bfbd217d Kapt3: Filter only relevant modifiers 2016-11-22 23:37:58 +03:00
Yan Zhulanow
31de9edee4 Kapt3: Initial implementation of JCTreeConverter 2016-11-22 23:37:57 +03:00
Yan Zhulanow
e1b6b3e047 Kapt3: Visit method parameters in Kapt3 class builder mode 2016-11-22 23:37:57 +03:00
Yan Zhulanow
2fcdff9965 Kapt3: Add kapt3 compiler plugin 2016-11-22 23:37:56 +03:00
Yan Zhulanow
d6ca962c06 Kapt3: Replace "my/package/Class$Inner" to "my/package/Class/Inner" in kapt3 class builder mode 2016-11-22 23:37:55 +03:00
Yan Zhulanow
4e7efc4636 Kapt3: Handle exceptions while annotation processing gracefully 2016-11-22 23:37:54 +03:00
Yan Zhulanow
bc7260cc98 Kapt3: Add Kapt runner 2016-11-22 23:37:53 +03:00
Alexey Tsvetkov
f16ae1d014 Minor: fix test data
dummy.kt was added for Gradle test (it does not start otherwise).
Old IC recompiles this file, so new and old IC logs are different.
2016-11-22 23:34:24 +03:00
Dmitry Jemerov
f5f4a70b47 Correctly cherry-pick the fix for KT-12664 2016-11-22 20:23:24 +01:00
Dmitry Jemerov
864a9f709e fix testdata 2016-11-22 20:15:45 +01:00
Yan Zhulanow
e415e1f805 Update TeamCity version for "Compiler and Plugin" configuration 2016-11-22 22:06:50 +03:00
Yan Zhulanow
a3383f2e3f Update changelog for 1.0.6 2016-11-22 21:59:08 +03:00
Mikhail Glukhikh
0573429c0f Enhancement for "join declaration and assignment": now can handle also local variables, relevant inspection added #KT-12095 Fixed
(cherry picked from commit 45e28be)
2016-11-22 16:44:55 +03:00
Mikhail Glukhikh
50194e3e10 Refactoring: MoveAssignmentToInitializer --> JoinDeclarationAndAssignment
(cherry picked from commit c44ecde)
2016-11-22 16:43:51 +03:00
Mikhail Glukhikh
5088bfe58b Convert primary constructor to secondary: KNPE fixed #KT-14745 Fixed
(cherry picked from commit d4995c0)
2016-11-22 16:38:09 +03:00
Dmitry Jemerov
bc0ae30951 Add test for highlighting escape sequences in character literals
(cherry picked from commit 13b2c2c)
2016-11-22 13:39:09 +01:00
Dmitry Jemerov
0778af84e3 Show enum constants in Goto Symbol
#KT-6535 Fixed

(cherry picked from commit d565e18)
2016-11-22 13:39:02 +01:00
Dmitry Jemerov
782fba8d5d Delete paired > after deleting < after any identifier, not just a class-like one
#KT-13279 Fixed

(cherry picked from commit ab8abc9)
2016-11-22 13:29:45 +01:00
Dmitry Jemerov
4b0bf5efbc Highlight escape sequences in character literals
#KT-13795 Fixed

(cherry picked from commit baf321a)
2016-11-22 13:28:10 +01:00
Dmitry Jemerov
a09ee6f91b Fix quote handler for character literals
#KT-12385 Fixed

(cherry picked from commit 2fe2e18)
2016-11-22 13:27:46 +01:00
Dmitry Jemerov
55c111d3bb Implement "Show non-public" filter for Kotlin structure view
#KT-14217 Fixed

(cherry picked from commit b742c8a)
2016-11-22 13:27:06 +01:00
Dmitry Jemerov
d33a38cbce KotlinStructureViewModel: cleanup after J2K
(cherry picked from commit f586eeb)
2016-11-22 13:26:57 +01:00
Dmitry Jemerov
bd69d72c67 KotlinStructureViewModel: J2K
(cherry picked from commit 4b591bf)
2016-11-22 13:26:50 +01:00
Dmitry Jemerov
4a2ac59577 KotlinStructureViewModel: rename to .kt
(cherry picked from commit bf97e64)
2016-11-22 13:26:44 +01:00
Dmitry Jemerov
eec91d5792 Collect local declarations under properties (KT-14215); improve presentation of object declarations
#KT-14215 Fixed

(cherry picked from commit f4ce63f)
2016-11-22 13:26:04 +01:00
Dmitry Jemerov
ac137cbce4 KotlinStructureElementPresentation: cleanup after J2K
(cherry picked from commit 4507702)
2016-11-22 13:25:57 +01:00
Dmitry Jemerov
92ddc2b249 KotlinStructureElementPresentation: J2K
(cherry picked from commit 75a5b0e)
2016-11-22 13:25:47 +01:00
Dmitry Jemerov
45a5c97e47 KotlinStructureElementPresentation: rename to .kt
(cherry picked from commit 6225867)
2016-11-22 13:25:39 +01:00
Dmitry Jemerov
8d98cd3ada Run configuration producer for Gradle tests (KT-10700)
(cherry picked from commit 4cc6b98)
2016-11-22 13:19:39 +01:00
Vyacheslav Gerasimov
14bf70cd89 Implemented suppress lint intention action for android lint (KT-12020)
#KT-12020 Fixed

(cherry picked from commit 60bc35b)
2016-11-22 13:16:47 +03:00
Dmitry Jemerov
efb8e615d7 Never set isScript flag for stubs of file facade and multifile facade classes (scripts are always generated with ClassKind.CLASS)
(cherry picked from commit 99bfbd0)
2016-11-22 10:27:15 +01:00
Dmitry Jemerov
62e4bb361a Don't add script files to facade indices
#KT-12445 Fixed

(cherry picked from commit 6a8f78d7c1)

# Conflicts:
#	idea/tests/org/jetbrains/kotlin/asJava/KtFileLightClassTest.kt
2016-11-21 14:46:16 +01:00
Alexey Andreev
ded8135150 JS: when deciding whether inner class of a local class captures this, don't check for subtyping, since frontend generates strict classes in descriptors. Remove fix for #KT-13583, since it's no more needed. Fix #KT-13792 2016-11-21 13:22:49 +03:00
Alexey Andreev
fe84e03d8b KT-12976: add code to generated JS modules that detects wrong module order and produces human-friendly error message. Fix #KT-12976 2016-11-21 13:01:46 +03:00
Ilya Gorbunov
3274c81c8d @JvmOverloads-generated overloads of final methods are also final: update public API tests.
(cherry picked from commit b7b320e)
2016-11-19 03:45:26 +03:00
Alexey Tsvetkov
d72b0b6eb3 Minor: add Throws(Exception) to avoid override issues in java 2016-11-18 23:25:56 +03:00
Alexey Tsvetkov
ab7932cf50 Ensure jps caches are always cleared in tests 2016-11-18 23:25:49 +03:00
Yan Zhulanow
52197f31f4 Use Uast as an external dependency from Bintray 2016-11-18 16:31:50 +03:00
Dmitry Jemerov
6eaa08030f Don't consider a directory to be a package if there's a .java or .class file with the same name in its parent directory
#KT-12664 Fixed

(cherry picked from commit 5a533a5)
2016-11-18 14:03:08 +01:00
Dmitry Jemerov
f5ec194489 @JvmOverloads-generated overloads of final methods are also final; test to verify that overloads of deprecated methods are deprecated
(cherry picked from commit a57748f)
2016-11-18 11:18:16 +01:00
Dmitry Jemerov
11066a385e Disallow @JvmOverloads on any interface methods
#KT-12224 Fixed

(cherry picked from commit b8525de)
2016-11-18 11:18:15 +01:00
Dmitry Jemerov
934e30c1bc @JvmOverloads on local declarations is now an error
(cherry picked from commit 79e90b3)
2016-11-18 11:18:15 +01:00
Dmitry Jemerov
b8a5f60afd Add quickfix for incorrect @JvmOverloads annotation
#KT-12701 Fixed

(cherry picked from commit 140c735)
2016-11-18 11:18:14 +01:00
Dmitry Jemerov
cad53c1246 Report @JvmOverloads errors on annotation, not on entire declaration (KT-12701)
(cherry picked from commit 12e4cf9)
2016-11-18 11:18:09 +01:00
Dmitry Jemerov
e8424982b7 Generate correct varargs flag for @JvmOverloads-generated methods
#KT-14186 Fixed

(cherry picked from commit d3ccbe8)
2016-11-18 11:18:08 +01:00
Dmitry Jemerov
95cb6dd09f Generate default constructor also for private classes when all parameters have default values
#KT-14408 Fixed

(cherry picked from commit 16a133b)
2016-11-18 11:18:08 +01:00
Dmitry Jemerov
c1320a3f3e Handle @JvmOverloads on inner class constructors correctly
#KT-14678 Fixed

(cherry picked from commit 2481859)
2016-11-18 11:18:01 +01:00
Mikhail Zarechenskiy
237d830f39 Do not force resolve from type constructor
In case of creating context for something like 'class Foo(f: Bar)'
there is no need in resolving supertypes/annotations of Bar type
2016-11-17 20:35:30 +03:00
Nikolay Krasko
ec29ba29d3 Fix null pointer in evaluate expression (EA-87276)
(cherry picked from commit 56ef09c09c)
2016-11-17 14:59:23 +03:00
Nikolay Krasko
b024ba8760 Better diagnostic for inlined line under dex on step over
(cherry picked from commit 6f95667f54)
2016-11-17 14:09:49 +03:00
Nikolay Krasko
6b98501b3d Avoid failure on first() call
(cherry picked from commit 2817e1a5f1)
2016-11-17 14:09:48 +03:00
Nikolay Krasko
263739edc1 Pre-count line numbers
(cherry picked from commit 5412723e023768d308190f43edd5378476ad35c4)
(cherry picked from commit a13e878c9b)
2016-11-17 14:09:46 +03:00
Nikolay Krasko
45245b445e Step over locations after return in dex debug when no return position found by locations
(cherry picked from commit 0032818ec6)
2016-11-17 14:09:44 +03:00
Nikolay Krasko
2b4b7f18ca Step over locations after return in dex debug
(cherry picked from commit a2652832e3)
2016-11-17 14:09:43 +03:00
Nikolay Krasko
326b7ef712 Refactorings: clean smapUtil, moves, renames
(cherry picked from commit f07b5ea)
2016-11-17 14:09:41 +03:00
Nikolay Krasko
28ddd39a40 Cache debug information from bytecode in Android debug
(cherry picked from commit 1c955a6)
2016-11-17 14:09:40 +03:00
Nikolay Krasko
293ad0981c Allow to place breakpoints in inline functions defined in android tests
(cherry picked from commit 78c76a2ca4)
2016-11-17 14:09:38 +03:00
Nikolay Krasko
8a372c4bb6 Refactoring: remove lambda parameter from readClassFile()
(cherry picked from commit ae2e857843)
2016-11-17 14:09:37 +03:00
Nikolay Krasko
797ba92a3a Fix step over for inlined functions in Android Studio (KT-14374)
(cherry picked from commit 623ee316c0)

 #KT-14374 Fixed
2016-11-17 14:09:25 +03:00
Nikolay Krasko
0cdca7acfb Fail if it was impossible to delete cache directory
For example it can be caused by open handler to file on Windows.

(cherry picked from commit f87779bfb0)
2016-11-17 14:07:19 +03:00
Alexey Andreev
d250eb8097 JS: when both clauses of if become empty during optimization, remove if entirely. Make condition and then clause of JsIf non-nullable. Fix #KT-13912 2016-11-17 12:56:10 +03:00
Vyacheslav Gerasimov
a3187902fd Fixed "should not analyze element" problem with destructuring declarations in uast
(cherry picked from commit c6d668e)
2016-11-16 18:15:38 +03:00
Vyacheslav Gerasimov
57bd323de2 Fixed method parameter default value processing in uast
(cherry picked from commit 55f14ba)
2016-11-16 18:15:30 +03:00
Vyacheslav Gerasimov
33a9e3dd9e Fixed KotlinLintTestGenerated.testJavaPerformance + refactoring
Moved android lint tests from uast-kotlin to idea-android

(cherry picked from commit d90ec3e)
2016-11-16 18:15:23 +03:00
Natalia Ukhorskaya
0912b6ee71 Debugger: refactor smart step into to use descriptors instead of psi elements (KT-13485)
#KT-13485 Fixed

(cherry picked from commit 0fb5a18a26)
2016-11-16 15:25:07 +03:00
Mikhail Glukhikh
fd2d706164 Replace single line let: application on IDEA + front-end modules
(cherry picked from commit b850d71)
2016-11-16 15:19:34 +03:00
Mikhail Glukhikh
0db9c371b3 False positive removed in replace single line let intention #KT-14791 Fixed
(cherry picked from commit 09ae1f1)
2016-11-16 15:19:20 +03:00
Dmitry Jemerov
3a6c67303d Fix exception on databinding-generated classes in AS 2.3 (https://ea.jetbrains.com/browser/ea_reports/1261189)
(cherry picked from commit 53cb559)

(cherry picked from commit 2d1a380)
2016-11-15 13:04:32 +01:00
Nikolay Krasko
b13b654c28 Make patch of obfuscated field in ThreadTracker more stable
(cherry picked from commit bce023c8ad)
2016-11-14 21:39:53 +03:00
Dmitry Jemerov
09a97d9faf Read bundled runtime version from build.txt in 'kotlinc' directory, not from plugin version
(cherry picked from commit 7beee33)
2016-11-14 18:54:29 +01:00
Dmitry Jemerov
ba63ff870e Fix race condition with synthetic files facade calculation in Upsource (UP-8046)
(cherry picked from commit 3f7b974)
2016-11-14 14:21:33 +01:00
Nikolay Krasko
506bce65b6 Test for "Code folding doesn't work in kotlin lambdas after some declatation" (KT-14411)
Fixed in previous commit

 #KT-14411 Fixed

(cherry picked from commit e053b77ede)
2016-11-14 15:12:08 +03:00
Nikolay Krasko
165d018829 Assign trailing and preceding whitespaces to lambda block until the last comment in parser
(cherry picked from commit 08d6285)
2016-11-14 15:12:07 +03:00
Nikolay Krasko
1f491869c0 Report file name for getDefaultPlatform() information
(cherry picked from commit 0261385681)
2016-11-14 15:12:05 +03:00
Alexey Tsvetkov
f1d122d95b Revert default value for "main" parameter for Gradle JS plugin to "call"
#KT-14724 fixed
2016-11-11 20:31:06 +03:00
Dmitry Jemerov
e893cf46e1 Update proguard file for compatibility with new Snappy version in IDEA 162-SNAPSHOT
(cherry picked from commit ab0af43)
2016-11-11 18:22:09 +01:00
Dmitry Jemerov
2d40743d69 Add test for KT-14751
(cherry picked from commit 978b70e)
2016-11-11 18:22:02 +01:00
Dmitry Jemerov
9bc19989dd Use 162.SNAPSHOT builds for IDEA to pick up fix for IDEA-162379
(cherry picked from commit 13a17b8)
2016-11-11 18:21:08 +01:00
Dmitry Jemerov
42900b5555 KotlinWithGradleConfigurator: cleanup after J2K
(cherry picked from commit 3d3a202)
2016-11-11 14:42:20 +01:00
Dmitry Jemerov
4f4eafa8fa KotlinWithGradleConfigurator: J2K
(cherry picked from commit 47c80a1)
2016-11-11 14:42:11 +01:00
Dmitry Jemerov
3aa8cd1eef KotlinWithGradleConfigurator: rename to .kt
(cherry picked from commit 11c9dff)
2016-11-11 14:41:25 +01:00
Dmitry Jemerov
f5b502040b use DOM instead of MavenProjectsManager to detect whether Kotlin is configured (KT-9275)
(cherry picked from commit 3d01e92)
2016-11-11 14:41:18 +01:00
Dmitry Jemerov
32ca5e6ee7 Change KotlinProjectConfigurator API to return module status as a single enum instead of two distinct boolean values
(cherry picked from commit ebbf888)
2016-11-11 14:41:11 +01:00
Dmitry Jemerov
649b051656 KotlinProjectConfigurator: J2K
(cherry picked from commit d8c7f2f)
2016-11-11 14:41:04 +01:00
Dmitry Jemerov
89256f9c06 KotlinProjectConfigurator: rename to .kt
(cherry picked from commit 7d442f9)
2016-11-11 14:40:57 +01:00
Alexey Andreev
205d2a12b3 JS: fix diagnostics test data 2016-11-11 14:26:16 +03:00
Alexey Andreev
663d48c5e4 JS: fix exception in JS front-end when checking JsName that was resolved with errors 2016-11-11 11:20:39 +03:00
Dmitry Petrov
1c6f3b0282 KT-14581 Make FixStackAnalyzer tolerant to uninitialized values 2016-11-10 18:09:32 +03:00
shiraji
97dbda7bb6 Implement "Remove redundant '.let' call" binary operator support #KT-14396 Fixed
(cherry picked from commit a662d77)
2016-11-10 14:31:24 +03:00
Zalim Bashorov
5ba298e0cc Mute failed tests and regenerate tests 2016-11-10 14:14:40 +03:00
Zalim Bashorov
0b331de8b4 KJS: fix wrongAbiVersion test after abi version was increased. Make it less fragile with the hack for JS tests.
(cherry picked from commit bdecb66)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
9063ba39de Regenerate tests 2016-11-10 14:14:40 +03:00
Zalim Bashorov
4bd22f2cba Regenerate ultimate tests
(cherry picked from commit 4c8f5e4)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
63d77e2481 Regenerate tests 2016-11-10 14:14:40 +03:00
Zalim Bashorov
5a40d68059 Generate import TargetBackend for each test 2016-11-10 14:14:40 +03:00
Zalim Bashorov
3199f8b4cf Support ignoring by target backend for single generated classes
(cherry picked from commit 5500f80)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
0bc114359f Add ability to ignore test for backend w/o checks
It used for the tests from this commit becouse they was failing during setup.

(cherry picked from commit af4ec98)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
136446eb8c Fix failed tests
(cherry picked from commit a27572a)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
b60d07d511 Ignore files with incompatible target when check that all test are presented
(cherry picked from commit 8e480e2)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
34a8e74a51 Move TargetBackend to tests-common module
(cherry picked from commit 0ecb13b)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
e05afca3ba Don't generate test when target backend is not suitable
(cherry picked from commit a1730f9)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
4fc1d905ca Fail when ignored test success in generated tests
#KT-14618 Fixed

(cherry picked from commit f382f93)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
5eb58d7cb0 Break infinity loop in the test
(cherry picked from commit afe6ec9)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
0503eb622b Automatically mute failed generated tests from compiler/testData/codegen/box/ranges
(cherry picked from commit ee129be)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
276cb6935c Automatically mute failed tests
(cherry picked from commit 596f336)
2016-11-10 14:14:40 +03:00
Zalim Bashorov
7bbc3d4f31 KJS: run all codegen/box tests
(cherry picked from commit a35a1f6)
2016-11-10 14:14:40 +03:00
Mikhail Glukhikh
b5ca4810c5 Effective visibility is now considered private for invisible fake #KT-14469 Fixed
(cherry picked from commit ce72337)
2016-11-10 13:46:47 +03:00
Mikhail Zarechenskiy
bca9a3aeec Perform resolve of constructor parameters during partial constructor resove
#KT-13354 Fixed
2016-11-09 23:07:07 +03:00
Dmitry Jemerov
1bcdea2eda Script for uploading the Kotlin plugin to plugins.jetbrains.com
(cherry picked from commit 46b9136)
2016-11-09 14:13:21 +01:00
Simon Ogorodnik
e45cbe84af Fix for KT-14604 J2K Yet another floating point with exponent format
(cherry picked from commit 2be4800)
2016-11-08 12:16:03 +03:00
Simon Ogorodnik
6ca2753bb9 Fix for KT-14585 J2K, ConvertJavaCopyPasteProcessor shows a dialog under write action
(cherry picked from commit 7e82dd9)
2016-11-08 12:15:59 +03:00
Mikhail Glukhikh
2da345491f Build fix: forgotten inspection descriptions was added for new inspections
(cherry picked from commit a6d1713)
2016-11-07 19:10:25 +03:00
Vyacheslav Gerasimov
022980fbd2 Added missing KtLambdaArgument to UElement conversion in KotlinUastLanguagePlugin
#KT-14470 Fixed

(cherry picked from commit 2a0557f)
2016-11-03 18:09:29 +03:00
Vyacheslav Gerasimov
cefb4e87ce Implemented kotlin quick fix provider for create android resource quick fixes
#KT-10465 Fixed
#KT-12880 Fixed

(cherry picked from commit 9534934)
2016-11-03 18:09:20 +03:00
Vyacheslav Gerasimov
5bdce54ebf Android lint check for api requirements for classes in catch clause (KT-13243)
Added test for #KT-14047, #KT-13243 Fixed, #KT-14047 Fixed

(cherry picked from commit 29b9521)
2016-11-03 18:09:10 +03:00
Vyacheslav Gerasimov
ad47601c5f Added call to ImportFilter in import quickfix (KT-14439)
#KT-14439 Fixed

(cherry picked from commit 387d5ff)
2016-11-03 18:09:00 +03:00
Anton Bannykh
7418bca5e9 Fix capturing variables declared via destructuring (#KT-14535 fixed).
(cherry picked from commit bf8e6ed)
2016-11-03 16:11:17 +03:00
Anton Bannykh
c36672ab7b Replaced when appropriate 'TARGET_BACKEND: JVM' -> 'IGNORE_BACKEND: JS'. Enabled some succesfully working decompiledText tests.
(cherry picked from commit 7ee3baa)
2016-11-03 16:10:36 +03:00
Anton Bannykh
1d658cacbd Implemented specifying specific ignored backend (e.g. '// IGNORE_BACKEND: JS' instead of '// TARGET_BACKEND: JVM')
(cherry picked from commit dc151c1)
2016-11-03 16:09:05 +03:00
Kirill Rakhman
e4d36b3fd9 Implement Intention + Inspection to remove empty secondary constructor body #KT-14326 Fixed
(cherry picked from commit 8a73a1d)
2016-11-01 14:52:31 +03:00
Kirill Rakhman
fca10068d8 Add Inspection to remove empty primary constructor #KT-14521 Fixed
(cherry picked from commit 495dd36)
2016-11-01 14:52:03 +03:00
Kirill Rakhman
f23e432609 clean up psi package
(cherry picked from commit ba7f600)
2016-11-01 14:51:28 +03:00
Kirill Rakhman
7230793d38 Add quick fix to remove single lambda parameter if it's unused #KT-14593 Fixed
(cherry picked from commit e10d10c)
2016-11-01 14:49:04 +03:00
Ilya Ryzhenkov
2d4f0f10d5 Optimize reflection by using Class.getName instead of Class.getCanonicalName
(cherry picked from commit f79116a)
2016-11-01 13:45:09 +03:00
Dmitry Jemerov
3e3ffad9fb 1.0.6 branch started 2016-11-01 11:04:09 +01:00
Dmitry Jemerov
5b11562b0d Changelog for 1.0.5-eap-117 2016-11-01 10:54:58 +01:00
Mikhail Glukhikh
73768b8b58 RedundantIfInspection: description file fixed 2016-10-31 15:59:21 +03:00
Dmitry Jemerov
64e7d3ec8d fix tests for RedundantIfInspection
(cherry picked from commit 3542834)
2016-10-31 15:53:18 +03:00
shiraji
3444cfeefd Correct handling of "Redundant if" for negation case #KT-14575 Fixed
(cherry picked from commit e757559)
2016-10-31 12:45:10 +03:00
Vladislav Golub
d10e9b5490 KT-12019 Highlighting of redundant 'if' statements (#871)
(cherry picked from commit bb32c2d)
2016-10-31 12:44:10 +03:00
shiraji
c28a3589cb Redundant calls of conversion methods: do not suggest for flexible receiver types #KT-14570 Fixed
(cherry picked from commit 62f81e7)
2016-10-31 12:38:45 +03:00
Vyacheslav Gerasimov
2c3afa1b6f fix KotlinAndroidAddStringResource: correct generic extension function processing + minor refactoring 2016-10-30 22:38:12 +03:00
Dmitry Jemerov
f3e65f4617 build fix: don't use API not available in IDEA 161 2016-10-28 21:17:30 +02:00
Alexey Tsvetkov
30480a3dda Fix caches closing/flushing when IC builds non-incrementally 2016-10-28 21:43:17 +03:00
Valentin Kipyatkov
c016bd6c16 Caching for PARTIAL_FOR_COMPLETION resolve too (because it's used not only in completion)
(cherry picked from commit 046c55a)
2016-10-28 19:21:42 +03:00
Dmitry Jemerov
74107c902d Don't calculate property name if we aren't going to search for property accessors in Kotlin sources (KT-14508)
(cherry picked from commit 35130e7)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
4977578f4d Fix Kotlin definitions search for classes which can only be used in a local search scope (KT-13753)
(cherry picked from commit 127db98)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
e9ea64786e KotlinDefinitionsSearcher: cleanup after J2K
(cherry picked from commit e93f6e9)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
edfa4eb653 KotlinDefinitionsSearcher: J2K
(cherry picked from commit 2fc6018)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
1e4d20fddd KotlinDefinitionsSearcher: rename to .kt
(cherry picked from commit 4281c13)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
d7daa00f9f Classes with no parent are top-level (EA-90570 - assert: KtPsiUtil.getOutermostClassOrObject)
(cherry picked from commit 237504c)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
c6043d0b0f Use correct FQ name for running inner classes (KT-14153)
(cherry picked from commit 395bdf4)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
a9d8134d9f Exclude local variables from file structure grouping (KT-14363)
(cherry picked from commit f783ba7)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
3241d5702a Fix handling of underscores in Markdown links (KT-14452)
(cherry picked from commit 5d6f1cf)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
7ccbf710b5 Don't consider function names as candidates for "Show expression type" (KT-14384)
(cherry picked from commit 25c7dcc)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
54fa8b3a01 "Show expression type" no longer shows elements which enclose the element at caret (KT-14436)
(cherry picked from commit 4246fcf)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
bcfb83da30 Don't show literals in "show expression type" popup
(cherry picked from commit 57680ae)
2016-10-28 16:57:02 +02:00
Dmitry Jemerov
66424dfb2e Don't show type for reference expressions inside KtCallableReference (KT-14530)
(cherry picked from commit e6c05c3)
2016-10-28 16:57:02 +02:00
Alexey Tsvetkov
f03c39a94e Fix forcing java to compile if kotlin classes are compiled 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
a5e9f8fef9 Fix running gradle tests on windows 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
a8daeae8cf Minor: remove js-library dependency from jvm module 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
da76f78848 Always flush caches 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
2ae324a093 Gradle IC: treat companion object change as class signature change 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
259f5a6e09 Gradle IC: fix converting class to package facade 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
d7e18d59ab Gradle IC: support multifile classes 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
b82d3cc330 Gradle IC should fail if duplicating class is added
#KT-14554 fixed
2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
ec45e0df97 In case of IC failure rebuild all files since last build
Before this change only files from last iteration were rebuilt.
It is correct and optimal, but there are many diffs with JPS/Gradle
logs.
2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
e473ccd5b6 Groundwork for using IC without Gradle 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
161b9e979f Minor: do not print index in parametrized test name 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
d08214a422 Minor: shorten references after move 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
327c1ed9c7 Refactoring: reorder IncrementalJvmCompilerRunner constructor parameters 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
6863dae2e2 Minor: update copyright in Gradle plugin 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
6e7414e928 Cleanup: optimize imports in Gradle plugin 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
63bbd04c4b Minor: replace File::isFile with File::exists 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
84a73988b3 Minor: make Rebuild object 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
e0489aeab8 Minor: remove duplicated logger utils 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
09d0ce2262 Refactoring: move IC classes into separate package 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
3c37b97982 Refactoring: do not pass properties as parameters 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
cfd7c65986 Refactoring: pass classpath and destination in K2JVMCompilerArguments 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
b4ea3f3ca6 Refactoring: delegate IC files management to IncrementalJvmCompilerRunner 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
0df75f680d Refactoring: split GradleMessageCollector and remove Gradle Logger from IncrementalJvmCompilerRunner 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
6eb8a13a4b Refactoring: move all IC logic to IncrementalJvmCompilerRunner 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
365d561f9e Rebuild on cache corrupted exception
#KT-14055 fixed
2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
bab3cd95ac Refactoring: introduce IncReporter to report IC progress 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
da580948f9 Refactoring: extract calculateSourcesToCompile 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
f9d47a9eba Refactoring: return removed dirty files from calculateSourcesToCompile 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
248c8702a3 Refactoring: introduce class ChangedFiles 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
a6ab636942 Refactoring: extract parts of IC 2016-10-28 17:54:21 +03:00
Alexey Tsvetkov
ab6d8fca08 Refactoring: pass incremental compilation state explicitly 2016-10-28 17:54:21 +03:00
Yan Zhulanow
6a64705210 Kapt2: Add more specific diagnostic in KotlinAnnotationProxyMaker for unresolved reference 2016-10-28 17:36:42 +03:00
Yan Zhulanow
682d37a5bc KT-14434 Add own hashCode() and equals() to JeName 2016-10-28 17:36:42 +03:00
Mikhail Glukhikh
b6a7947e0d Build fix 2016-10-28 17:12:44 +03:00
Mikhail Glukhikh
2adcb27051 If then to elvis: do not report inspection if not used as expression 2016-10-28 16:46:41 +03:00
Mikhail Glukhikh
770399424f Minor: if then to elvis 2016-10-28 16:46:36 +03:00
Dmitry Jemerov
fb89f51271 Separate targets for writing compiler version and plugin version to template files
(cherry picked from commit be13aa0)
2016-10-28 15:24:00 +02:00
Dmitry Jemerov
a613ee393e Binding trace filtering: do not calculate diagnostics if no one is going to query them 2016-10-28 15:04:03 +02:00
Vyacheslav Gerasimov
42bb0d5ea9 Extract string resource intention action for android (KT-11715)
#KT-11715 Fixed

(cherry picked from commit 3ce1703)
2016-10-28 15:40:16 +03:00
Mikhail Glukhikh
a61bbe0240 Minor refactoring: if then to elvis
(cherry picked from commit 53ea5a2)
2016-10-28 15:19:50 +03:00
Mikhail Glukhikh
937f321cbd If then to elvis: no more allowed for if expressions with Unit result
(cherry picked from commit f3c25c7)
2016-10-28 15:19:37 +03:00
Mikhail Glukhikh
055d600b30 If then to elvis: applied in IDEA, front-end & J2K modules
(cherry picked from commit 8edd33e)
2016-10-28 15:19:24 +03:00
Mikhail Glukhikh
e3fa237ee2 If then to elvis: now not applicable for is with type unrelated to original #KT-14520 Fixed
(cherry picked from commit e7cef79)
2016-10-28 15:18:36 +03:00
Mikhail Glukhikh
3fe1e7c104 If then to elvis: now not applicable for is with nullable type #KT-14545 Fixed
(cherry picked from commit 87d265d)
2016-10-28 15:18:23 +03:00
Mikhail Glukhikh
75a43e2f64 If then to elvis: now not applicable for calls with nullable result #KT-14542 Fixed
(cherry picked from commit 89e908d)
2016-10-28 15:18:10 +03:00
Mikhail Glukhikh
fa0ba5fb12 Minor refactoring: if then to elvis
(cherry picked from commit f390b91)
2016-10-28 15:17:56 +03:00
Mikhail Glukhikh
24b5eb7094 Lambda to reference: correct handling of named arguments using resolved call #KT-14550 Fixed
(cherry picked from commit 7b316f7)
2016-10-28 15:17:29 +03:00
Mikhail Glukhikh
db0f9c110a Minor: surround with null check: partial analysis
(cherry picked from commit 7d242c5)
2016-10-28 15:17:17 +03:00
Simon Ogorodnik
c7ed0c0cd8 Fix for KT-14563, Build in 1.0.5 broken due not yet supported language features use 2016-10-28 10:36:21 +03:00
Valentin Kipyatkov
9e8710eebb Changes after cherry picks 2016-10-28 10:17:14 +03:00
Valentin Kipyatkov
43fa98ab4d Refactoring
(cherry picked from commit 13ca110)
2016-10-28 10:17:14 +03:00
Valentin Kipyatkov
0bf640b4b9 Performance fix for postfix completion: 1. Don't use PARTIAL_FOR_COMPLETION resolve mode 2. Attempt to use resolve in physical file instead of synthetic one
(cherry picked from commit 0fbbf1a)
2016-10-28 10:17:13 +03:00
Valentin Kipyatkov
058e452f95 Performance fix for Import Member
(cherry picked from commit 8c99b0e)
2016-10-28 10:17:13 +03:00
Valentin Kipyatkov
6f31f2feee KT-14336 for to stdlib to takeWhile: propose conversion into takeWhile if break is located in else branch
#KT-14336 Fixed
(cherry picked from commit 18f1086)
2016-10-28 10:17:13 +03:00
Valentin Kipyatkov
e8cb0093e5 Fixed index variable case
(cherry picked from commit 5c8db29)
2016-10-28 10:17:13 +03:00
Valentin Kipyatkov
b7cdbe16f0 KT-13998 Loop to call chain converter produces 'none' instead of 'all'
#KT-13998 Fixed
(cherry picked from commit e5fcfae)
2016-10-28 10:17:12 +03:00
Valentin Kipyatkov
39eb5dbdee Split or glue together checks for not null and is instance + more intelligent use of filter vs filterTo
#KT-14284 Fixed
 #KT-14286 Fixed
 #KT-14287 Fixed
 #KT-14303 Fixed
(cherry picked from commit 89099b9)
2016-10-28 10:17:12 +03:00
Valentin Kipyatkov
31493bc8d7 More correct checking of forEach requiring asSequence()
(cherry picked from commit 53220b9)
2016-10-28 10:17:12 +03:00
Valentin Kipyatkov
3fd9a02d2d KT-14341 for to stdlib to forEach: if the loop variable is not used in the last/innerest statement the conversion is not proposed
#KT-14341 Fixed
(cherry picked from commit a87ca84)
2016-10-28 10:17:12 +03:00
Valentin Kipyatkov
31b81971c2 Correct handling of explicit variable type
(cherry picked from commit 5ca7688)
2016-10-28 10:17:11 +03:00
Valentin Kipyatkov
d1a7743d2b Honor errors in code before when checking smart casts
(cherry picked from commit 9326dfa)
2016-10-28 10:17:11 +03:00
Valentin Kipyatkov
8473925d84 KT-14294 for to stdlib to firstOrNull/lastOrNull: intention is absent if there is additional var before for loop
#KT-14294 Fixed
(cherry picked from commit eae23b5)
2016-10-28 10:17:11 +03:00
Valentin Kipyatkov
a8e543fb0b KT-14210 for loop to stdlib: max/min is not recognized if there is additional if
#KT-14210 Fixed
(cherry picked from commit a89ef54)
2016-10-28 10:17:11 +03:00
Valentin Kipyatkov
d6c6ebe3ca any() and other find operations to work with checks for not null and is instance
(cherry picked from commit 35ed689)
2016-10-28 10:17:10 +03:00
Valentin Kipyatkov
3d7fd4fe56 Moved matcher
(cherry picked from commit 49ef880)
2016-10-28 10:17:10 +03:00
Valentin Kipyatkov
3124caaf5b count() to merge with filterNotNull and filterIsInstance + changed test for KT-14191 to use sum()
(cherry picked from commit b28d016)
2016-10-28 10:17:10 +03:00
Valentin Kipyatkov
d099678ab9 KT-14209 for loop to stdlib: sum is not recognized if before was check for type
#KT-14209 Fixed
(cherry picked from commit afd2554)
2016-10-28 10:17:10 +03:00
Valentin Kipyatkov
7fce8a4760 KT-14191 FormattingModelInconsistencyException Exception on applying intention Replace with count()
#KT-14191 Fixed
(cherry picked from commit f5d4b1d)
2016-10-28 10:17:09 +03:00
Valentin Kipyatkov
957f984b8c KT-13810 Kotlin code completion missing last character
#KT-13810 Fixed
(cherry picked from commit 7ab2d0c)
2016-10-28 10:17:09 +03:00
Simon Ogorodnik
9a1ae92e20 Workaround KT-14531, Partial fix for KT-13600, KT-11620 J2K: Invalid conversion context on plain text pasting
For detailed info see KT-14531
2016-10-27 20:04:51 +03:00
Simon Ogorodnik
36abd0e771 Fix for KT-13695, KT-13159 J2K: Invalid conversion context setup for plain text pastes
Extending, Implementing, imports from paste target file previously not implemented
2016-10-27 20:04:50 +03:00
Simon Ogorodnik
04fbf4826b Fix for non-resolving of KtReference, which getTargetDescriptors returning multiple descriptors to same element 2016-10-27 20:04:50 +03:00
Simon Ogorodnik
4e83a2543a Fix for KT-12892 J2K: Wrong placing of comments when constructor converted to primary constructor & init 2016-10-27 20:04:50 +03:00
Simon Ogorodnik
825596ba53 Fix for KT-14248 J2K: Invalid constructor formatting after conversion
Caused by `\n\n long mLong = 0;` leading line breaks
2016-10-27 20:04:50 +03:00
Simon Ogorodnik
8d6bdba7b2 Fix for KT-5312 J2K: Correct bit operations priority after conversion
Now `PolyadicExpression` breaks down to BinaryExpression`s
2016-10-27 20:04:50 +03:00
Simon Ogorodnik
5c730bb1a6 Fix for KT-5410 J2K: someObject + "someString" should be converted to someObject.toString() + "someString"
Otherwise `+` operator will not resolve
2016-10-27 20:04:49 +03:00
Simon Ogorodnik
2168ebfdce Fix for KT-12677. J2K: Invalid SAM constructor redundancy detection
Now all J2kPostProcessing's executing in fixed order, dependent on it index in J2kPostProcessingRegistrar._processings
2016-10-27 20:04:49 +03:00
shiraji
d58a0e77dd Do not use "Remove redundant '.let' call" when receiver is used #KT-14390 Fixed
(cherry picked from commit 0b57d8e)
2016-10-27 19:32:40 +03:00
Mikhail Glukhikh
cd818eefd6 EXTERNAL_DECLARATION_CANNOT_BE_ABSTRACT is now reported on property if accessor is external #KT-9297 Fixed
Also fixes EA-89227

(cherry picked from commit 2130164)
2016-10-27 16:30:10 +03:00
Michael Bogdanov
c08328f201 Removed inlineOnlyFunInClass.kt test 2016-10-27 15:12:28 +03:00
Dmitry Jemerov
d34c03dbaa use a non-deprecated API
(cherry picked from commit 38a448e)
2016-10-27 12:51:31 +02:00
mglukhikh
ab52f4d89e Build fix: "If then to elvis" inspection test
(cherry picked from commit 73b24f2)
2016-10-27 12:33:41 +03:00
Mikhail Glukhikh
559d07c5ef Var can be val: correct handling of initialization in lambda #KT-14065 Fixed
(cherry picked from commit 66f3e26)
2016-10-27 12:33:24 +03:00
Mikhail Glukhikh
8c74a005a6 Surround with null check for unsafe things: find first parent statement to surround (which is not used as expression) #KT-13958 Fixed
(cherry picked from commit fd9e59a)
2016-10-27 12:33:03 +03:00
Mikhail Glukhikh
e32eff4db5 "Surround with null check" is now a high-priority action
(cherry picked from commit e56a10a)
2016-10-27 12:31:12 +03:00
Mikhail Glukhikh
3a33b8e9da Minor: primary constructor to secondary: do not specify independent property type explicitly
(cherry picked from commit 35d1047)
2016-10-27 12:30:58 +03:00
Mikhail Glukhikh
166230cbb7 Primary constructor to secondary: always try to build constructor body #KT-14475 Fixed
(cherry picked from commit a74f010)
2016-10-27 12:30:44 +03:00
Mikhail Glukhikh
79e203794a Object literal to lambda: more precise shorten references #KT-14289 Fixed
(cherry picked from commit d6eee65)
2016-10-27 12:30:28 +03:00
Mikhail Glukhikh
2f229fad16 Lambda to reference: check potential reference arguments by descriptors and not by names #KT-14420 Fixed
(cherry picked from commit dc76f2a)
2016-10-27 12:30:09 +03:00
Mikhail Glukhikh
6e5e0e4b05 Lambda to reference: not-null types are now preferred for platform type receivers #KT-14394 Fixed
(cherry picked from commit 97b4556)
2016-10-27 12:29:54 +03:00
Mikhail Glukhikh
3c83c2111d KT-14084 related : replaceFirstReceiver now replaces ALL calls to safe calls if necessary
Fixes relevant "replace let" and "if to elvis" cases

(cherry picked from commit a901de5)
2016-10-27 12:29:39 +03:00
Mikhail Glukhikh
ac14b12e66 If expression to elvis now handles call chains #KT-14084 Fixed
(cherry picked from commit 2117b30)
2016-10-27 12:29:23 +03:00
Michael Bogdanov
492b52a3c9 Make default methods for inlineOnly and reified functions package private
(cherry picked from commit 0910f16)
2016-10-27 12:15:14 +03:00
Dmitry Jemerov
2c2a3dc115 compilation fix 2016-10-26 13:41:37 +02:00
Michael Bogdanov
36aca0cde6 Fix for KT-13890: IllegalAccessError when invoking protected method with default arguments
#KT-13890 Fixed

(cherry picked from commit eaf9c2e)
2016-10-26 12:15:49 +03:00
Michael Bogdanov
0c89e6fb82 Fix for KT-14201: UnsupportedOperationException: Don't know how to generate outer expression for anonymous object with invoke and non-trivial closure
#KT-14201 Fixed

(cherry picked from commit 1e59161)
2016-10-26 12:15:44 +03:00
Nikolay Krasko
184d39a2bf Allow to select single word on double click in one line doc comment (KT-14327)
#KT-14327 Fixed
2016-10-25 18:14:14 +03:00
Mikhail Glukhikh
92f531b164 CFA test fix (a bit different behavior with master for 'run') 2016-10-25 16:29:02 +03:00
Nikolay Krasko
5c6496cfae Add nullability to receiver type
(cherry picked from commit cdabef5)
2016-10-25 13:57:51 +03:00
Nikolay Krasko
02b2025fd5 Set hasValueArguments in KotlinAnnotationEntryStub to 'true' only if some arguments exist
Currently '()' is used for resolving ambiguity in parsing when annotating function types. This way a decompiled code
will need brackets, but compile code will have annotation without parameters. This commit will allow to make both stub-trees consistent.

Tested in ClsStubBuilderTestGenerated.testAnnotationsOnNullableTypes()

(cherry picked from commit 22999fe)
2016-10-25 13:57:51 +03:00
Mikhail Glukhikh
f73045793e KT-8442 related: correct handling of erroneous destructuring references, fixes EA-90434
(cherry picked from commit e53940f)
2016-10-25 13:48:19 +03:00
Mikhail Glukhikh
96fe7244f2 KT-8442 related: destructuring declarations aren't taken into account during light classes generation, fixes EA-81204
(cherry picked from commit e7e56ab)
2016-10-25 13:48:03 +03:00
Denis Zharkov
ba8fe631dd Do not use BasicInterpreter for bytecode analysis
The problem with BasicInterpreter is the following:
it creates BasicValue objects that should be replaced in favor of StrictBasicicValue

See commit message in 25c6ac1 for clarification

 #KT-14447 Fixed

# Conflicts:
#	compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/common/OptimizationBasicInterpreter.java
#	compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java
2016-10-25 10:21:16 +03:00
Nikolay Krasko
9423d653c0 Step into functions with local variable on first line under "Skip simple getters" (KT-14488)
#KT-14488 Fixed
2016-10-24 16:23:49 +03:00
Alexander Udalov
7fa3331975 Fix errors and indent in built-ins sources
(cherry picked from commit 3f5d3e5dbc)
2016-10-24 15:58:14 +03:00
Alexander Udalov
c1cac61350 Improve Collection/Array/String detection logic in intentions
Use static methods from KotlinBuiltIns and check all supertypes, support cases
of Collection, Map and CharSequence

(cherry picked from commit 2076a31094)
2016-10-24 15:53:01 +03:00
Alexander Udalov
e842fda5cc Use TypeConstructor equality instead of ClassDescriptor in CollectionStubMethodGenerator
Equals/hashCode are meaningful for TypeConstructor instances (see
AbstractClassTypeConstructor.java) in contrast to ClassDescriptor where
equality is referential

(cherry picked from commit a5a422fc4d)
2016-10-24 15:53:01 +03:00
Alexander Udalov
a9703c6036 Minor refactoring in JvmDependenciesIndexImpl
Make SearchResult a sealed class, inline local function & trivial utility

(cherry picked from commit d9f248ccf4)
2016-10-24 15:53:00 +03:00
Alexander Udalov
a716376fcf Drop TypeConstructor.getAnnotations(), uninherit TypeConstructor from Annotated
The method was unused on TypeConstructor instances, and almost all
implementations returned EMPTY anyway

(cherry picked from commit cdf6567375)
2016-10-24 15:53:00 +03:00
Mikhail Glukhikh
64d98cf308 KT-7929 related: KtDestructuringDeclarationEntry is not resolved to descriptor in OverridingDeprecatedMemberInspection
(cherry picked from commit 44d1067)
2016-10-24 15:30:57 +03:00
Mikhail Glukhikh
93a449dbd1 KT-7929 related: incorrect KtDestructuringDeclarationEntry is not resolved to descriptor, fixes EA-76715
(cherry picked from commit 6b9252a)
2016-10-24 15:30:44 +03:00
Mikhail Glukhikh
75004bacdf No more attempts to resolve KtDestructuringDeclaration to descriptor #KT-7929 Fixed
Also #KT-8442 Fixed

(cherry picked from commit 1c8a2bb)
2016-10-24 15:30:32 +03:00
Nikolay Krasko
1aa37f1125 Fix stub-psi mismatch exception on restoring annotation for nullable types 2016-10-21 18:33:43 +03:00
Nikolay Krasko
06260fbc01 Regenerate formatter tests 2016-10-21 15:20:25 +03:00
Mikhail Glukhikh
572d56853f UnreachableCode.getUnreachableTextRanges always returns at least one range #KT-14158 Fixed
(cherry picked from commit bfaa9cf)
2016-10-21 10:34:57 +03:00
Alexey Tsvetkov
2de2d58506 Fix pom.xml 2016-10-21 00:20:51 +03:00
Alexey Tsvetkov
48f547fe46 Introduce common interface for common gradle options
This might be useful for future kotlin build scripts
2016-10-21 00:20:51 +03:00
Alexey Tsvetkov
8327a8d9a1 Do not remove annotations.txt (kapt1) file before kotlin compiler is called
#KT-14250 fixed

 Before this change the following could happen:
 0. Successful build.
 1. Only java files are changed.
 2. CompileKotlin task starts because java files are also input files for kotlin.
 3. annotations.txt file is deleted, but kotlin compiler is not called, so it is not regenerated.
 4. Javac fails.
2016-10-21 00:20:51 +03:00
Mikhail Glukhikh
e3faaf8d2a CFG refactoring: get rid of mergeWithLocalDeclarations (always true) + minor style fixes
(cherry picked from commit 1e04945)
2016-10-20 19:58:56 +03:00
Mikhail Glukhikh
293f4c5958 Minor cleanup
(cherry picked from commit cce3a77)
2016-10-20 19:58:45 +03:00
Mikhail Glukhikh
5572b9becb Initialization analysis : more accurate handling of non-local variables while merging data #KT-14304 Fixed
(cherry picked from commit a19d178)
2016-10-20 19:58:35 +03:00
Mikhail Glukhikh
de34ddf6a5 Minor style fix
(cherry picked from commit bba34e0)
2016-10-20 19:58:08 +03:00
Nikolay Krasko
11aa71e09c Add toString for KotlinStubBaseImpl
Try to simplify "Stub and PSI element type mismatch" exception analyze.
2016-10-20 18:53:51 +03:00
Nikolay Krasko
33fa19b736 J2K: actual convert for AbstractStubBuilderTest 2016-10-20 18:53:51 +03:00
Nikolay Krasko
31a356a99d J2K: rename AbstractStubBuilderTest 2016-10-20 18:53:51 +03:00
Nikolay Krasko
fdb4120cde Auto-indent line with chain-call continuation 2016-10-20 18:53:51 +03:00
Dmitry Neverov
fdd5ba7500 Fix spaces in labeled expression (KT-14131)
https://github.com/JetBrains/kotlin/pull/978
2016-10-20 18:53:51 +03:00
Dmitry Jemerov
5a3a9edfbb changelog updated 2016-10-20 16:51:04 +02:00
Alexey Andreev
664a3f4ad2 JS: add test to prove that #KT-5051 is no more reproducible 2016-10-20 12:18:53 +03:00
Alexey Andreev
94ba884a79 Suppress tests marked by TARGET_BACKEND directive when running Android codegen tests 2016-10-20 12:18:53 +03:00
Dmitry Jemerov
dc046832bf Specify test framework to use explicitly in generate test tests
(cherry picked from commit f933cf5)
2016-10-19 17:15:24 +02:00
Dmitry Jemerov
46cb68c69c add missing prepareForWrite() calls
(cherry picked from commit 32290ec)
2016-10-19 13:26:33 +02:00
Sergey Mashkov
19d2b8bf0e Merge pull request #979 from JetBrains/rr/cy/hashMapPutAll
KT-14194 JS: HashMap.putAll shouldn't call getKey/getValue
2016-10-19 14:25:57 +03:00
Nikolay Krasko
2ce6069e37 Ignore not-prepared classes and add diagnostics for not-prepared classes for getting fields (EA-85900) 2016-10-19 13:59:46 +03:00
Nikolay Krasko
3234d764a7 Insert '()' under write action in finishing anonymous object template (EA-82700) 2016-10-19 13:59:46 +03:00
Zalim Bashorov
4934d59f63 KJS: increase JS binary version since name mangling slightly changed
(cherry picked from commit 3513cef)
2016-10-19 13:01:22 +03:00
Alexander Udalov
f17ba2a094 Fix incremental recompilation of JvmMultifileClass with top level function
See 53b584f and previous changes where this behavior was broken (this was
untested, however). Fixes EA-90065

(cherry picked from commit 7b2a80ffa4)
2016-10-19 12:50:51 +03:00
Alexey Sedunov
734bf44831 Convert Receiver to Parameter Intention: Update function descriptor after template is finished (otherwise some references may be processed incorrectly)
(cherry picked from commit e39fd51)
2016-10-19 11:56:54 +03:00
Alexey Sedunov
ca393382d3 Add Library Quick-fix: Fix exception due to resolution being run in the "dumb mode"
#KT-14199 Fixed

(cherry picked from commit 0f276c6)
2016-10-19 11:56:53 +03:00
Alexey Sedunov
ad2afcecc9 Rename: Do not suggest type-based names for functions with primitive return types
#KT-14234 Fixed

(cherry picked from commit 61c56f3)
2016-10-19 11:56:52 +03:00
Alexey Sedunov
2d33c9bb50 Light Classes: Avoid empty scope on KtLightParameter
#KT-13882 Fixed

(cherry picked from commit dccf9c8)
2016-10-19 11:56:51 +03:00
Alexey Sedunov
2f6f6f0351 Minor: Get rid of deprecated (as of IDEA 2016.2) method calls
(cherry picked from commit 3adbe55)
2016-10-19 11:56:50 +03:00
Yan Zhulanow
c9fc7155ce Explicitly filter out classes found by DataBindingClassFinder and DataBindingComponentClassFinder for scope without sources (KT-12402)
This change is temporary, and it should be reverted when the original problem in DataBinding IDE support is fixed.
2016-10-18 22:09:57 +03:00
Yan Zhulanow
6c3a20b25f Fix conformance test 2016-10-18 19:56:48 +03:00
Yan Zhulanow
1e28c5ef17 Lint: Add several checkCancelled() checks to UElementVisitor 2016-10-18 19:56:48 +03:00
Yan Zhulanow
982d6b2f71 Lint: Use IntellijApiDetector in IDE
(cherry picked from commit 8ae29f4)
2016-10-18 19:56:47 +03:00
Yan Zhulanow
4820cefb30 Uast: Migrate to UAnnotation
(cherry picked from commit fdd0ed9)
2016-10-18 19:56:47 +03:00
Yan Zhulanow
4be3f69dbd Lint: Remove SdkWrapper and AnroidModelFacade (was needed in Android Studio 1.5)
(cherry picked from commit 297b23a)
2016-10-18 19:56:47 +03:00
Yan Zhulanow
78548a553b Lint: Fix diagnostic tests
(cherry picked from commit 2854297)
2016-10-18 19:56:47 +03:00
Yan Zhulanow
3f24835d5d Lint: Fix compilation errors after replacing diagnostics
(cherry picked from commit 796b3cf)
2016-10-18 19:56:46 +03:00
Vyacheslav Gerasimov
280cd5d596 Lint: Android Lint diagnostics fixes
(cherry picked from commit aa3b0a6)
2016-10-18 19:56:46 +03:00
Yan Zhulanow
2d815359ab Lint: Update diagnostics because of the new Uast. Also, these diagnostics are from AS 2.2.
(cherry picked from commit ca919b1)
2016-10-18 19:56:46 +03:00
Yan Zhulanow
d328eb53ba Temporary remove outdated Uast tests
(cherry picked from commit cf82878)
2016-10-18 19:56:45 +03:00
Yan Zhulanow
40449fa3f2 Lint: Update Uast implementation (the new version is without declaration level)
(cherry picked from commit de4a47a)
2016-10-18 19:56:45 +03:00
Zalim Bashorov
863a22d5ee KJS: fixes after backporting changes with supporting class literals.
* Remove features which unsupported in 1.0.x;
* Slightly rewrite code generation for class literals;
* Don't deprecate jsClass extension property since no alternatives to get JsClass or KClass from expression in 1.0.x;
* Slightly rewrite tests.
2016-10-18 19:28:37 +03:00
Zalim Bashorov
2ed9585c74 KJS: use cached KClass instead create new each time when getting it from JsClass
(cherry picked from commit 5f2ba70)
2016-10-18 19:28:37 +03:00
Zalim Bashorov
d6a92c037c Report error when try to use unsupported reflection API in Kotlin JS; allow to use kotlin.Any members on reflection classes for both platforms.
(cherry picked from commit c21e1eb)
2016-10-18 19:28:37 +03:00
Zalim Bashorov
6aa31d3335 JS: change visibility to internal for library and marker annotations
(cherry picked from commit 11b2c5f)
2016-10-18 19:28:37 +03:00
Zalim Bashorov
ec3c1a8a33 Don't render descriptors outside of modules directly mentioned in tests, e.g. descriptors from libraries.
(cherry picked from commit 77ceb3e)
2016-10-18 19:28:37 +03:00
Zalim Bashorov
21fbdeff4a Remove obsolete test about class literals is not supported
(cherry picked from commit 279b4dc)
2016-10-18 19:28:37 +03:00
Zalim Bashorov
952bb2efc4 Minor: fix warnings in Namer
(cherry picked from commit 71235ee)
2016-10-18 19:28:37 +03:00
Zalim Bashorov
dc99135246 JS backend: basic support for class literals.
Added:
* the ability to get KClass using class literals (`::class`);
* the ability to get KClass from JsClass and vice versa;
* the ability to get simpleName.

 #KT-13345 Fixed

(cherry picked from commit 3c520a3)
2016-10-18 19:28:37 +03:00
Zalim Bashorov
c077c7d545 Minor: move reflection/light/* -> reflection/*
(cherry picked from commit ace10f4)
2016-10-18 19:28:37 +03:00
Zalim Bashorov
58b6b4d80a JS: make Any as upper bound of type parameter of JsClass and helpers
(cherry picked from commit d31f181)
2016-10-18 19:28:37 +03:00
Sergey Mashkov
9c29542fc2 KT-14194 JS: HashMap.putAll shouldn't call getKey/getValue 2016-10-18 19:03:10 +03:00
Valentin Kipyatkov
fe708db1ea Protection against "<caret>" missing in test data
Many incorrect tests fixed

# Conflicts:
#	idea/testData/intentions/iterationOverMap/DataClassDependentLocal.kt
#	idea/testData/intentions/removeUnnecessaryLateinit/normalLateinit.kt
#	idea/testData/quickfix/implement/noDefaultConstructor.kt
#	idea/testData/quickfix/implement/privateConstructor.kt
2016-10-18 14:53:51 +02:00
Nikolay Krasko
c4fb0e9e56 Remove mentioning KT-11395 from the wrong test
#KT-11395 Open
2016-10-18 15:31:39 +03:00
Nikolay Krasko
0ec664b206 Stop wrapping ProcessCanceledException into KotlinFrontEndException (EA-86153) 2016-10-18 15:26:14 +03:00
Nikolay Krasko
e44260ad6d Commit all documents after J2K (KT-13584, EA-82451)
New Kotlin file will be generated after converting, they are created for virtual files that were renamed from Java.
The exception happens when Java file was previously opened in editor, in that case text is restored through getLastCommittedText(document) where
document is resored for virtual file.

See: SingleRootFileViewProvider.VirtualFileContent.getText()

Exception descriptions also mention "Create Test" action as a problem source. The issue was reproduced when J2K convertion was performed
on test creation.

 #KT-13584 Fixed
2016-10-18 15:26:14 +03:00
Michael Bogdanov
a2320665af Test data fix
(cherry picked from commit c5e8139)
2016-10-18 15:27:09 +03:00
Dmitry Neverov
5699b143af Fix indent in constructor delegate call (KT-7718)
#KT-7718 Fixed
2016-10-18 13:47:49 +03:00
Michael Bogdanov
06482b0c6c Fix for KT-14012: Back-end (JVM) Internal error every first compilation after the source code change
#KT-14012 Fixed

(cherry picked from commit d48ef2e)
2016-10-18 10:48:17 +03:00
Dmitry Jemerov
4a8f999219 Report more details about update checker exceptions.
(cherry picked from commit 882c62d)
2016-10-17 20:17:03 +02:00
Dmitry Jemerov
57af2390ca diagnostics for EA-79913 - AIOOBE: ByDescriptorIndexer.getDeclarationForDescriptor$idea_analysis
(cherry picked from commit 4730eb4)
2016-10-17 20:16:55 +02:00
Dmitry Jemerov
4689e327c1 handle elements with null containing file (EA-84533 - IAE: KtPsiFactoryKt.getModuleInfo)
(cherry picked from commit 30a9186)
2016-10-17 20:16:46 +02:00
Dmitry Jemerov
d4ea017998 catch I/O exceptions from prepareToInstall() (EA-86183 - SE: AppInputStream.read)
(cherry picked from commit 17866f8)
2016-10-17 20:16:36 +02:00
Dmitry Jemerov
65a9ac24b5 EA-89031 - IAE: SmartTypeRenderer.render
(cherry picked from commit 4a51e41)
2016-10-17 20:16:29 +02:00
Dmitry Jemerov
e5ea13e341 EA-87284 - KNPE: KotlinTestRunLineMarkerContributor.getInfo
(cherry picked from commit c0d1c71)
2016-10-17 20:16:22 +02:00
Nikolay Krasko
dfea3afc81 Add indent before colon of super types list on new line (KT-13981, KT-5117)
#KT-13981 Fixed
 #KT-5117 Fixed
2016-10-17 14:04:06 +03:00
Nikolay Krasko
7774d2c27e Evaluate overloaded toString() in watches for Kotlin classes with delegate properties (KT-14068)
#KT-14068 Fixed
2016-10-17 14:04:05 +03:00
Ilya Chernikov
e3f275d490 Remove usage of getLocalHost, other minor changes related to localhost connections in daemon
- attempt to fix behaviours similar to #IDEA-161962, #KT-14042, #KT-14334
(cherry picked from commit 16897f4 in master and 1.1-M02 branch)
2016-10-17 12:08:10 +02:00
Mikhail Glukhikh
7d8575dd76 Add inspection/intention for redundant calls of conversion methods #KT-10871 Fixed
Also #KT-12625 Fixed

(cherry picked from commit a1f1716044)
2016-10-17 12:13:45 +03:00
Dmitry Petrov
21ec8850a8 KT-14360 Microoptimizations in RedundantCoercionToUnitTransformer 2016-10-17 10:19:24 +03:00
Dmitry Petrov
d081956217 KT-14357 Run RedundantCoercionToUnitTransformer before DeadCodeEliminatingMethodTransformer.
Remove empty try-catch blocks in DeadCodeEliminatingMethodTransformer.
2016-10-17 10:19:20 +03:00
Dmitry Petrov
03aed77c95 Make static initializer classes for inheriting multifile class parts annotated as SYNTHETIC_CLASS.
(cherry picked from commit fbe3f15)
2016-10-17 10:19:00 +03:00
Nikolay Krasko
c6b128e1e8 Minor: rename ForkJoinPoolPatcherForTeamCityTesting -> ThreadTrackerPatcherForTeamCityTesting 2016-10-14 20:59:18 +03:00
Nikolay Krasko
78e2f055b6 Test for "Debugger: "Step over" dives into recursive call" (KT-12924)
Fixed in 7992df7b93

 #KT-12924 Fixed
2016-10-14 20:59:18 +03:00
Dmitry Jemerov
c3fb2bb2aa Changelog updated again 2016-10-14 19:58:43 +02:00
Dmitry Jemerov
08f0ba6a74 Changelog updated 2016-10-14 19:56:12 +02:00
Nikolay Krasko
d741895b2c Do an ordinal step over while stepping over inlined calls in dex 2016-10-14 18:44:09 +03:00
Alexey Tsvetkov
91c63c7eb1 Ensure task build directory always exist
#KT-14253 fixed
2016-10-14 17:31:25 +03:00
Alexey Tsvetkov
27658b8e8c Provide a way to force stdout output in Gradle tests 2016-10-14 17:31:25 +03:00
Alexey Tsvetkov
c44e4b8d84 Minor: rename file its name is the same as class it contains 2016-10-14 17:31:25 +03:00
Alexey Tsvetkov
29a926ac73 Do not check the content of JS file in Gradle test 2016-10-14 17:31:25 +03:00
Zalim Bashorov
7fff363f9c Add tasks to download node.js (platform independently) and tasks to publish packages to npm; extract some common things to common.xml
(cherry picked from commit 0a0a05d)
2016-10-14 16:43:52 +03:00
Zalim Bashorov
31c9c705aa JS: add templates for kotlin and kotlin-compiler packages
(cherry picked from commit 96830e3)
2016-10-14 16:43:52 +03:00
Kirill Rakhman
9f66ef14db Add quick-fixes for lateinit-related errors #KT-14342 Fixed
(cherry picked from commit 09d6e2e)
2016-10-14 16:18:38 +03:00
Yoshinori Isogai
34be2cc778 KT-14329 Do not report inspection "Remove empty class body" for anonymous objects (#972)
(cherry picked from commit 708a0e3)
2016-10-14 15:00:57 +02:00
Alexey Tsvetkov
4745d1f344 Test that kotlin gradle options are up to date
#KT-14317 fixed
2016-10-14 15:50:13 +03:00
Valentin Kipyatkov
069b1ea16e KT-14353 ClassCastException during offline inspections
#KT-14353 Fixed
(cherry picked from commit 76fe1ec)
2016-10-14 12:32:26 +03:00
Valentin Kipyatkov
e80343ef03 More correct code - ensure that equals works correctly!
(cherry picked from commit 29fe63d)
2016-10-14 12:32:25 +03:00
Valentin Kipyatkov
6576c8e32f KT-9835 Completion thinks receiver is nullable when it is not
#KT-9835 Fixed
(cherry picked from commit 0399772)
2016-10-14 12:32:25 +03:00
Valentin Kipyatkov
5951912070 KT-13780 No completion and assertion error in log
#KT-13780 Fixed
(cherry picked from commit 7b12dd4)
2016-10-14 12:32:25 +03:00
Valentin Kipyatkov
929675b0a8 Use partial resolve
(cherry picked from commit 03320d6)
2016-10-14 12:32:25 +03:00
Valentin Kipyatkov
802d5df602 Added tests for parameter names in function type from SAM-adapter + fixed KT-13861
#KT-13861 Fixed
(cherry picked from commit a62a37f)
2016-10-14 12:32:25 +03:00
Valentin Kipyatkov
d9d363c85c Moved and renamed tests
(cherry picked from commit 8d7b597)
2016-10-14 12:32:24 +03:00
Valentin Kipyatkov
950bdd79f9 KT-12077 Code completion inserts FQN for annotations with use-site target inside primary constructor
KT-13009 Kotlin: annotation auto-import is broken in multiple ways

  #KT-12077 Fixed
  #KT-13009 Fixed
(cherry picked from commit 73dc5fe)
2016-10-14 12:32:24 +03:00
Valentin Kipyatkov
b39be967a2 Moved tests
(cherry picked from commit 0c14058)
2016-10-14 12:32:24 +03:00
Valentin Kipyatkov
8cfc1c686e Fixed multiple bugs in optimize imports for JS-target
#KT-13689 Fixed
(cherry picked from commit b84260f)
2016-10-14 12:32:24 +03:00
Valentin Kipyatkov
6af2af20a7 Refactoring
(cherry picked from commit 45cd4f1)
2016-10-14 12:32:23 +03:00
Valentin Kipyatkov
1cd54020e9 Used KtReference.resolvesByNames instead of own code
(cherry picked from commit 326db55)
2016-10-14 12:32:23 +03:00
Valentin Kipyatkov
e573278ee6 KT-9950 IntelliJ IDEA does not suggest importing extension methods which have the same name as an instance method
#KT-9950 Fixed
(cherry picked from commit 5734f2b)
2016-10-14 12:32:23 +03:00
Valentin Kipyatkov
bafda5b7eb Removed redundant
(cherry picked from commit 49ac6b9)
2016-10-14 12:32:23 +03:00
Valentin Kipyatkov
e69c29abf0 KT-13884 Exception "Invalid root block PSI element" on replacing trivial when-expression to if
#KT-13884 Fixed
(cherry picked from commit c06e2d9)
2016-10-14 12:32:22 +03:00
Valentin Kipyatkov
b80f6eb214 KT-13719 'var' can be made 'val' highlighting range with annotation before
#KT-13719 Fixed
(cherry picked from commit 597cd04)
2016-10-14 12:32:22 +03:00
Michael Bogdanov
78284c0eaf Fix for KT-14330 java.lang.IllegalArgumentException: Parameter specified as non-null is null: method ... parameter value
#KT-14330 Fixed

(cherry picked from commit 0501392)
2016-10-14 10:58:14 +03:00
Alexey Tsvetkov
d23dc07afc Regenerate kotlin gradle options for 1.0.5
#KT-14355 fixed
2016-10-13 21:30:39 +03:00
Alexey Tsvetkov
a11c4cd3cf Fix test dependencies for gradle integration tests 2016-10-13 21:30:38 +03:00
Simon Ogorodnik
dbfc078835 Fix test to complete on 1.0.5
for 3304bb3
2016-10-13 19:22:58 +03:00
Simon Ogorodnik
3304bb32c5 Fix for KT-14205
If detected unfinished expression it passed through, added warning on action "Convert Java to Kotlin", if Java files contains syntax errors.

(cherry picked from commit e763565)
2016-10-13 19:13:28 +03:00
Simon Ogorodnik
9f6cc77989 Fix for KT-10885
Assignment as expression conversion: e.g int i = j = 0

(cherry picked from commit e14a043)
2016-10-13 19:13:28 +03:00
Simon Ogorodnik
4080d9c197 Fix KT-13021, KT-13020, Test for already fixed KT-6941
Fixes on javadoc to kdoc comments convert

(cherry picked from commit d731f97)
2016-10-13 19:13:28 +03:00
Simon Ogorodnik
d8f80223fe Fix for KT-6424
Remove "SuppressWarnings" and "//noinspection" on java to kotlin conversion

(cherry picked from commit 155cfcb)
2016-10-13 19:13:28 +03:00
Alexey Sedunov
c1df9d41ed Rename: Fix in-place rename on non-overriding functions
(cherry picked from commit 3eb5076)
2016-10-13 19:04:10 +03:00
Nikolay Krasko
7f3a9c1029 Use Dex suffix instead of dex prefix for better test sorting 2016-10-13 18:36:37 +03:00
Nikolay Krasko
27b0e7d3b0 Refactoring: extract KotlinStepOverInlineFilter class 2016-10-13 18:36:35 +03:00
Nikolay Krasko
008e57452a Check current behaviour of stepping over inline 'hasNext' and 'next' in for
#KT-14296 Open
2016-10-13 18:36:33 +03:00
Nikolay Krasko
a220e645bf Make step over for single thread work in Ultimate 2016-10-13 18:36:30 +03:00
Nikolay Krasko
2e8775d68f Change the way 'step over' over inline calls works (KT-13751)
Previously it worked by invoking 'Run To Cursor' for the last position of inline function. As there's only one 'run to cursor' breakpoint
available in Idea framework, it couldn't work when inline function call was was used in conditions of control flow statements.

A new approach works through multiple step over operation and controlling stop position. In other words we try to "step over" inlined lines.
Same thing is actually done in "Smart Step Into" action.

 #KT-13751 Fixed
2016-10-13 18:36:28 +03:00
Nikolay Krasko
d0ffe06601 Test for "Breakpoint inside lambda argument of InlineOnly function doesn't work" (KT-11395)
#KT-11395 Fixed
2016-10-13 18:36:21 +03:00
Nikolay Krasko
462bdb2c43 Generate 'nop' instruction on lambda call when everything on line is going to be eliminated by inliner (KT-6477)
#KT-6477 Fixed
2016-10-13 18:36:20 +03:00
Dmitry Jemerov
8575ad8bc1 correct way to check if intention is applicable; revert: Delete test that is transformed syntax error
(cherry picked from commit b1b171f)
2016-10-13 15:47:09 +02:00
takahirom
5211bc9878 Fix 'in' operator intention for Strings (KT-13974)
(cherry picked from commit 925c48c)
2016-10-13 15:47:01 +02:00
takahirom
54bfa07f98 KT-13550 Fix Boolean.TYPE does not compile (#969)
* Fix Boolean.TYPE does not compile

(cherry picked from commit 93c2e7d)
2016-10-13 15:04:19 +02:00
Dmitry Petrov
f82970a610 Minor: update generated tests. 2016-10-13 15:02:59 +03:00
Alexander Udalov
fe6ee7bb3f Fix compilation error 2016-10-13 14:16:40 +03:00
Alexander Udalov
07b733c59c Refactor class lookup in deserialized scopes
Move the logic to DeserializedMemberScope; drop NestedClassDescriptors

(cherry picked from commit 8828e671f5)
2016-10-13 12:56:58 +03:00
Alexander Udalov
0c72593a1e Remove extra cache of nested classes from DeserializedClassDescriptor
ClassDescriptor instances are already cached in ClassDeserializer

(cherry picked from commit e1ce6f88d5)
2016-10-13 12:51:29 +03:00
Alexander Udalov
c0fa5755b0 Make JvmPlatform.defaultImports a stored property
It was incorrectly made a getter-only property in 2f616bdd

(cherry picked from commit 321a19a247)
2016-10-13 12:51:15 +03:00
Alexander Udalov
3a68b5e558 Drop ModuleParameters, inline defaultImports everywhere
(cherry picked from commit 2f616bdd33)
2016-10-13 12:50:04 +03:00
Alexander Udalov
89fa1aae74 Introduce DeserializationConfiguration
Will be used soon to deliver the language/API-version-related behavior to the
deserialization

(cherry picked from commit 88af36001c)
2016-10-13 12:38:20 +03:00
Simon Ogorodnik
41cfce26bd Test for KT-7332, already fixed
(cherry picked from commit 2a95a4a)
2016-10-13 11:12:09 +03:00
Simon Ogorodnik
4726824212 Fix for KT-10545
//TODO unfix: see KT-14305

(cherry picked from commit 4710f70)
2016-10-13 11:12:08 +03:00
Simon Ogorodnik
370e3459d3 Fix KT-8091
J2K string with octal escaped chars
added support for octal escaping definition for char

(cherry picked from commit a64c45c)
(cherry picked from commit 2c99aac)
2016-10-13 11:11:33 +03:00
Dmitry Petrov
1274244b4f Cleanup and unify RangeCodegenUtil functions. 2016-10-13 10:15:27 +03:00
Vsevolod
88b3c42cd7 KT-5044 code cleanup, test added 2016-10-13 10:15:22 +03:00
Vsevolod
4fa8510c86 KT-5044 intrinsify all contains calls for primitive ranges from stdlib 2016-10-13 10:15:17 +03:00
Vsevolod
40a178f49c KT-5044 implement missing Range#contains tests and move it to separate package 2016-10-13 10:13:16 +03:00
Alexander Udalov
ac10821bbd Introduce "-api-version" CLI option
The `@SinceKotlin("X.Y.Z")` annotation now hides a particular declaration from
resolution when the API version specified by the `-api-version` option is
_less_ than X.Y.Z. The comparison is performed as for versions in Maven:
MavenComparableVersion is in fact a copy of
org.apache.maven.artifact.versioning.ComparableVersion.

Also support "!API_VERSION" directive in diagnostic tests

 #KT-14298 Fixed

(cherry picked from commit 167ab1f860)
2016-10-12 18:05:51 +03:00
Alexander Udalov
982bd249fb Refactor gradle option generation mechanism
Ensure there's a statically checked dependency on LanguageVersion and
JvmTarget, so that this information is updated automatically once a new
language version or a JVM target is added

(cherry picked from commit 8d660c2f6e)
2016-10-12 18:05:50 +03:00
Alexander Udalov
4de4a31d6b Move LanguageVersionSettings and JvmTarget to module 'util'
To be used from cli-common in the subsequent commits

(cherry picked from commit 2c66d4e59b)
2016-10-12 18:05:50 +03:00
Alexander Udalov
af669686f4 Support deprecation level HIDDEN for classifiers
Classifiers annotated with `@Deprecated(level = HIDDEN)` now have smaller
priority in imports, similarly to private classes. For example, if two
classifiers named Foo are imported with a star import and one of them is
deprecated-hidden, the name Foo in the source code is resolved to the other
one.

Also a minor change in multi-module diagnostic tests: do not append newlines
after the last module in the test

 #KT-13926 Fixed

(cherry picked from commit aaeae8b948)
2016-10-12 18:05:50 +03:00
Alexander Udalov
0bda8f01ad Report error instead of warning for deprecation level HIDDEN
Since functions usually are hidden from resolution when they are
deprecated-hidden, the problem can only be reproduced for properties with
deprecated-hidden accessors, where DeprecatedCallChecker reported warnings
instead of errors

(cherry picked from commit 83c86d06ed)
2016-10-12 18:05:50 +03:00
Alexander Udalov
2615d7f166 Minor, extract isDeprecatedHidden for usage in codegen
Also remove a hundred year old TODO

(cherry picked from commit 59b29cf00d)
2016-10-12 18:05:50 +03:00
Alexander Udalov
60d5e40dc6 Minor refactoring in DeprecatedCallChecker
(cherry picked from commit 9004367f3c)
2016-10-12 18:05:49 +03:00
Alexander Udalov
44fd2fac01 Do not report deprecation on members of deprecated companion
This deprecation is reported on the companion itself anyway

(cherry picked from commit 8949ffbef1)
2016-10-12 18:05:49 +03:00
Alexander Udalov
a8eb169900 Fix NPE in StorageManager on sanitizing stack trace
This could happen when running the compiler from the command line, where
MemoryBasedClassLoader is used which does not ever create Package instances.

(cherry picked from commit 9fd698db36)
2016-10-12 18:05:49 +03:00
Alexander Udalov
509df8ad22 Include output of module daemon-common to compiler jar in compiler-quick
This fixes CompilerDaemonTest with the compiler built by "ant compiler-quick"

(cherry picked from commit 8ccc168b87)
2016-10-12 18:05:49 +03:00
Alexander Udalov
76974e0fe4 Move PlatformToKotlinClassMap out from ModuleParameters
Configure it in the same way as other platform-specific components instead,
simplify some code

(cherry picked from commit 7070b88ea4)
2016-10-12 18:05:49 +03:00
Alexander Udalov
5e2ead80e0 Pass PlatformToKotlinClassMap instance to PlatformTypesMappedToKotlinChecker
The purpose of this change is to allow PlatformToKotlinClassMap to be removed
from ModuleDescriptor

(cherry picked from commit b77388bd48)
2016-10-12 18:05:48 +03:00
Alexander Udalov
f8ec01b214 Simplify usages of IncrementalPackageFragment and related code
Since its scope is now empty, no descriptor now has a container that is an
instance of IncrementalPackageFragment -> a lot of code is not needed anymore

(cherry picked from commit 53b584f48c)
2016-10-12 18:05:48 +03:00
Alexander Udalov
2103c28805 Refactor IncrementalPackageFragmentProvider
(cherry picked from commit 7c6352a9f2)
2016-10-12 18:05:48 +03:00
Alexander Udalov
465036c80d Make scope of incremental package fragment empty
It's only needed to create IncrementalMultifileClassPackageFragment instances
now

(cherry picked from commit c1f55e8018)
2016-10-12 18:05:48 +03:00
Alexander Udalov
7d92101ab7 Drop obsolete logic related to obsolete package parts
Filtering out obsolete package parts in incremental compilation was necessary
before the big refactoring of package parts, when package parts had been
compiled together into a package class

(cherry picked from commit 74ad6b1410)
2016-10-12 18:05:48 +03:00
Alexander Udalov
6cac37edb7 Support rendering contents of different modules in load* tests
This is needed because otherwise with separate modules turned on in the
compiler, these tests do not display the contents of classes from the
dependency module in the rendered output

(cherry picked from commit 9d778711d2)
2016-10-12 18:05:48 +03:00
Alexander Udalov
efea91dfb3 Minor, introduce DeclarationProviderFactory.EMPTY
(cherry picked from commit 214abea4d6)
2016-10-12 18:05:47 +03:00
Alexander Udalov
72920f8e95 Minor refactorings related to PackagePartProvider and implementations
- Document what exactly should findPackageParts return
- Make EMPTY a named object instead of a val in the companion
- Do not use JvmPackagePartProvider in tests where Empty works fine
- Add a couple default values to arguments of setupResolverForProject

(cherry picked from commit 0ed9897b03)
2016-10-12 18:05:47 +03:00
Alexander Udalov
302fa4a83b Add debugName to ModuleMapping
(cherry picked from commit 97f2051a03)
2016-10-12 18:05:47 +03:00
Alexander Udalov
54b26916bb Prevent double initialization in codegen tests, fix ScriptGenTest#testDependentScripts
Add an assertion to prevent duplicate initialization of CodegenTestFiles
instance in CodegenTestCase, which was happening in ScriptGenTest with multiple
invocation of loadFile()

(cherry picked from commit 74d6ef73d4)
2016-10-12 18:05:47 +03:00
Alexander Udalov
92d0499a63 Prettify TopDownAnalyzerFacadeFor{JVM,JS}
(cherry picked from commit 9cfe0be98e)
2016-10-12 18:05:47 +03:00
Alexander Udalov
e0e74b8310 J2K TopDownAnalyzerFacadeFor{JVM,JS}: convert to Kotlin
See 4467e12
2016-10-12 18:05:46 +03:00
Alexander Udalov
99a7fa744c J2K TopDownAnalyzerFacadeFor{JVM,JS}: rename files
See b34150e
2016-10-12 18:05:46 +03:00
Alexander Udalov
0e64423de7 Minor, improve exception when getting missing component from container
(cherry picked from commit be5e0f4275)
2016-10-12 18:05:46 +03:00
Alexander Udalov
ffce2a744a Drop ExternalDeclarationsProvider
It was added for Android extensions, but now another mechanism is used there
(PackageFragmentProviderExtension), and there were no other implementations of
ExternalDeclarationsProvider in the project

(cherry picked from commit 87fe6c41df)
2016-10-12 18:05:46 +03:00
Alexander Udalov
64affef129 Minor, delete ModuleContext#builtIns
(cherry picked from commit 1d6abc32bc)
2016-10-12 18:05:46 +03:00
Alexander Udalov
5009492a9f Minor, add toString for debug
(cherry picked from commit 5d37fab4f5)
2016-10-12 18:05:45 +03:00
Alexander Udalov
ea74d1ab86 Check that class literal LHS is not an expression 2016-10-12 18:05:45 +03:00
Denis Zharkov
d72f5f1ae9 Minor. Add !! assertion necessary in 1.0.5 2016-10-12 18:02:01 +03:00
Denis Zharkov
25c6ac1c53 Fix NPE caused by nullability checks optimizations
Mostly this commit replaces instances of original BasicValue from ASM
with ones of StrictBasicValue having strict equals implementation

Optimization issue was related to non-symmetric 'equals':
- NotNullBasicValue("java/lang/Object").equals(BasicValue("java/lang/Object")) == false
- BasicValue("java/lang/Object").equals(NotNullBasicValue("java/lang/Object")) == true

 #KT-14242 Fixed
2016-10-12 18:02:01 +03:00
Denis Zharkov
5876c013de Add license and links to rewritten ASM classes 2016-10-12 18:02:01 +03:00
Denis Zharkov
e6b072e76b Minor. Invert if 2016-10-12 18:02:01 +03:00
Denis Zharkov
cb78006ace Refine redundant null checks interpreter
The main change here is addition of a check that NotNullBasicValue instances
are not being created for non-reference types

Exactly this change should be used instead of f25f0db10e
The latter commit lead to problem described in the KT-14242 issue:
v.getType().getSort() == w.getType().getSort() && (v.getType().getSort() != Type.OBJECT || v.equals(w))

Problem is that the condition above returns true without calling `v.equals(w)`,
because the sort of type is ARRAY, not OBJECT, so testArray was being treated
as NotNullable erroneously

So the second part of this change is effectively revering mentioned commit

 #KT-14242 Fixed
2016-10-12 18:02:01 +03:00
Denis Zharkov
722f3e46e4 Minor. Add hashCode override after existing equals 2016-10-12 18:02:01 +03:00
Simon Ogorodnik
8aaaac3bc8 Fix for KT-11375, KT-9710, KT-8161
(cherry picked from commit 25b9542)
2016-10-12 13:17:38 +03:00
Simon Ogorodnik
84cda2cdc3 Fixes for test(@JvmStatic -> const), fix for prototype assign
(cherry picked from commit df0ddde)
2016-10-12 13:17:35 +03:00
Simon Ogorodnik
8825fa1e36 Fix KT-13750, J2K const val serialVersionUID
(cherry picked from commit e84f563)
2016-10-12 13:17:32 +03:00
Simon Ogorodnik
aa8f4904b3 Regenerated tests
(cherry picked from commit 12efb20)
2016-10-12 13:17:16 +03:00
Simon Ogorodnik
10e270faf7 Fix for KT-13818
Javadoc @code conversion

(cherry picked from commit 1a7c507)
2016-10-12 13:15:35 +03:00
Denis Zharkov
195ebebac4 Add a quickfix for warning on ambiguously annotated expression
#KT-14238 Fixed
2016-10-12 11:43:15 +03:00
Denis Zharkov
386fe9c275 Add warning for ambiguous annotated expression syntax
#KT-14238 In Progress
2016-10-12 11:43:15 +03:00
Denis Zharkov
fe53a1369f Minor. Extract method for annotations resolution on expression 2016-10-12 11:43:15 +03:00
Denis Zharkov
97dccd26ea Change parsing of annotations on block level expressions
Attach annotations to the closest prefix expression instead of
whole statement if no new line found after annotations

The motivation is for a simple annotated expression like '@ann x + y'
its syntax form must not change after prepending 'val z = ' just before it
2016-10-12 11:43:15 +03:00
Denis Zharkov
d2c367cc52 Change annotations parsing in bodies of operators
This change only matters in cases of if/when/for/while having braceless
blocks

Annotations on them are parsed now as on block-level expressions, i.e.
they're attached to the whole expression
2016-10-12 11:43:15 +03:00
Denis Zharkov
678eda145e Minor. Rename methods in parser
Method that was called `parseControlStructureBody` is actually used for
loop bodies only, while `parseExpressionPreferringBlocks` used for
parsing body of control structure (i.e. it must be called
`parseControlStructureBody`)
2016-10-12 11:43:15 +03:00
Alexey Tsvetkov
67c0516327 Add test for freeCompilerArgs in kotlin options for Gradle 2016-10-11 17:59:25 +03:00
Mikhail Glukhikh
5b90bb9c36 Minor: forgotten caret set to fix a test 2016-10-11 17:55:40 +03:00
Mikhail Glukhikh
1a0dc81f16 Minor refactoring: destructure intention
(cherry picked from commit 206374c)
2016-10-11 17:55:36 +03:00
Mikhail Glukhikh
d306d62e2a Destructure intention: entries / entrySet are now removed only for kotlin.Map inheritors #KT-14244 Fixed
(cherry picked from commit 8188bb1)
2016-10-11 17:55:32 +03:00
Mikhail Glukhikh
c947c64e74 KT-13943 related: inspection is now always reported if manual destructuring is available
(cherry picked from commit 304f6a3)
2016-10-11 17:55:27 +03:00
Mikhail Glukhikh
d6e35336d2 Destructure intention now handles the case with manual destructuring inside #KT-13943 Fixed
(cherry picked from commit 475d554)
2016-10-11 17:55:23 +03:00
Mikhail Glukhikh
572e66fbae UNUSED_VARIABLE is now reported only for last entry of destructuring declaration (if applicable) #KT-14221 Fixed
(cherry picked from commit 8d48b0d)
2016-10-11 17:55:18 +03:00
Mikhail Glukhikh
90658a5694 Refactoring + minor fixes: destructure intention
(cherry picked from commit 70949d1)
2016-10-11 17:55:14 +03:00
Mikhail Glukhikh
81e41919fb Destructure inspection: do not apply on variable declarations + name & severity changed
(cherry picked from commit dd7d7a5)
2016-10-11 17:55:10 +03:00
Mikhail Glukhikh
b8e05afe8a Destructure intention: use also for variable declarations #KT-7488 Fixed
(cherry picked from commit 37debf4)
2016-10-11 17:55:05 +03:00
Mikhail Glukhikh
faba432d90 Simplify for intention refactoring: focus on the loop parameter, not on the loop itself
(cherry picked from commit 42aea59)
2016-10-11 17:55:01 +03:00
Mikhail Glukhikh
2f3715e2ff Minor: destructing --> destructuring in SimplifyForIntention
(cherry picked from commit 0a8006a)
2016-10-11 17:54:56 +03:00
Dmitry Jemerov
3e472be86b reduce ComponentRegistry memory use
#KT-13136 Fixed

(cherry picked from commit fc46afc)
2016-10-11 15:44:26 +02:00
Mikhail Glukhikh
53c986345e Rename: intention tests "ifNullToElvis" --> "foldInitializerAndIfToElvis"
(cherry picked from commit c6fefbc)
2016-10-11 16:26:05 +03:00
Mikhail Glukhikh
20122656fb "If null to elvis" now converts to elvis also !is check right after initializer #KT-14032 Fixed
(cherry picked from commit 0903402)
2016-10-11 16:19:12 +03:00
Mikhail Glukhikh
60032e8cbc KT-14032 related: if expression to elvis now handles also is and !is checks
(cherry picked from commit 121f0ec)
2016-10-11 16:18:58 +03:00
Nikolay Krasko
083656c69a Refactoring: stop calling deprecated method 2016-10-11 15:22:04 +03:00
Nikolay Krasko
7e0f100ccf Refactoring: inline method + inline variable 2016-10-11 15:22:03 +03:00
Nikolay Krasko
a2f7e000c3 Refactoring: call apply method without returning intermediate object 2016-10-11 15:22:01 +03:00
Nikolay Krasko
67cc9b544d Refactoring: make createCommand non-nullable 2016-10-11 15:21:59 +03:00
Nikolay Krasko
2b71909572 Refactoring: rename getStepOverPosition -> getStepOverAction 2016-10-11 15:21:58 +03:00
Michael Bogdanov
909fe788b8 Removed 'callableFunction.kt' signature test 2016-10-11 14:22:41 +03:00
Denis Zharkov
e9b7be38d1 Fix backend issue related to JvmStatic val with accessor
Do not treat accessors to JvmStatic properties as having dispatch receiver

 #KT-11585 Fixed
2016-10-11 12:33:01 +03:00
Denis Zharkov
811b389e79 Minor. Move isJvmStatic* functions to backend 2016-10-11 12:31:20 +03:00
Michael Bogdanov
dca4b3e7e4 Fix writeSignature test data 2016-10-11 12:02:57 +03:00
Alexey Andreev
2b9a77d386 KT-13830: support case when LHS of augmented assignment is something different than qualified expression or array access 2016-10-11 11:56:46 +03:00
Zalim Bashorov
55b8865653 JS: add inspection for the case when something with dynamic type implicitly casted to kotlin another type
(cherry picked from commit 45d42bd)
2016-10-10 20:56:57 +03:00
Yoshinori Isogai
8b025df180 KT-14241 Add Intention + Inspection to remove empty class body (#968)
(cherry picked from commit afe8244)
2016-10-10 19:28:49 +02:00
Alexander Udalov
dce8861e61 Do not pack IDEA core libraries into one idea-core-all.jar in pack-compiler
This is no longer needed because there's no more jsr166e.jar in IDEA core
libraries, which was the reason for the original change.

This reverts commit 9a762e0fa2.

(cherry picked from commit a1584377bf)
2016-10-10 17:48:03 +03:00
Michael Bogdanov
26d19668e2 Print bytecode on signature test fail
(cherry picked from commit d911de20f9)

# Conflicts:
#	compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractWriteSignatureTest.kt
2016-10-10 14:28:02 +03:00
Michael Bogdanov
efeaf5457d Don't generate generic signature for get/set methods in property reference class
(cherry picked from commit f8e9922)
2016-10-10 14:28:02 +03:00
Michael Bogdanov
926c54d89b Fix for KT-14243: Wrong invocation descriptor on calling implicitly generated implementation in class
#KT-14243 Fixed

(cherry picked from commit 5bd045c)
2016-10-10 14:28:01 +03:00
Dmitry Jemerov
c029551f5d to avoid running resolve under ClsTypeElement lock, return empty modifier list if we're currently calculating the return type (the modifier list is requested to apply type annotations, and we don't care about them anyway)
#KT-12966 Fixed

(cherry picked from commit ce0d81f)
2016-10-10 12:53:32 +02:00
Dmitry Jemerov
6fb63866ab don't try to resolve declaration to descriptor if we don't have any annotations
(cherry picked from commit e55c82d)
2016-10-10 12:53:24 +02:00
Alexey Sedunov
f4d4bd90af Extract Function: Support implicit abnormal exits via Nothing-typed expressions
(cherry picked from commit 8de7e17)
2016-10-10 13:36:11 +03:00
Alexey Sedunov
c5d7ab9e99 Search Everywhere: Render function parameter types. Render extension type in prefix position
#KT-13976 Fixed
 #KT-13977 Fixed
(cherry picked from commit dcb372d)
2016-10-10 13:36:11 +03:00
Alexey Sedunov
536407fb28 Move: Show error message on applying to enum entries
#KT-14182 Fixed
(cherry picked from commit cf08fa0)
2016-10-10 13:35:38 +03:00
Alexey Sedunov
0f85c2acc7 Rename: Use qualified class name when looking for occurrences in non-code files
#KT-14128 Fixed
 #KT-13862 Fixed
 #KT-6199 Fixed
(cherry picked from commit 8050775)
2016-10-10 13:35:37 +03:00
Alexey Sedunov
bd63569c74 Create from Usages: Do not suggest on type-mismatched expressions which are not call arguments
#KT-14143 Fixed
(cherry picked from commit 0987be3)
2016-10-10 13:35:36 +03:00
Alexey Sedunov
6c70f4d3ae Rename: Implement popup chooser for overriding members
#KT-13963 Fixed
(cherry picked from commit 5fbdd7e)
2016-10-10 13:35:35 +03:00
Alexey Sedunov
9f23e9b403 Rename: Rename do-while loop variables in the loop condition
#KT-14157 Fixed
(cherry picked from commit 9c12fdf)
2016-10-10 13:35:34 +03:00
Alexey Sedunov
e4eca20d70 Move: Fix exception on moving Kotlin file without declarations
#KT-14114 Fixed
(cherry picked from commit a9d4e72)
2016-10-10 13:35:33 +03:00
Alexey Andreev
3dd94eeb8c JS: fix exception during translation of for expression with iterator having generic type constrained by Iterable. Fix #KT-8385 2016-10-10 11:31:15 +03:00
Alexey Andreev
a4f6eb47d0 KT-12707: support case when secondary super constructor has optional parameters 2016-10-10 11:31:15 +03:00
Alexey Andreev
16c3d2b132 KT-12707: (JS) proper translation of a constructor in subclass that calls secondary constructor of parent class. Fix #KT-12707 2016-10-10 11:31:14 +03:00
Alexey Andreev
7ffcf327b8 KT-2752: fix translation of call to internal function from subclass
(cherry picked from commit 322f6fe)
2016-10-08 20:29:16 +03:00
Alexey Andreev
2650862682 KT-2752: fix some tests and make them slightly less fragile 2016-10-08 20:24:01 +03:00
Alexey Andreev
137d96d426 KT-2752: refactor NameSuggestion, change rules for determining name stability and applying mangling 2016-10-08 20:24:00 +03:00
Alexey Andreev
81ffdb940e KT-2752: fixes after code review 2016-10-08 20:23:59 +03:00
Alexey Andreev
4ff5fa26c7 KT-2752: remove unnecessary hack that tries to treat annotation on property accessor as annotation on property itself; looks like FE has fixed that 2016-10-08 20:23:59 +03:00
Alexey Andreev
d2f2e2401a KT-2752: when simple name of class is a JS keyword or a well-known global name, add '$' to name of constructor function 2016-10-08 20:23:58 +03:00
Alexey Andreev
5ca02c098a KT-2752: add hash-based suffix to private members of open/abstract public classes 2016-10-08 20:23:57 +03:00
Alexey Andreev
61f27fdb20 KT-2752: export JsName on class via JS reflection 2016-10-08 20:23:57 +03:00
Alexey Andreev
1430a98f68 KT-2752: minor fixes after code review 2016-10-08 20:23:53 +03:00
Alexey Andreev
4829b5b607 KT-2752: add test to prove that KT-13024 is no longer reproducible with new implementation of name mangling 2016-10-08 20:23:25 +03:00
Alexey Andreev
c7476c3a30 KT-2752: deprecate parameter of @native annotation, prohibit simultaneous usage of parameterized @native and @JsName 2016-10-08 20:23:24 +03:00
Alexey Andreev
c3437148c6 KT-2752: move some diagnostics from entire declarations to their headers 2016-10-08 20:23:23 +03:00
Alexey Andreev
c4dd32d7a0 KT-2752: add test to ensure that JsName affects classes 2016-10-08 20:23:23 +03:00
Alexey Andreev
e0aff9d10c KT-2752: refactor NameSuggestion 2016-10-08 20:23:22 +03:00
Alexey Andreev
bdb12f1581 KT-2752: rename FQNPart to SuggestedName and FQNGenerator to NameSuggestion 2016-10-08 20:23:21 +03:00
Alexey Andreev
5571155802 KT-2752: add some docs to FQNGenerator 2016-10-08 20:23:21 +03:00
Alexey Andreev
0a0b9259de KT-2752: refactor support of modules and root packages 2016-10-08 20:23:20 +03:00
Alexey Andreev
12895d1145 KT-2752: minor fixes 2016-10-08 20:23:18 +03:00
Alexey Andreev
3e98060ad5 KT-2752: prohibit JSName on extension properties 2016-10-08 20:23:16 +03:00
Alexey Andreev
be63ef11cd KT-2752: refactoring:
1. Get rid of most of ManglingUtils
2. Use simple mangling for delegated properties instead of stable mangling
3. Use stable mangling for public declarations of open non-public classes
4. When generating a fresh name in a JsScope, check it for clashing against parent scopes
5. JsFunctionScope does not generate fresh name instead of stable names
6. Function scopes inherit directly from global scope
7. Generate simple mangled names for backing fields of properties
2016-10-08 20:23:16 +03:00
Alexey Andreev
4a7f41d3c6 KT-2752: remove diagnostic that reports about overridden method having several names from different sources. Generate proxies instead. Fix reporting name clash when two distinct fake overrides require same name. 2016-10-08 20:23:15 +03:00
Alexey Andreev
341cd9c680 KT-2752: add diagnostics that reports about conflicting overridden declarations 2016-10-08 20:23:14 +03:00
Alexey Andreev
0085792fe4 KT-2752: add diagnostic that reports about applying JsName on overridden declarations 2016-10-08 20:23:13 +03:00
Alexey Andreev
f7956e2ba5 KT-2752: fix JsName with explicit use target. Add some tests for JsName with use targets 2016-10-08 20:23:13 +03:00
Alexey Andreev
bf132810e0 KT-2752: declare properties as a pair of functions when accessors are marked with @JsName 2016-10-08 20:23:12 +03:00
Alexey Andreev
e51d93a5b7 KT-2752: add checkers for inconsistent usage of JsName 2016-10-08 20:23:11 +03:00
Alexey Andreev
a87f6e1ece KT-2752: JsName renames native declarations 2016-10-08 20:23:10 +03:00
Alexey Andreev
5f07ae9328 KT-2752: fix old tests, add test for clashing between class and its companion object 2016-10-08 20:23:10 +03:00
Alexey Andreev
abdf66e7d9 KT-2752: move tests, that check whether there's no name clash, to JS backend tests 2016-10-08 20:23:09 +03:00
Alexey Andreev
4cfd2d1c0e KT-2752: add basic tests for JsName 2016-10-08 20:23:08 +03:00
Alexey Andreev
9dec02d9fe KT-2752: add draft implementation of JsName annotation. Fix some tests using the annotation 2016-10-08 20:23:07 +03:00
Alexey Andreev
220f6866a8 KT-2752: fix name clash diagnostic for case of extension property. Add more tests for the diagnostic 2016-10-08 20:23:07 +03:00
Alexey Andreev
5cd88be893 KT-2752: add diagnostic that checks whether Kotlin declarations produce conflicting names in generated JS 2016-10-08 20:23:06 +03:00
Alexey Andreev
805d8f3760 KT-2752: refactor generation of FQN in JS. Move backend-independent code to generic code in frontend. 2016-10-08 20:23:05 +03:00
Alexey Andreev
258f077558 KT-2752: a new approach to compose fully-qualified names that does not depend on code generation and can be reused in JS front-end 2016-10-08 20:23:05 +03:00
Dmitry Jemerov
b8f4c78d34 changelog updated 2016-10-07 18:52:06 +02:00
Alexey Sedunov
879a145b86 Call Hierarchy: Show Kotlin usages of Java methods
#KT-12398 Fixed
(cherry picked from commit 3f6e60f)
2016-10-07 18:08:26 +03:00
Alexey Sedunov
c15d74b452 Generate 'toString()': Permit for data classes
#KT-14122 Fixed
(cherry picked from commit 5bb0352)
2016-10-07 18:08:25 +03:00
Alexey Sedunov
2f73c62e9c Quick Fixes: Implement "Remove unused assignment" quickfix
#KT-9931 Fixed
(cherry picked from commit 0616e86)
2016-10-07 18:08:24 +03:00
Alexey Sedunov
db30ae133c Move out of Companion Object: Warn if traget class already contains function with the same signature
#KT-13877 Fixed
(cherry picked from commit 074ad6b)
2016-10-07 18:08:23 +03:00
Alexey Sedunov
03f3765f97 Test Framework Support: Allow using whitespaces and other symbols in "Generate -> Test Function" dialog
#KT-12556
(cherry picked from commit 450d31b)
2016-10-07 18:08:22 +03:00
Alexey Sedunov
fe18d79174 Move Inner Class to Upper Level: Fix replacement of outer class instances used in inner class constructor calls
#KT-13928 Fixed
(cherry picked from commit 86c1231)
2016-10-07 18:08:21 +03:00
Alexey Sedunov
89c122d20d Rename: When renaming Kotlin file outside of source root do not rename its namesake in a source root
#KT-14096 Fixed
(cherry picked from commit c76c834)
2016-10-07 18:08:20 +03:00
Alexey Sedunov
afdb5a8516 Move: Do not report accessibility conflicts on builtin declarations
#KT-13726 Fixed
(cherry picked from commit a5eee2d)
2016-10-07 18:08:19 +03:00
Alexey Sedunov
6adaeb6ffe Navigation: Filter out candidate declarations coming from the wrong library
#KT-13726 In Progress
(cherry picked from commit ba1ee99)
2016-10-07 18:08:18 +03:00
Alexey Sedunov
8e2d4fc38e Pull Up: Replace unresolved type parameters with their upper bounds (Fixes test failure after switching to IDEA 2016.2)
(cherry picked from commit 6c2d4ad)
2016-10-07 18:08:17 +03:00
Alexey Sedunov
f9e877ce96 Push Down: Support moving members from Java to Kotlin class
#KT-9485 Fixed
(cherry picked from commit 956c6ee)
2016-10-07 18:08:17 +03:00
Alexey Sedunov
c1a99fa623 Pull Up/Push Down/Extract Super: Support references to Java-declared superinterfaces
(cherry picked from commit 924bb44)
2016-10-07 18:08:15 +03:00
Alexey Sedunov
b4894c2363 Pull Up/Push Down/Extract Super: Show member dependencies in the refactoring dialog
(cherry picked from commit 22271f0)
2016-10-07 18:08:14 +03:00
Alexey Sedunov
f1ba8b19b0 Pull Up/Extract Super: Support members declared in the companion object of the original class
(cherry picked from commit 8a5628c)
2016-10-07 18:08:13 +03:00
Alexey Sedunov
6828071124 Pull Up/Extract Super: Support properties declared in the primary constructor
(cherry picked from commit 982d4d4)
2016-10-07 18:08:12 +03:00
Sergey Mashkov
c572512c7f KT-13478 Error creating Maven project by archetype: The desired archetype does not exist
don't filter versions in internal mode or if all were filtered out
2016-10-07 17:55:08 +03:00
Sergey Mashkov
1ca952a669 KT-13638 Update Maven configuration actions in IDE according to changes in https://github.com/JetBrains/kotlin-web-site/pull/458 2016-10-07 17:53:39 +03:00
Sergey Mashkov
8f9b47b0cc KT-14003 kotlinc shebang should use env 2016-10-07 14:11:49 +03:00
Valentin Kipyatkov
ff47c97afc Fixed 2016-10-07 14:09:37 +03:00
Valentin Kipyatkov
016de45ca7 Fixed test data 2016-10-07 14:09:37 +03:00
Valentin Kipyatkov
11263194dc Fixed after cherry-pick 2016-10-07 14:09:37 +03:00
Valentin Kipyatkov
de115a1d5f Better tooltip for try
(cherry picked from commit 75d56e4)
2016-10-07 14:09:37 +03:00
Valentin Kipyatkov
4f4000f776 No crash in dumb mode
#KT-13967 Fixed
(cherry picked from commit f1946ae)
2016-10-07 14:09:36 +03:00
Valentin Kipyatkov
e0d21f3920 Better presentation for property accessor
(cherry picked from commit a2976ac)
2016-10-07 14:09:36 +03:00
Valentin Kipyatkov
c7c15f466c All operator usages are searched with new searcher
(cherry picked from commit af0b027)
2016-10-07 14:09:36 +03:00
Valentin Kipyatkov
8fa08230f2 Quick search of getValue/setValue operator usages
(cherry picked from commit ba76e4d)
2016-10-07 14:09:36 +03:00
Valentin Kipyatkov
2bd682ff01 Quick search of iterator operator usages
(cherry picked from commit 75a6b0c)
2016-10-07 14:09:35 +03:00
Valentin Kipyatkov
6254cdf55a Quick search of compareTo operator usages
(cherry picked from commit f2e5662)
2016-10-07 14:09:35 +03:00
Valentin Kipyatkov
65be3c7c53 Quick search of equals operator usages
(cherry picked from commit ee64a1a)
2016-10-07 14:09:35 +03:00
Valentin Kipyatkov
6f548ca64e Optimization
(cherry picked from commit 309d823)
2016-10-07 14:09:35 +03:00
Valentin Kipyatkov
68b6a63ed4 Use partial resolve multiple in operator reference search
(cherry picked from commit 4cc16e4)
2016-10-07 14:09:34 +03:00
Valentin Kipyatkov
b1c2f9a0a5 More efficient way
(cherry picked from commit f181458)
2016-10-07 14:09:34 +03:00
Valentin Kipyatkov
77cd15cced Renames
(cherry picked from commit 5f8dca2)
2016-10-07 14:09:34 +03:00
Valentin Kipyatkov
32c3c5d4bf Refactoring
(cherry picked from commit 32a436e)
2016-10-07 14:09:34 +03:00
Valentin Kipyatkov
d55b1571b1 Refactoring
(cherry picked from commit c8260f8)
2016-10-07 14:09:34 +03:00
Valentin Kipyatkov
60e11fe6c0 Added comments
(cherry picked from commit 7eac49b)
2016-10-07 14:09:33 +03:00
Valentin Kipyatkov
966d5417df More efficient way to check for Kotlin files
(cherry picked from commit 73e3180)
2016-10-07 14:09:33 +03:00
Valentin Kipyatkov
fcc0868dbb Added comments
(cherry picked from commit ee2d487)
2016-10-07 14:09:33 +03:00
Valentin Kipyatkov
02a3bf7b85 Renames
(cherry picked from commit ccc5d74)
2016-10-07 14:09:33 +03:00
Valentin Kipyatkov
c7504d2659 More correct quickfix testing - do not include suppression actions not available at caret
(cherry picked from commit c9bb360)
2016-10-07 14:09:32 +03:00
Valentin Kipyatkov
0abcb3dd78 Adapted to Kotlin 1.0 2016-10-07 14:09:32 +03:00
Valentin Kipyatkov
60cb71ed29 Renames
(cherry picked from commit aec2f19)
2016-10-07 14:09:32 +03:00
Valentin Kipyatkov
10ef92deda KT-8664 Hide componentX() functions for data classes from completion
#KT-8664 Fixed
(cherry picked from commit 2f5e820)
2016-10-07 14:09:32 +03:00
Valentin Kipyatkov
6aee7e9f8e KT-13728 Implicitly imported functions should be above in completion then non-imported
#KT-13728 Fixed
(cherry picked from commit 7263d0a)
2016-10-07 14:09:31 +03:00
Valentin Kipyatkov
5f76043511 KT-13833 javascript: Smart type completion to lower priority of dynamic type
#KT-13833 Fixed
(cherry picked from commit e8f4c65)
2016-10-07 14:09:31 +03:00
Valentin Kipyatkov
1ef76d4cd7 Refactoring + preserving formatting in some more places where it was missing
(cherry picked from commit dca094e)
2016-10-07 14:09:31 +03:00
Valentin Kipyatkov
2ee571e2e8 Some formatting preserving for special methods too
(cherry picked from commit 5a6f068)
2016-10-07 14:09:31 +03:00
Valentin Kipyatkov
56228b32d3 Code refactoring
(cherry picked from commit f4d9909)
2016-10-07 14:09:30 +03:00
Valentin Kipyatkov
f8e2a8fde9 KT-13628 New line is not preserved when converting java to Kotlin
#KT-13628 Fixed
(cherry picked from commit badbcd4)
2016-10-07 14:09:30 +03:00
Valentin Kipyatkov
5537432ce0 Fixed check for convention operator
(cherry picked from commit a552736)
2016-10-07 14:09:30 +03:00
Valentin Kipyatkov
fcb3a97408 Term changes
(cherry picked from commit 57faa5a)
2016-10-07 14:09:30 +03:00
Valentin Kipyatkov
2914c852d9 Changed String to Name
(cherry picked from commit 7699430)
2016-10-07 14:09:29 +03:00
Valentin Kipyatkov
69a4675303 Fixed optimize imports for operators
(cherry picked from commit 17adee6)
2016-10-07 14:09:29 +03:00
Valentin Kipyatkov
2a1e9f3fc4 Optimize imports to prevent accedential changes in resolve because of import priorities
#KT-11640 Fixed
(cherry picked from commit 95a3a29)
2016-10-07 14:09:29 +03:00
Valentin Kipyatkov
087d7743cd Minor
(cherry picked from commit f4c65da)
2016-10-07 14:09:29 +03:00
Denis Zharkov
073b0f1f5c Fix serialVersionUID for EmptyMap and EmptySet
Otherwise removal of redundant special stubs
leads to InvalidClassException during deserialization
2016-10-07 12:00:25 +03:00
Denis Zharkov
5c0edc2781 Avoid generation of redundant abstract special stubs
#KT-13698 Fixed
2016-10-07 12:00:25 +03:00
Denis Zharkov
56015462fc Avoid generation of redundant toArray stubs
#KT-13698 In Progress
2016-10-07 12:00:25 +03:00
Denis Zharkov
0a5cfe504b Optimize method count for collection stubs
Do not generate stubs if they're already present in superclasses

 #KT-13698 In Progress
2016-10-07 12:00:25 +03:00
Denis Zharkov
dd2f0f72b9 Write generic signature for autogenerated toArray
#KT-14195 Fixed
2016-10-07 12:00:25 +03:00
Denis Zharkov
81aa6ee957 Improve exception message in collection stubs 2016-10-07 12:00:25 +03:00
Denis Zharkov
5ce58a6a4c Do not generate collection stubs for Kotlin-specific signatures
#KT-14188 Fixed
2016-10-07 12:00:25 +03:00
Denis Zharkov
6ad102e746 Minor. Extract computation of collection mutable stub list
It's necessary in the next commits to obtain these signatures
without actually emitting any code
2016-10-07 12:00:25 +03:00
Nikolay Krasko
b028efa053 Enable using local caches by default for both TeamCity and local testing 2016-10-06 21:13:37 +03:00
Nikolay Krasko
59c28e4f64 Auto-remove local debugger caches on test data modification 2016-10-06 21:13:37 +03:00
Yan Zhulanow
73307a2ebd Increment PsiModificationTracker counter in a write action 2016-10-06 20:34:26 +03:00
Yan Zhulanow
ee26c19601 Kapt: Handle exceptions during annotation processing gracefully 2016-10-06 20:34:26 +03:00
Yan Zhulanow
5f2b5cf7ac Parse enum arrays correctly 2016-10-06 20:34:26 +03:00
Yan Zhulanow
b566a37f2e Kapt: Support apt options (KT-13984) 2016-10-06 20:34:26 +03:00
Yan Zhulanow
3e0b79e40a Add TransactionGuard application service to KotlinCoreEnvironment 2016-10-06 20:34:25 +03:00
Yan Zhulanow
d86a30bac6 Kapt: Dispose every JeElement and JeTypeMirror because some annotation processors may store them in static fields. (KT-13917)
Hello, Data Binding, why you cache them? :(
2016-10-06 20:34:25 +03:00
Yan Zhulanow
92c9ceaf6b Kapt: typeElement.asType() should preserve type parameters and propagate it to its supertypes (KT-13865) 2016-10-06 20:34:25 +03:00
Yan Zhulanow
59cdbcb587 Kapt: Add test on Map<Key, Intf> and MutableMap<Key, Intf> 2016-10-06 20:34:25 +03:00
Yan Zhulanow
2554d40f83 Kapt: Measure Annotation Processing time 2016-10-06 20:34:24 +03:00
Yan Zhulanow
2f44b0bcc5 Minor: add 'kapt' to dictionary 2016-10-06 20:34:24 +03:00
Yan Zhulanow
1677984250 Kapt: Simplify wrapper tests 2016-10-06 20:34:24 +03:00
Yan Zhulanow
0d97d73b8c Kapt: Support type parameters in asMemberOf() (KT-13804) 2016-10-06 20:34:24 +03:00
Yan Zhulanow
9f9ffdf278 Kapt: asMemberOf() should also check the containing type itself, not only its supertypes (KT-13823) 2016-10-06 20:34:24 +03:00
Yan Zhulanow
bd7a9c6cbd Dispose IntelliJ platform components after annotation processing complete.
Annotation processors may cache ProcessingEnvironment.
2016-10-06 20:34:23 +03:00
Dmitry Jemerov
a9a84c6517 1.0.5 changelog 2016-10-06 17:47:38 +02:00
shiraji
69ddcb5856 Refactoring to use Utils#resolvedToArrayType
(cherry picked from commit 0360d0e)
2016-10-06 14:39:46 +03:00
shiraji
1d0295d5c0 Inspection/Intention replace size check with 'isNotEmpty' and 'isEmpty' #KT-13937 Fixed
(cherry picked from commit 32b7b5a)
2016-10-06 14:39:32 +03:00
Alexey Tsvetkov
8ce7165ab6 Minor: JS test fix 2016-10-05 18:23:55 +03:00
Alexey Tsvetkov
e39005f349 Don't warn about absence of kotlin files
#KT-10401 fixed
2016-10-05 18:23:51 +03:00
Alexey Tsvetkov
7e5ac98f9e Avoid exception when getting relative path
#KT-14056 fixed Target versions 1.0.5
2016-10-05 18:23:45 +03:00
Alexey Tsvetkov
61f75ea7f4 Refactoring: use same module name as Intellij 2016-10-05 18:23:41 +03:00
Dmitry Jemerov
af3d9a453c allow to specify plugin.xml version number as build script parameter
(cherry picked from commit b6e1327)
2016-10-05 17:01:21 +02:00
Dmitry Jemerov
bac3b3a1a8 revert disable version override 2016-10-05 13:30:49 +02:00
Dmitry Jemerov
821ed4b5b1 disable version override 2016-10-05 13:16:17 +02:00
Dmitry Jemerov
0db9dbdd33 fix QualifiedNameTest
(cherry picked from commit 2bd9487)
2016-10-05 11:59:28 +02:00
Dmitry Jemerov
094da68b18 Merge remote-tracking branch 'origin/1.0.5' into 1.0.5 2016-10-05 11:35:32 +02:00
Denis Zharkov
95a949d855 Fix suppress at statement intention for asigmnents
There's no need now to consider precedence of element as
annotation preceding the beginning of block statement
is always now attached to the whole statement

 #KT-11673 Fixed
 #KT-12780 Fixed
2016-10-05 10:31:29 +03:00
Denis Zharkov
0cb41f51a2 Change parsing of statements starting with annotations
If a block statement starts with annotations treat them as they
belong to node of the statement rather than to the closest prefix expression

 #KT-10210 Fixed
2016-10-05 10:31:22 +03:00
Denis Zharkov
77ab2942c2 Remove effectively dead code in parser
`parseLabeledExpression` can only be called from `parsePrefixExpression`,
but the latter in the beginning tries to parse annotated expression,
thus advances any number of AT symbols
2016-10-05 10:31:15 +03:00
Dmitry Jemerov
11e8535551 fix find usages test
(cherry picked from commit 642027d)
2016-10-04 22:34:24 +02:00
Zalim Bashorov
2a31c4ca40 Make IDEA run configuration compatible with IDEA 2016.3; minor auto changes in run configurations.
(cherry picked from commit a07e80f)
2016-10-04 21:58:23 +03:00
Dmitry Jemerov
c430e4eb8f since build for 2016.2 version of the plugin 2016-10-04 19:19:58 +02:00
Dmitry Jemerov
c17edaa53a compilation fix; regenerate tests 2016-10-04 18:53:22 +02:00
Dmitry Jemerov
49bd3fe714 show type of control statements used as expressions
(cherry picked from commit dbbba45)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
d078ebf390 don't show function literals and selectors of qualified expressions in "show expression type"
(cherry picked from commit 02a5856)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
d7b48dc6f1 show detailed smart cast info in "Show expression type" (KT-8803)
(cherry picked from commit 256fd04)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
664213a2e7 don't include properties with declared return type and property accessors in "show expression type" popup
(cherry picked from commit 2141cd2)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
2b0b6bfa72 add test for obsolete KT-11601
(cherry picked from commit e8fcd19)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
690aaf0c14 don't show type of statements if they are not used as expressions
(cherry picked from commit 4f1f313)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
ed01b9be29 use short names in Show Expression Type
#KT-11310 Fixed

(cherry picked from commit 6dccfd3)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
472e3cc8fc test for handling smart casts in "show expression type"
#KT-10588 Fixed

(cherry picked from commit 4346afa)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
4a0995a470 handle multi-declarations in "show expression type"
(cherry picked from commit 032d50b)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
3bfccece79 don't offer functions with block body and functions with declared return type as candidates for "show expression type"
(cherry picked from commit fbd2c48)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
95400a7317 support "show expression type" in variable declaration position
#KT-10095 Fixed

(cherry picked from commit 7b644e2)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
49dbf3ca5d get rid of Kotlin specific "Show expression type" action
#KT-13142 Fixed

(cherry picked from commit 752a745)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
062673ed8b Java-compatible "Copy Reference" action for Kotlin
#KT-13140 Fixed

(cherry picked from commit 39ab1e9)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
0878ba595b show context when invoking Show Implementations from Find Usages popup
#KT-13475 Fixed

(cherry picked from commit cbb2e5c)
2016-10-04 18:53:22 +02:00
Dmitry Jemerov
45e2282426 show two levels of hierarchy when grouping find usages by file structure
#KT-9019 Fixed
 #KT-10178 Fixed

(cherry picked from commit e462a97)
2016-10-04 18:53:22 +02:00
Nikolay Krasko
46791a3852 Create special parameter for branch version auto-increment
Can be used when bootstrap branch differs from the one used for auto-increment.

Auto-increment is guarded by branch parameter to avoid accidental enabling after branches auto-merge.
2016-10-04 19:51:27 +03:00
Nikolay Krasko
02b59be068 J2K: AbstractBytecodeTextTest.java fix compile errors 2016-10-04 18:58:02 +03:00
Nikolay Krasko
93fce1190d J2K: AbstractBytecodeTextTest.java convert 2016-10-04 18:58:02 +03:00
Nikolay Krasko
8edd7be5f2 J2K: AbstractBytecodeTextTest.java rename 2016-10-04 18:58:02 +03:00
Nikolay Krasko
4f438bcd6f Refactoring: hide state of occurrence class 2016-10-04 18:58:02 +03:00
Nikolay Krasko
1ea92800b4 Test several line numbers are generated for one instruction 2016-10-04 18:58:02 +03:00
Nikolay Krasko
6b0938131a Regenerate tests: other order 2016-10-04 18:58:02 +03:00
Nikolay Krasko
5638f31533 Refactoring: no need in DebugProcessImpl.ResumeCommand for getting command action 2016-10-04 18:58:02 +03:00
Nikolay Krasko
0b60cbb944 Add cause exception to AssertionError 2016-10-04 18:58:02 +03:00
Nikolay Krasko
4b08bbd424 Refactoring: create step-over kotlin position and move counting step over specific to create action stage 2016-10-04 18:58:02 +03:00
Nikolay Krasko
2daac45d1b Refactoring: extract top-level functions from KotlinSteppingCommandProvider 2016-10-04 18:58:02 +03:00
Nikolay Krasko
f131be0dc4 Revert using temp directory for building debugger application by default 2016-10-04 18:58:02 +03:00
Denis Zharkov
7ae0f037ee Fix accidental overrides computation
Consider the whole overridden tree instead of only direct overridden

 #KT-14146 Fixed
2016-10-04 16:48:54 +03:00
Denis Zharkov
2d16501604 Set up tests for postfix templates properly
If there are some other completion-like tests before these ones
it may lead to the situation when some value is already written by
`previouslySuggestedExpressions`, so it should be cleared in setUp
2016-10-04 14:17:18 +03:00
Alexander Udalov
5eeb8d90d6 Report error on declaring 'getClass' in class or package
#KT-14147 Fixed

(cherry picked from commit 597912824b)
2016-10-04 10:52:56 +03:00
Dmitry Petrov
a87df61121 KT-14025 CCE in OverloadResolver.findRedeclarations 2016-10-03 12:00:25 +03:00
Denis Zharkov
f767c4e52d Replace local delegated property with it's emulation
Local delegated properties don't work in 1.0.5
2016-09-30 20:02:17 +03:00
Denis Zharkov
2a69b3b7c3 Refine expression kind definition in postfix templates
- Do not treat if without else as values
- Some statements aren't contained in block (see tests)

 #KT-14107 Fixed
 #KT-14110 Fixed
2016-09-30 18:48:12 +03:00
Denis Zharkov
7704ec233d Refine default postfix templates selector
There is new settings checkCanBeUsedAsValue
Also expression filtering are split into to parts:
- getNonFilteredExpressions is trivially goes until it reaches
first block body of some declarations
- all additional filtering is merged into Condition that is passed into
PostfixTemplateExpressionSelectorBase super-call

Notable changes for users:
- do not suggest try for non-top-level expressions
- do not suggest var/par/etc for loops
2016-09-30 18:48:12 +03:00
Denis Zharkov
013e35a929 Suggest postfix templates on lambda expressions 2016-09-30 18:48:12 +03:00
Denis Zharkov
fd1c59e24b Do not suggest assignment as a subject in postfix templates
#KT-14077 Fixed
2016-09-30 18:48:12 +03:00
Denis Zharkov
b5d58e70bd Allow if/when/try postfix templates in expression position
#KT-14078 Fixed
2016-09-30 18:48:12 +03:00
Denis Zharkov
e22f5419aa Suggest assert/return postfix templates only for statements
#KT-14079 Fixed
 #KT-14090 Fixed
2016-09-30 18:48:12 +03:00
Denis Zharkov
d1a0ad5023 Do not suggest operation references in postfix templates
#KT-14087 Fixed
2016-09-30 18:48:12 +03:00
Denis Zharkov
18a51694bc Enhance tests for postfix templates
Prohibit multiple suggested expressions in test mode
2016-09-30 18:48:12 +03:00
Valentin Kipyatkov
e466012d55 Fixed wrong test
(cherry picked from commit b0ed6ad)
2016-09-30 17:35:01 +03:00
Valentin Kipyatkov
ddd950c5a6 Fixed bug found because of incorrect test fixed
(cherry picked from commit 6baf633)
2016-09-30 17:34:51 +03:00
Valentin Kipyatkov
d30703aed4 Removed redundant and confusing .after files in negative tests
(cherry picked from commit be8b31e)
2016-09-30 17:34:01 +03:00
Valentin Kipyatkov
3048ba0eaa KT-13953 Import member popup should not suggest methods when only property or variable is valid
#KT-13953 Fixed
(cherry picked from commit 038068a)
2016-09-30 17:33:53 +03:00
Mikhail Glukhikh
47446b7442 Minor refactoring: convert secondary constructor to primary 2016-09-30 16:30:09 +03:00
Mikhail Glukhikh
9a3e6d3545 Minor: secondary constructor to primary is suggested only on keyword and value parameter list 2016-09-30 16:09:16 +03:00
Mikhail Glukhikh
aec0090ae2 KT-9839 related, secondary constructor to primary: inspection for the single constructor 2016-09-30 15:56:07 +03:00
Mikhail Glukhikh
48a1853d6d KT-9839 related, primary constructor to secondary: comment restoration 2016-09-30 15:55:57 +03:00
Mikhail Glukhikh
998e39e48b KT-9839 related, secondary constructor to primary: comment restoration 2016-09-30 15:55:48 +03:00
Mikhail Glukhikh
f3fa779762 KT-9839: intention introduced: convert secondary constructor to primary one #KT-9839 Fixed 2016-09-30 15:55:09 +03:00
Mikhail Glukhikh
b90414ac21 KT-9839: convert primary constructor to secondary one: leave independent properties in class body as is 2016-09-30 15:54:39 +03:00
Mikhail Glukhikh
93aaa48f33 KT-9839: intention introduced: convert primary constructor to secondary one 2016-09-30 12:27:46 +03:00
Alexey Andreev
c909b5c93c KT-13825: write simple name of class to constructor.$metadata$.simpleName. 2016-09-30 12:10:08 +03:00
Valentin Kipyatkov
da52b4c57b Fixed for old PSI and 1.0 Kotlin-syntax 2016-09-29 23:18:42 +03:00
Valentin Kipyatkov
5669df9a05 Fixed test data 2016-09-29 23:18:42 +03:00
Valentin Kipyatkov
1d97e42fba Returned lost inspection 2016-09-29 23:18:42 +03:00
Valentin Kipyatkov
52f8f2e56b Fixed compilation after cherry-picks 2016-09-29 23:18:41 +03:00
Valentin Kipyatkov
b76eac5b23 Corrections on code review
(cherry picked from commit 023c02d)
2016-09-29 23:18:41 +03:00
Valentin Kipyatkov
49fb93600b Better texts of change variable type quickfixes
(cherry picked from commit e4f80e2)
2016-09-29 23:18:41 +03:00
Valentin Kipyatkov
83b6080deb Made AddToStringFix low priority
(cherry picked from commit 80d82d2)
2016-09-29 23:18:41 +03:00
Valentin Kipyatkov
0d48b4895f Fix after cherry-pick 2016-09-29 23:18:40 +03:00
Valentin Kipyatkov
8547d00eac Better texts for quickfixes to change return type
(cherry picked from commit dab6f7d)
2016-09-29 23:18:40 +03:00
Valentin Kipyatkov
c2b28ec884 Fixed intentions
(cherry picked from commit f5a34ca)
2016-09-29 23:18:40 +03:00
Valentin Kipyatkov
23f00a27f8 KT-12852 Support breadcrumbs for Kotlin
#KT-12852 Fixed
(cherry picked from commit fcce1e3)
2016-09-29 23:18:39 +03:00
Valentin Kipyatkov
8d5ce01af3 Better tests
(cherry picked from commit f6b471a)
2016-09-29 23:18:39 +03:00
Valentin Kipyatkov
6c0c2fcb4a KT-13047 Autocomplete inserts a fully-qualified variable name inside a String
KT-12083 String interpolation -- auto {} if there is a letter after cursor

 #KT-13047 Fixed
 #KT-12083 Fixed
(cherry picked from commit 5bf701a)
2016-09-29 23:18:39 +03:00
Valentin Kipyatkov
4d12ebade3 Refactored to ensure use of correct options
(cherry picked from commit 1d24fc3)
2016-09-29 23:18:39 +03:00
Valentin Kipyatkov
f0085f0471 Fixed use of options
(cherry picked from commit 32e4a03)
2016-09-29 23:18:38 +03:00
Valentin Kipyatkov
6de07c3bf1 Shorten references to use analyze() for multiple elements
(cherry picked from commit fc27212)
2016-09-29 23:18:38 +03:00
Valentin Kipyatkov
274638c8fc Added TODO
(cherry picked from commit 6efb3ac)
2016-09-29 23:18:38 +03:00
Valentin Kipyatkov
0dde5403b4 Added TODO
(cherry picked from commit 215b870)
2016-09-29 23:18:37 +03:00
Valentin Kipyatkov
9ed8353982 Used analyze to multiple elements for copy/paste
(cherry picked from commit dd6b5ab)
2016-09-29 23:18:37 +03:00
Valentin Kipyatkov
b923f0a61e Minor
(cherry picked from commit 5a5a6d4)
2016-09-29 23:18:37 +03:00
Valentin Kipyatkov
3d09709af4 Implemented ability to analyze to multiple elements at once
(cherry picked from commit bcfa31d)
2016-09-29 23:18:37 +03:00
Valentin Kipyatkov
7c1241e318 KT-13675 Ctrl-W: cannot select type argument in return type
#KT-13675 Fixed
(cherry picked from commit 36c2b01)
2016-09-29 23:18:36 +03:00
Valentin Kipyatkov
e0b2ec370f Renamed file
(cherry picked from commit 73828d1)
2016-09-29 23:18:36 +03:00
Valentin Kipyatkov
88c4dbdf18 Fixed test data
(cherry picked from commit 8d16af4)
2016-09-29 23:18:35 +03:00
Valentin Kipyatkov
28112cf799 Supported object value access expressions
(cherry picked from commit 6d028fb)
2016-09-29 23:18:35 +03:00
Valentin Kipyatkov
fb175eb3fc Added TODO
(cherry picked from commit e8471b4)
2016-09-29 23:18:35 +03:00
Valentin Kipyatkov
4cd8f43c7c Added progress when searching invoke() by plain search
(cherry picked from commit 77dfbda)
2016-09-29 23:18:34 +03:00
Valentin Kipyatkov
fdea66de3e Fixes after cherry-picks 2016-09-29 23:18:34 +03:00
Valentin Kipyatkov
04e8579c4e Renamed class
(cherry picked from commit b1a6255)
2016-09-29 23:18:34 +03:00
Valentin Kipyatkov
0e21afa048 Added @TestOnly
(cherry picked from commit 29831f6)
2016-09-29 23:18:33 +03:00
Valentin Kipyatkov
244e71028c Better test
(cherry picked from commit 82089da)
2016-09-29 23:18:33 +03:00
Valentin Kipyatkov
479706ab28 Down-shift to plain search if reference in unknown language encountered
(cherry picked from commit 5b638f5)
2016-09-29 23:18:32 +03:00
Valentin Kipyatkov
c4eec30aa0 Minor refactoring
(cherry picked from commit e314e22)
2016-09-29 23:18:32 +03:00
Valentin Kipyatkov
c479a06db6 Minor optimization
(cherry picked from commit 63ed93d)
2016-09-29 23:18:32 +03:00
Valentin Kipyatkov
b1f98943fc Fixed the case of public from private class inheritance in Java
(cherry picked from commit a6a7075)
2016-09-29 23:18:31 +03:00
Valentin Kipyatkov
90fae9afb0 Covered case when variable of our type is multi-declaration entry
(cherry picked from commit 904017e)
2016-09-29 23:18:31 +03:00
Valentin Kipyatkov
713226a8ab Added comments
(cherry picked from commit 7b907e6)
2016-09-29 23:18:30 +03:00
Valentin Kipyatkov
8e08831ca7 Fixed test
(cherry picked from commit 2322ecb)
2016-09-29 23:18:30 +03:00
Valentin Kipyatkov
515d574faf Refactored reference searches to take read-actions when necessary
(cherry picked from commit 4e0c3fc)
2016-09-29 23:18:30 +03:00
Valentin Kipyatkov
ffcf51ca91 Converted to Kotlin and edited
(cherry picked from commit 637da2e)
2016-09-29 23:18:29 +03:00
Valentin Kipyatkov
73f99bdf4d Fixed assertion about read-action
(cherry picked from commit 843ff15)
2016-09-29 23:18:29 +03:00
Valentin Kipyatkov
c065eb9b8b Fixed find usages for Java's invoke()
(cherry picked from commit d7a94ac)
2016-09-29 23:18:28 +03:00
Valentin Kipyatkov
04351e3f71 KT-13605 Find Usages fails to find usages of component function defined in Java
#KT-13605 Fixed
(cherry picked from commit 4785568)
2016-09-29 23:18:28 +03:00
Valentin Kipyatkov
439c3b3e11 Fixed test data
(cherry picked from commit 5e52e74)
2016-09-29 23:18:28 +03:00
Valentin Kipyatkov
eefd74af5b Fixed operator references search for functions declared in Java
(cherry picked from commit 0158ff4)
2016-09-29 23:18:27 +03:00
Valentin Kipyatkov
1974187664 Fast search of contains operator
(cherry picked from commit f6fbd0b)
2016-09-29 23:18:27 +03:00
Valentin Kipyatkov
5597791e79 Optimization
(cherry picked from commit 5ce780c)
2016-09-29 23:18:27 +03:00
Valentin Kipyatkov
b9ce06e42b Fast get/set operators search
(cherry picked from commit 0f32574)
2016-09-29 23:18:26 +03:00
Valentin Kipyatkov
c4005ef4d4 Fast search of assignment operations
(cherry picked from commit eeea85c)
2016-09-29 23:18:26 +03:00
Valentin Kipyatkov
0be6e018df Fast unary operators search
(cherry picked from commit cdf3284)
2016-09-29 23:18:25 +03:00
Valentin Kipyatkov
a71e419897 More correct operator treatment
(cherry picked from commit 322df5b)
2016-09-29 23:18:25 +03:00
Valentin Kipyatkov
92327ae411 More information in log
(cherry picked from commit 43f8fbe)
2016-09-29 23:18:24 +03:00
Valentin Kipyatkov
0663311e9a Minor change in log
(cherry picked from commit e1c1c5f)
2016-09-29 23:18:24 +03:00
Valentin Kipyatkov
d3af0c03c4 More information in log
(cherry picked from commit 8fd9b4a)
2016-09-29 23:18:23 +03:00
Valentin Kipyatkov
de712c23c3 Implemented fast search for binary operators
(cherry picked from commit 1ca698c)
2016-09-29 23:18:23 +03:00
Valentin Kipyatkov
34fa529dda Refactored to avoid code duplication
(cherry picked from commit f2c0d13)
2016-09-29 23:18:22 +03:00
Valentin Kipyatkov
0bc08f3829 Implemented fast search for invoke operator calls
#KT-13643 Fixed
(cherry picked from commit e3b37f9)
2016-09-29 23:18:22 +03:00
Valentin Kipyatkov
0d5b5ed95b Refactored component usages search extracted search for expressions of given type
(cherry picked from commit e1c7d07)
2016-09-29 23:18:22 +03:00
Valentin Kipyatkov
18a2e31ad1 Minor
(cherry picked from commit d93525d)
2016-09-29 23:18:21 +03:00
Valentin Kipyatkov
8fbf667c89 Some more fixes 2016-09-29 23:18:21 +03:00
Valentin Kipyatkov
b507795f88 Do not include "operator" and "infix" into completion item text for override
(cherry picked from commit efac7a1)
2016-09-29 23:18:20 +03:00
Valentin Kipyatkov
dd9f6d9337 Minor changes
(cherry picked from commit e363809)
2016-09-29 23:18:19 +03:00
Valentin Kipyatkov
8bdc8d4ac6 Optimization: don't search named arguments
(cherry picked from commit 05fae1d)
2016-09-29 23:18:19 +03:00
Valentin Kipyatkov
58ce403746 More correct down-shifting to plain search
(cherry picked from commit 29f6108)
2016-09-29 23:18:18 +03:00
Valentin Kipyatkov
9c48638d58 Ignore usages in XML
(cherry picked from commit 6562412)
2016-09-29 23:18:17 +03:00
Valentin Kipyatkov
819ec7babe Fixed bug with class using data class as type parameter in supers list
(cherry picked from commit 06eea53)
2016-09-29 23:18:17 +03:00
Valentin Kipyatkov
1dee8189eb Use one KtDestructuringDeclarationReference per each entry - better highlight usages and other actions
(cherry picked from commit b332867)
2016-09-29 23:18:17 +03:00
Valentin Kipyatkov
c68dae16b6 Down-shifting to plain search when operator usage search required
(cherry picked from commit 9cd7e9d)
2016-09-29 23:18:16 +03:00
Valentin Kipyatkov
cb8ee4149e Fixed infinite recursion
(cherry picked from commit 5682c91)
2016-09-29 23:18:16 +03:00
Valentin Kipyatkov
0bd6308e78 Better testing
(cherry picked from commit 9022c71)
2016-09-29 23:18:16 +03:00
Valentin Kipyatkov
61a3a11b22 Fixed typo
(cherry picked from commit d2ee10d)
2016-09-29 23:18:15 +03:00
Valentin Kipyatkov
2a0fe9ed27 Supported usage in super type list without parenthesis
(cherry picked from commit 8bfc746)
2016-09-29 23:18:14 +03:00
Valentin Kipyatkov
6fb10c5983 Class literal access supported
(cherry picked from commit 5c1e42a)
2016-09-29 23:18:14 +03:00
Valentin Kipyatkov
dff9b37da9 Callable references handled
(cherry picked from commit 4cab04b)
2016-09-29 23:18:14 +03:00
Valentin Kipyatkov
961663935a Extracted method
(cherry picked from commit 6af9567)
2016-09-29 23:18:13 +03:00
Valentin Kipyatkov
31e98b23b1 Supported access to companion object members
(cherry picked from commit 450d0dd)
2016-09-29 23:18:13 +03:00
Valentin Kipyatkov
e2d67036da More actions logged in tests
(cherry picked from commit 63d4491)
2016-09-29 23:18:13 +03:00
Valentin Kipyatkov
af6c28ddc9 Removed unused
(cherry picked from commit 482225f)
2016-09-29 23:18:13 +03:00
Valentin Kipyatkov
f9848946a4 Better log
(cherry picked from commit 724886c)
2016-09-29 23:18:12 +03:00
Valentin Kipyatkov
8250d785a8 Split test for 'for'
(cherry picked from commit f447321)
2016-09-29 23:18:12 +03:00
Valentin Kipyatkov
cf2bac8e4c Split one more test
(cherry picked from commit c864fce)
2016-09-29 23:18:12 +03:00
Valentin Kipyatkov
def568acec Split test for whens
(cherry picked from commit 1221b6b)
2016-09-29 23:18:11 +03:00
Valentin Kipyatkov
3c52183e56 And one more split test
(cherry picked from commit dc1f2d5)
2016-09-29 23:18:11 +03:00
Valentin Kipyatkov
d79b934af4 One more split test
(cherry picked from commit be94fe7)
2016-09-29 23:18:11 +03:00
Valentin Kipyatkov
949137cf02 Split test
(cherry picked from commit 0d9656d)
2016-09-29 23:18:11 +03:00
Valentin Kipyatkov
f81bec2569 Better testing via logging of performed operations
(cherry picked from commit 2ca163a)
2016-09-29 23:18:10 +03:00
Valentin Kipyatkov
a6b97eeede Optimization
(cherry picked from commit 1e80ad3)
2016-09-29 23:18:10 +03:00
Valentin Kipyatkov
17c730c495 SAM-adapters supported
(cherry picked from commit 7a269a0)
2016-09-29 23:18:10 +03:00
Valentin Kipyatkov
6f138ee18d Added TODO
(cherry picked from commit d0d8ea7)
2016-09-29 23:18:10 +03:00
Valentin Kipyatkov
8d35065482 Disabled smart search for classes from library
(cherry picked from commit 1183816)
2016-09-29 23:18:09 +03:00
Valentin Kipyatkov
69cab90b90 Added TODO
(cherry picked from commit 6f21c07)
2016-09-29 23:18:09 +03:00
Valentin Kipyatkov
db6c5afe01 "!is" in when case
(cherry picked from commit e00c8d6)
2016-09-29 23:18:09 +03:00
Valentin Kipyatkov
85c8661a73 Handling of 2 more class of cases:
1. Function has parameter of functional type with our data class inside
2. Value of data class type used in a call with lambda
(cherry picked from commit 5b31020)
2016-09-29 23:18:08 +03:00
Valentin Kipyatkov
594d655970 this@ClassName supported
(cherry picked from commit ca2cd3d)
2016-09-29 23:18:08 +03:00
Valentin Kipyatkov
8e8471a3e1 Supported "is" in when entry condition
(cherry picked from commit 7687c16)
2016-09-29 23:18:08 +03:00
Valentin Kipyatkov
a29573f8d0 Different modes of search
Down-shift to plain search in non-test mode if unknown reference encountered
Internal action to check search algorithm
(cherry picked from commit ecb1910)
2016-09-29 23:18:08 +03:00
Valentin Kipyatkov
ab9083b445 Supported usages as doc-comments
(cherry picked from commit d13cdc6)
2016-09-29 23:18:07 +03:00
Valentin Kipyatkov
8d74b89d72 Supported usages as destructuring declaration for other class
(cherry picked from commit 696f382)
2016-09-29 23:18:07 +03:00
Valentin Kipyatkov
c533c692f7 Plain search inside members and extensions
(cherry picked from commit 80520b4)
2016-09-29 23:18:07 +03:00
Valentin Kipyatkov
72f16c2659 Correct processing of "is" check
(cherry picked from commit 3910f31)
2016-09-29 23:18:07 +03:00
Valentin Kipyatkov
4407081277 Added runReadAction (but it's incorrect anyway)
(cherry picked from commit 25ab660)
2016-09-29 23:18:06 +03:00
Valentin Kipyatkov
8c4778a4e0 Support for 'as' and temporary support for 'is'
(cherry picked from commit 5d427d8)
2016-09-29 23:18:06 +03:00
Valentin Kipyatkov
c759ad0f42 Initial implementation of faster component function usage search
(cherry picked from commit 1674beb)
2016-09-29 23:18:06 +03:00
Valentin Kipyatkov
26d84c73c3 Fixed test data
(cherry picked from commit 17edbac)
2016-09-29 23:18:05 +03:00
Simon Ogorodnik
447c0f1c74 MultiFile tests now support java + kotlin testing. // FILE directive now accepts path in source root instead of just name
(cherry picked from commit 67c916a)
2016-09-29 23:18:05 +03:00
Valentin Kipyatkov
bc4ac857b3 Minor changes on code review
(cherry picked from commit 5f24b68)
2016-09-29 23:18:05 +03:00
Valentin Kipyatkov
529a0a7739 Renamed classes
(cherry picked from commit 9cddd0d)
2016-09-29 23:18:05 +03:00
Valentin Kipyatkov
1f345e8dbc Don't use term "Static import" + refer quickfix by class name in negative tests
(cherry picked from commit cbae3d7)
2016-09-29 23:18:04 +03:00
Valentin Kipyatkov
cb00bb3a5c Changes on review of pull request
(cherry picked from commit 0072bf0)
2016-09-29 23:18:04 +03:00
Simon Ogorodnik
ae4629f07c Added tests, and fixed some bugs using it
(cherry picked from commit 939b476)
2016-09-29 23:18:04 +03:00
Simon Ogorodnik
1582ac8c02 Added ability to test quickfix with java dependencies
(cherry picked from commit 251d87f)
2016-09-29 23:18:04 +03:00
Simon Ogorodnik
67b76d87e5 Refactored to use exiting impl of AutoImportBase
(cherry picked from commit f40bb57)
2016-09-29 23:18:03 +03:00
Simon Ogorodnik
cb86542963 #KT-9009 fixed
(cherry picked from commit 9d56716)
2016-09-29 23:18:03 +03:00
Valentin Kipyatkov
08b3fd4913 Renamed method
(cherry picked from commit 512fb3f)
2016-09-29 23:18:03 +03:00
Valentin Kipyatkov
6789e790f3 Hopefully fixed EA-87200 - TCE: UtilsKt.tryChangeAndCheckErrors
#EA-87200 Fixed
(cherry picked from commit f21f237)
2016-09-29 23:18:02 +03:00
Valentin Kipyatkov
b685ee5782 Groupped tests by folders
(cherry picked from commit 2d875e5)
2016-09-29 23:18:02 +03:00
Valentin Kipyatkov
f5fa590fff sum and sumBy supported
(cherry picked from commit d0f6e25)
2016-09-29 23:18:01 +03:00
Valentin Kipyatkov
5d083b62e0 Corrected comment
(cherry picked from commit 7c92f79)
2016-09-29 23:18:01 +03:00
Valentin Kipyatkov
59f7bcc65b Better test
(cherry picked from commit 61d1826)
2016-09-29 23:18:00 +03:00
Valentin Kipyatkov
dcaf15dfda Math.max/min pattern for min/max supported
(cherry picked from commit 91954e1)
2016-09-29 23:18:00 +03:00
Valentin Kipyatkov
fe98642d01 Another pattern for min/max supported
(cherry picked from commit 84fd24a)
2016-09-29 23:18:00 +03:00
Valentin Kipyatkov
ec03f65b88 max()/minI() supported
(cherry picked from commit 930f796)
2016-09-29 23:17:59 +03:00
Valentin Kipyatkov
d53ab86999 KT-13482 "Loop can be replaced with stdlib operations" changes semantics
#KT-13482 Fixed
(cherry picked from commit 26cdd0d)
2016-09-29 23:17:59 +03:00
Valentin Kipyatkov
e62d144506 Preserve formatting of parenthesis in calls too
(cherry picked from commit 38edb58)
2016-09-29 23:17:59 +03:00
Valentin Kipyatkov
73b44b74aa Introduced Identifier.withNoPrototype()
(cherry picked from commit 8729420)
2016-09-29 23:17:58 +03:00
Valentin Kipyatkov
7419311a23 KT-11804 J2K: incorrect closing parenthesis position for method split to several lines
#KT-11804 Fixed
(cherry picked from commit 0554e17)
2016-09-29 23:17:58 +03:00
Valentin Kipyatkov
9688eb54b7 Use of Block.of()
(cherry picked from commit 20c17fc)
2016-09-29 23:17:58 +03:00
Valentin Kipyatkov
760fcc92f0 KT-13529 Java function is not always converted to Kotlin after paste
#KT-13529 Fixed
(cherry picked from commit c9d3353)
2016-09-29 23:17:58 +03:00
Valentin Kipyatkov
dd6b0f8c3b KT-13298 Suggest names for overridden properties / functions in completion
#KT-13298 Fixed
(cherry picked from commit 7f07890)
2016-09-29 23:17:57 +03:00
Valentin Kipyatkov
1abb37205a Moved class
(cherry picked from commit 7ebf001)
2016-09-29 23:17:57 +03:00
Valentin Kipyatkov
1dffd114d7 arrayListOf, mutableListOf, hashSetOf and mutableSetOf supported
(cherry picked from commit 8e6a01f)
2016-09-29 23:17:57 +03:00
Valentin Kipyatkov
d8d9809e33 More correct checking of smart cast preserving
(cherry picked from commit 054558a)
2016-09-29 23:17:56 +03:00
Valentin Kipyatkov
bc798db8a0 Added tests
(cherry picked from commit bfed954)
2016-09-29 23:17:56 +03:00
Valentin Kipyatkov
55a482f7e8 Added comment
(cherry picked from commit f5530c8)
2016-09-29 23:17:56 +03:00
Valentin Kipyatkov
7b51438034 Moved shouldUseInputVariable from Transformation to TransformationMatcher and changed its semantics a bit
(cherry picked from commit e327243)
2016-09-29 23:17:56 +03:00
Valentin Kipyatkov
737d3139e3 Added comment
(cherry picked from commit a5c7d4f)
2016-09-29 23:17:55 +03:00
Valentin Kipyatkov
b9b5f67143 Minor refactoring
(cherry picked from commit 50cd61e)
2016-09-29 23:17:55 +03:00
Valentin Kipyatkov
16fd7a3742 Used utility
(cherry picked from commit 407a3dd)
2016-09-29 23:17:55 +03:00
Valentin Kipyatkov
d9d5386ef1 Fixed bug
(cherry picked from commit dde397f)
2016-09-29 23:17:54 +03:00
Valentin Kipyatkov
a39ba4db65 Option to use 'asSequence()'
(cherry picked from commit bdd4363)
2016-09-29 23:17:54 +03:00
Valentin Kipyatkov
f82d788aae Minor
(cherry picked from commit acdf9e8)
2016-09-29 23:17:53 +03:00
Valentin Kipyatkov
9fd4b92905 Fixed bug with user data not cleared
(cherry picked from commit 77064c7)
2016-09-29 23:17:53 +03:00
Valentin Kipyatkov
920bde3048 Minor
(cherry picked from commit f4a04f0)
2016-09-29 23:17:53 +03:00
Valentin Kipyatkov
ab219ad3e0 More clear code
(cherry picked from commit c753e33)
2016-09-29 23:17:53 +03:00
Valentin Kipyatkov
c19a1a79b0 Typo correction
(cherry picked from commit 1fece52)
2016-09-29 23:17:52 +03:00
Valentin Kipyatkov
3bad66ffbd Formatting of "?:" onto the next line
(cherry picked from commit 128896f)
2016-09-29 23:17:52 +03:00
Valentin Kipyatkov
e29a4764f1 Code refactoring
(cherry picked from commit 9890ceb)
2016-09-29 23:17:52 +03:00
Valentin Kipyatkov
cefcde52a0 Added comments
(cherry picked from commit c9fa959)
2016-09-29 23:17:51 +03:00
Valentin Kipyatkov
83e8c2ff34 Removed warnings
(cherry picked from commit dd50f55)
2016-09-29 23:17:51 +03:00
Valentin Kipyatkov
75955c1a63 Added one more test
(cherry picked from commit 7c0f9a7)
2016-09-29 23:17:51 +03:00
Valentin Kipyatkov
7038378d2c Added test and asserts
(cherry picked from commit e5903f9)
2016-09-29 23:17:50 +03:00
Valentin Kipyatkov
be5eb571bc Corrected test data after rebase on master
(cherry picked from commit 8b4f8e8)
2016-09-29 23:17:50 +03:00
Valentin Kipyatkov
04fa7f8e92 Minor changes on code review
(cherry picked from commit da772e1)
2016-09-29 23:17:50 +03:00
Valentin Kipyatkov
bfde50d083 "Use withIndex()" intention&inspection
(cherry picked from commit d658d3b)
2016-09-29 23:17:49 +03:00
Valentin Kipyatkov
c7a64e697e Refactoring
(cherry picked from commit 46055df)
2016-09-29 23:17:49 +03:00
Valentin Kipyatkov
0abbfecfbc Added utility from master 2016-09-29 23:17:49 +03:00
Valentin Kipyatkov
00c3f25a7c Supported index++ pattern as non-last statement and even inside expressions
(cherry picked from commit ebdff775f3)
2016-09-29 23:17:49 +03:00
Valentin Kipyatkov
5b4da3350a Added TODO
(cherry picked from commit 2c90114)
2016-09-29 23:17:48 +03:00
Valentin Kipyatkov
bb10b3dd15 Supported forEachIndexed
(cherry picked from commit 4094d77)
2016-09-29 23:17:48 +03:00
Valentin Kipyatkov
dbef33a3ef Supported forEach
(cherry picked from commit f28dca1)
2016-09-29 23:17:48 +03:00
Valentin Kipyatkov
0d37461cda Checking type of the collection being iterated
(cherry picked from commit 394cce8)
2016-09-29 23:17:47 +03:00
Valentin Kipyatkov
a005ab96ab Minor changes on code review
(cherry picked from commit 89dab52)
2016-09-29 23:17:47 +03:00
Valentin Kipyatkov
bc8d4d43a5 Supported indexOf/lastIndexOf
(cherry picked from commit c2103e2)
2016-09-29 23:17:47 +03:00
Valentin Kipyatkov
46a3db0557 Code simplification
(cherry picked from commit c080ecb)
2016-09-29 23:17:46 +03:00
Valentin Kipyatkov
64d32fd366 Refactoring
(cherry picked from commit 87c9af5)
2016-09-29 23:17:46 +03:00
Valentin Kipyatkov
5fb4cde8cc Supported contains()
(cherry picked from commit 834fe9d)
2016-09-29 23:17:46 +03:00
Valentin Kipyatkov
c6fbd620ce Fixed some cases when smart cast problems were not detected
(cherry picked from commit 833f62e)
2016-09-29 23:17:45 +03:00
Valentin Kipyatkov
b43368a4e8 Remove fq-name
(cherry picked from commit fe52bed)
2016-09-29 23:17:45 +03:00
Valentin Kipyatkov
47c7625498 Merging loop with initialization before in more cases + better formatting
(cherry picked from commit e8904d7)
2016-09-29 23:17:45 +03:00
Valentin Kipyatkov
a738015685 Refactoring
(cherry picked from commit 5ddac24)
2016-09-29 23:17:45 +03:00
Valentin Kipyatkov
77e4306f8b Supported indexOfFirst/indexOfLast
(cherry picked from commit b65ecdd)
2016-09-29 23:17:44 +03:00
Valentin Kipyatkov
b0408408b6 Merging subsequent filtering checks even when index variable is used
(cherry picked from commit 5ac2c48)
2016-09-29 23:17:44 +03:00
Valentin Kipyatkov
8ecfa447b4 Do not generate redundant .toList()
(cherry picked from commit aa6240a)
2016-09-29 23:17:44 +03:00
Valentin Kipyatkov
a9e770b513 Added TODO
(cherry picked from commit 813060f)
2016-09-29 23:17:43 +03:00
Valentin Kipyatkov
b3f60d1d96 Minor
(cherry picked from commit 9ea6341)
2016-09-29 23:17:43 +03:00
Valentin Kipyatkov
88c4dbc941 Merged all map-transformations into one class
(cherry picked from commit 4efc8fa)
2016-09-29 23:17:43 +03:00
Valentin Kipyatkov
126773e453 Supported mapIndexedTo and mapIndexedNotNullTo
(cherry picked from commit b6e05e0)
2016-09-29 23:17:42 +03:00
Valentin Kipyatkov
e8f5009236 Supported mapNotNullTo
(cherry picked from commit 2652ea4)
2016-09-29 23:17:42 +03:00
Valentin Kipyatkov
1f115801aa Supported other patterns for mapNotNull
(cherry picked from commit 8c7cdf1)
2016-09-29 23:17:42 +03:00
Valentin Kipyatkov
f79b61f6a6 Prohibiting incorrect transformations of loops with expression-embedded break or continue + allowed "?: continue" pattern for mapNotNull
(cherry picked from commit a6132c7)
2016-09-29 23:17:41 +03:00
Valentin Kipyatkov
0c512922ee Checking that target collection is always the same
(cherry picked from commit cfc82c5)
2016-09-29 23:17:41 +03:00
Valentin Kipyatkov
5c11d7bdbf takeWhile supported
(cherry picked from commit 3f563f7)
2016-09-29 23:17:41 +03:00
Valentin Kipyatkov
ff05ce7a5f filterNotTo supported
(cherry picked from commit 9ff0f4d)
2016-09-29 23:17:40 +03:00
Valentin Kipyatkov
c334a6ab31 filterIsInstanceTo NOT supported
(cherry picked from commit 0a61e5b)
2016-09-29 23:17:40 +03:00
Valentin Kipyatkov
3c0d8e3e3f filterNotNullTo supported
(cherry picked from commit 395e61c)
2016-09-29 23:17:40 +03:00
Valentin Kipyatkov
62e8b24b37 Supported filterIndexedTo
(cherry picked from commit 318f3df)
2016-09-29 23:17:39 +03:00
Valentin Kipyatkov
5522860727 Reduced amount of ResultTransformation implementations
(cherry picked from commit 7c473e7)
2016-09-29 23:17:39 +03:00
Valentin Kipyatkov
246162aa3b More correct and easy comment restoring range management
(cherry picked from commit a07bbf4)
2016-09-29 23:17:39 +03:00
Valentin Kipyatkov
0e50ba7195 Supported case when result variable initialization is not right before the loop
(cherry picked from commit 27063bc)
2016-09-29 23:17:38 +03:00
Valentin Kipyatkov
97c29e27fd Split into more files
(cherry picked from commit 9b69c5c)
2016-09-29 23:17:38 +03:00
Valentin Kipyatkov
8d2d019f3f Moved classes into separate file
(cherry picked from commit b24aee9)
2016-09-29 23:17:38 +03:00
Valentin Kipyatkov
907513444d Recognizing manually incremented index
(cherry picked from commit d61daed)
2016-09-29 23:17:37 +03:00
Valentin Kipyatkov
4e1288171a Initial support for indexed transformations
(cherry picked from commit 14e87b1)
2016-09-29 23:17:37 +03:00
Valentin Kipyatkov
1ad4c46024 Transformation not necessary has real input variable
(cherry picked from commit 955e116)
2016-09-29 23:17:37 +03:00
Valentin Kipyatkov
42a067362f Checking that input variable is really used
(cherry picked from commit e0a7e1d)
2016-09-29 23:17:36 +03:00
Valentin Kipyatkov
7bfce47c20 More usable caret position
(cherry picked from commit 345f2b8)
2016-09-29 23:17:36 +03:00
Valentin Kipyatkov
cbb659b8bd Supported "count()"
(cherry picked from commit db53794)
2016-09-29 23:17:36 +03:00
Valentin Kipyatkov
fbaf7d5c8f Better formatting in some cases
(cherry picked from commit 53e3a67)
2016-09-29 23:17:35 +03:00
Valentin Kipyatkov
859e5af211 More informative intention action text
(cherry picked from commit fe7ddbc)
2016-09-29 23:17:35 +03:00
Valentin Kipyatkov
d0efb6692c Check that "break" and "continue" do not produce false errors when using analyzeInContext
(cherry picked from commit bbb6ef4)
2016-09-29 23:17:35 +03:00
Valentin Kipyatkov
d4a5945d75 Sometimes shorter code with filterTo, mapTo and flatMapTo
(cherry picked from commit 49f2c5f)
2016-09-29 23:17:35 +03:00
Valentin Kipyatkov
0336cde501 One more case when mapTo can be generated
(cherry picked from commit 7441864)
2016-09-29 23:17:34 +03:00
Valentin Kipyatkov
705911ca51 AddToCollectionTransformation checks that the result collection type cannot be changed
(cherry picked from commit db0028c)
2016-09-29 23:17:34 +03:00
Valentin Kipyatkov
14261441c4 Basic support for "add" to collection used inside the loop
(cherry picked from commit f51c5a1)
2016-09-29 23:17:34 +03:00
Valentin Kipyatkov
b973ce3af3 flatMapTo supported
(cherry picked from commit d3721e9)
2016-09-29 23:17:34 +03:00
Valentin Kipyatkov
e1fa681239 Consistent use of term "input variable" instead of "working variable"
(cherry picked from commit f3c7606)
2016-09-29 23:17:33 +03:00
Valentin Kipyatkov
2256c8c344 Moved check about old working variable not needed into common place
(cherry picked from commit df08493)
2016-09-29 23:17:33 +03:00
Valentin Kipyatkov
a4a26f05fc Initial support for "+=", filterTo and mapTo for collections
(cherry picked from commit 22fb397)
2016-09-29 23:17:33 +03:00
Valentin Kipyatkov
d8c72d866e Supported initialization with assignment instead of declaration
(cherry picked from commit ac46684)
2016-09-29 23:17:33 +03:00
Valentin Kipyatkov
21ef97b877 Refactoring
(cherry picked from commit 1fe84b8)
2016-09-29 23:17:32 +03:00
Valentin Kipyatkov
6a06857651 Elvis operator supported for all cases of find
(cherry picked from commit bd6b389)
2016-09-29 23:17:32 +03:00
Valentin Kipyatkov
7eca558458 firstOrNull() ?: ... supported
(cherry picked from commit 7980049)
2016-09-29 23:17:32 +03:00
Valentin Kipyatkov
483bcee381 More relaxed checks for any() with return
(cherry picked from commit 14ef93a)
2016-09-29 23:17:32 +03:00
Valentin Kipyatkov
16bd85985e Generating more simple construct instead of "let" in some cases
(cherry picked from commit ff0bb4f)
2016-09-29 23:17:31 +03:00
Valentin Kipyatkov
89ce911a45 Generating "firstOrNull()?.let {...}"
(cherry picked from commit a760ef3)
2016-09-29 23:17:31 +03:00
Valentin Kipyatkov
2bdc71ed65 More cases supported for "any"
(cherry picked from commit fba9b12)
2016-09-29 23:17:31 +03:00
Valentin Kipyatkov
c746a2a899 Supported "lastOrNull" and "any" without break in the loop
(cherry picked from commit c0f3ab5)
2016-09-29 23:17:30 +03:00
Valentin Kipyatkov
f33b7b2517 Added comments
(cherry picked from commit 0243efd)
2016-09-29 23:17:30 +03:00
Valentin Kipyatkov
dd6d821b91 Merging subsequent .filter()'s
(cherry picked from commit fcbf686)
2016-09-29 23:17:30 +03:00
Valentin Kipyatkov
fdca08480b Refactored API to allow merging ResultTransformation with any kind of previous transformation
(cherry picked from commit 6dbd9c9)
2016-09-29 23:17:30 +03:00
Valentin Kipyatkov
58d69c963d Cannot transform to flatMap if old working variable used in the nested loop
(cherry picked from commit d776277)
2016-09-29 23:17:29 +03:00
Valentin Kipyatkov
2ba0e5c04e Minor changes after code review
(cherry picked from commit 50bd766)
2016-09-29 23:17:29 +03:00
Valentin Kipyatkov
618613c593 Check for continue-statement of the inner loop!
(cherry picked from commit 8630407)
2016-09-29 23:17:29 +03:00
Valentin Kipyatkov
a864e7b816 Checking that smart casts will not be broken by conversion
(cherry picked from commit 8c498af)
2016-09-29 23:17:29 +03:00
Valentin Kipyatkov
f449088470 Temporary fix
(cherry picked from commit 978fc46)
2016-09-29 23:17:28 +03:00
Valentin Kipyatkov
fa94c57cf4 Initial implementation of loop-to-call-chain intention
(cherry picked from commit 12b1a99)
2016-09-29 23:17:28 +03:00
Valentin Kipyatkov
68463a5f19 KtExpression.analyzeInContext uses correct context when analyzing return's
(cherry picked from commit c50cf13611)
2016-09-29 23:17:27 +03:00
Zalim Bashorov
6e8ad80eeb Fix build 2016-09-29 20:15:58 +03:00
Ilya Gorbunov
afd305453a Minor: replace var with val.
(cherry picked from commit 47be8e6)
2016-09-29 18:57:45 +03:00
Ilya Gorbunov
2aaffafb74 Fix working directory where CompilerSmokeTest runs to be 'project.build.directory', otherwise it may vary depending on maven goals invoked.
(cherry picked from commit 2c0edf6)
2016-09-29 18:57:45 +03:00
Ilya Gorbunov
709a2f68f7 Reorder maven project modules to run more tests earlier in build.
(cherry picked from commit 0cd0f3c)
2016-09-29 18:57:45 +03:00
Ilya Gorbunov
ff3d68281a Use explicit public visibility in kotlin-runtime.
(cherry picked from commit 71af020)
2016-09-29 18:57:45 +03:00
Alexey Sedunov
f1cdf1ecac Extract Class: Implement 'Extract Interface' refactoring
#KT-11017 Fixed
(cherry picked from commit b412edf)
2016-09-29 18:24:33 +03:00
Alexey Sedunov
737c368022 Extract Class: Implement 'Extract Superclass' refactoring
#KT-11017 In Progress
(cherry picked from commit af2de09)
2016-09-29 18:24:32 +03:00
Zalim Bashorov
7cb2f2373c JPS: don't consider that the module is not Kotlin JS until check all libraries.
#KT-14082 Fixed

(cherry picked from commit 797f7ab)
2016-09-29 16:40:57 +03:00
Alexey Tsvetkov
c5408c99e5 Refactoring: move gradle tests imported from jps to separate dir
This will allow skipping jps tests when running all tests in directory from Intellij
2016-09-29 15:28:11 +03:00
Alexey Tsvetkov
6e6c576418 Refactoring: move gradle integration tests to separate module 2016-09-29 15:28:11 +03:00
Alexey Tsvetkov
a1ba51992c Refactoring: specify internal visibility where possible 2016-09-29 15:28:11 +03:00
Alexey Tsvetkov
fef3eb6171 Refactoring: use daemon by default in gradle tests 2016-09-29 15:28:11 +03:00
Alexey Tsvetkov
bfc94f6347 Refactoring: cleanup build.gradle files in tests 2016-09-29 15:28:11 +03:00
Alexey Tsvetkov
44748751c7 Refactoring: extract kotlin_version constant for gradle tests 2016-09-29 15:28:11 +03:00
Alexey Tsvetkov
f755d3db76 Refactoring: cleanup after merge 2016-09-29 15:28:11 +03:00
Alexey Tsvetkov
154ff311cf Refactoring: merge modules 'kotlin-gradle-plugin-dsl', 'kotlin-gradle-plugin-core' into 'kotlin-gradle-plugin' 2016-09-29 15:28:11 +03:00
Alexey Tsvetkov
40bca72e77 Generate gradle options from compiler arguments
#KT-13633 fixed
2016-09-29 15:28:11 +03:00
Alexey Tsvetkov
6a0957cbbe Track changes in java files generated by kapt2
#KT-13500 fixed
2016-09-29 15:28:11 +03:00
Stanislav Erokhin
b68f02c093 Changes in project for compatibility with plugin 1.1 in branch 1.0.x.
Added imports for java.lang.IllegalArgumentException and removed language-version 1.0.
Because of this changes it is possible to build branch 1.0.x use plugin 1.1.
When we fix bug with typealias and add language version to IDE we should reverse this commit.
2016-09-29 14:44:01 +03:00
Stanislav Erokhin
fcf9bfdfed Fix EA-86841 and EA-79267. 2016-09-29 14:44:00 +03:00
Alexey Andreev
6780de7fae JS: backporting changes in JS test infrastructure to 1.0.x 2016-09-29 14:28:12 +03:00
Alexey Andreev
e7e8d9ae0e JS: move RTTI tests to proper location 2016-09-29 14:28:11 +03:00
Alexey Andreev
ffd5119f5d JS: describe how to run tests in node.js 2016-09-29 14:28:11 +03:00
Alexey Andreev
7e53495d1c JS: fix remaining tests. Suppress extensionFromTopLevelUnitOneStringArg.kt, use another approach to check whether object's property accessed via this 2016-09-29 14:28:11 +03:00
Alexey Andreev
bdb82d94a3 JS: fix bugs in test environment for mocha.js 2016-09-29 14:28:10 +03:00
Alexey Andreev
6f621b1b0b JS: make most of box tests running in mocha.js 2016-09-29 14:28:10 +03:00
Alexey Andreev
1c4cc9db7c JS: move more test to box tests 2016-09-29 14:28:09 +03:00
Alexey Andreev
2fa69e819e JS: move more test to box tests 2016-09-29 14:28:09 +03:00
Alexey Andreev
f90130167c JS: move more test to box tests 2016-09-29 14:28:08 +03:00
Alexey Andreev
7790354aaf JS: move more test to box tests 2016-09-29 14:28:08 +03:00
Alexey Andreev
99274d2743 JS: move more test to box tests 2016-09-29 14:28:08 +03:00
Alexey Andreev
5d62a849d2 JS: move more test to box tests 2016-09-29 14:28:07 +03:00
Alexey Andreev
0baf560dca JS: move more test to box tests 2016-09-29 14:28:07 +03:00
Alexey Andreev
7afceb544c JS: move inline test to box tests 2016-09-29 14:28:06 +03:00
Alexey Andreev
ec45022b5b JS: move expressions test to box tests 2016-09-29 14:28:06 +03:00
Alexey Andreev
493f3d4ff4 JS: create new common directory for all generated tests, migrate several tests there 2016-09-29 14:28:05 +03:00
Alexey Andreev
fa38b7606e JS: refactor test classes 2016-09-29 14:28:05 +03:00
Alexey Andreev
e6764a4ae3 JS: move InlineMultiModuleTestGenerated under new test class 2016-09-29 14:28:04 +03:00
Alexey Andreev
361d2f1146 JS: introduce a new base class for generated tests 2016-09-29 14:28:04 +03:00
Mikhail Glukhikh
c89f4db320 CFA minor: retain initialization state while analyzing variable declaration 2016-09-29 13:16:23 +03:00
Mikhail Glukhikh
4a96589c15 CFA merge for definition / initialization : more accurate handling of unknown variables #KT-13969 Fixed 2016-09-29 12:47:01 +03:00
Dmitry Jemerov
5eda3a4481 access archive.apache.org via plain HTTP
(cherry picked from commit a1acd04)
2016-09-28 15:31:41 +02:00
Dmitry Jemerov
4d1a7b261a download each IDEA version into separate directory
(cherry picked from commit 53cd079)
2016-09-28 14:51:40 +02:00
Denis Zharkov
8e14b4a3f5 Fix AssertionError in CodegenUtil.getDelegates
Change getAllOverriddenDescriptors contracti, now it returns
original (not substituted) descriptors without any duplicates.

First of all it's necessary in CodegenUtil.getDelegates to avoid
duplicates (see assertion there), but also it's convenient for all
other usages of this method

 #KT-8154 Fixed
2016-09-28 11:52:59 +03:00
Denis Zharkov
cabe9afdc7 Minor. Simplify CodegenUtil.getDelegates 2016-09-28 11:52:59 +03:00
Denis Zharkov
0bd5109b8a Add a couple of covariant necessary overrides
They become unavoidable after checking override conflicts
for delegation members
2016-09-28 11:52:59 +03:00
Denis Zharkov
064d8960f3 Prohibit return type mismatch for delegation members
#KT-13952 Fixed
 #KT-13005 Fixed
2016-09-28 11:52:59 +03:00
Denis Zharkov
f4b4ed144b Minor. Extract subinterface for specific strategy
It contains only methods related to explicitly declared overrides
2016-09-28 11:52:59 +03:00
Dmitry Jemerov
7087d6ecda go back to archive.apache.org for Ant downloads
(cherry picked from commit 0daa2d8)
2016-09-28 10:32:58 +02:00
shiraji
cb88f3a6f7 Add intention to replace Math.max/min with coerceAtLeast/coerceAtMost #KT-13945 Fixed
(cherry picked from commit 3aedf0d)
2016-09-27 20:07:05 +03:00
Mikhail Glukhikh
e17f22225f Remove unnecessary lateinit intention / inspection removed (supported in compiler CFA instead) 2016-09-27 18:30:42 +03:00
Mikhail Glukhikh
77f7bb0fc1 Quick-fix for UNNECESSARY_LATEINIT 2016-09-27 18:30:37 +03:00
Mikhail Glukhikh
09c0865853 UNNECESSARY_LATEINIT: do not report if property is not initialized at use-site #KT-13806 Fixed 2016-09-27 18:30:33 +03:00
Mikhail Glukhikh
88f9938bc6 UNNECESSARY_LATEINIT warning introduced #KT-13295 Fixed 2016-09-27 18:30:16 +03:00
Denis Zharkov
af692e2453 Add filtering of suggested expressions for postfix templates
Do not suggest qualified expression's selector or a part of user type
because they aren't really independent expressions
2016-09-27 17:37:31 +03:00
Dmitry Jemerov
1c5fedeb7e use plain HTTP for downloading AntForKotlin
(cherry picked from commit e30c211)
2016-09-27 16:20:45 +02:00
Alexey Sedunov
c1c62ec54f Introduce Variable: Fix exception on trying to extract variable of functional type
#KT-14004 Fixed
(cherry picked from commit ca482c3)
2016-09-27 14:09:05 +03:00
Alexey Sedunov
174e208cfe Remove Redundant Receiver Parameter: Do not run refactoring inside write action
#KT-13878 Fixed
(cherry picked from commit 0693632)
2016-09-27 14:08:59 +03:00
Denis Zharkov
66d788be7d ModuleDescriptor: invert "friends" relation
Fixes memory leak caused by modules storing their friends (which can be potentially recreated many times)
2016-09-27 12:08:53 +03:00
Denis Zharkov
d7b96519bb Introduce preserve.1.0.4.compatibility VM option
Also add implementation of compatibility mode for relevant inference
refinements in 1.0.5
2016-09-27 10:10:24 +03:00
Pavel V. Talanov
0b82a310ef Light classes: getOwnInnerClasses() filters out inner classes with null names
#KT-13927 Fixed
2016-09-26 19:54:05 +03:00
Simon Ogorodnik
f8d93085c4 KT-13146 J2K recursion while converting self-referenced anonymous functions (#956)
(cherry picked from commit 47bfb81)
2016-09-26 12:56:20 +02:00
Alexander Udalov
e5df475fdc Fix compilation error 2016-09-24 13:40:28 +03:00
Alexander Udalov
d1b49c8321 Remove recursion workaround from DeprecatedClassifierUsageChecker
(cherry picked from commit 9bc6d6ae92)
2016-09-24 11:55:49 +03:00
Alexander Udalov
a72f871347 Move ClassifierUsageChecker invocation lower in LazyTopDownAnalyzer
Invoking checkers right after resolution of qualified expressions is too early:
DeprecatedClassifierUsageChecker tries to load the annotations of a referenced
classifier to report deprecation, and that may result in building light classes
for not yet analyzed declarations

 #KT-13954 Fixed

(cherry picked from commit dca99c3fd2)
2016-09-24 11:55:26 +03:00
Alexander Udalov
53f0780153 Rename LanguageFeatureSettings -> LanguageVersionSettings
(cherry picked from commit c91f77f2a4)
2016-09-24 11:54:08 +03:00
Alexander Udalov
6f2164dfa4 Uninherit LanguageVersion from LanguageFeatureSettings
Introduce LanguageVersionSettingsImpl to store everything related to the
selected language version

(cherry picked from commit aec31bd88f)
2016-09-24 11:38:20 +03:00
Nikolay Krasko
8b899a7cf5 Allow to avoid rebuilding application in debugger tests on local machine 2016-09-24 01:29:12 +03:00
Nikolay Krasko
f3badb6435 Clean application after test in compiler tests
It's disposed after Disposer.dispose(myTestRootDisposable) in tearDown and mixing compiler tests
with non-compiler tests may ruin classes initialization with

"com.intellij.util.IncorrectOperationException: Sorry but parent: com.intellij.mock.MockApplicationEx@52439591 has already been disposed"
2016-09-24 01:29:10 +03:00
Nikolay Krasko
c5e90f7b91 Patch ThreadTracker during Kotlin plugin init
(cherry picked from commit 63943c60d3)
2016-09-24 01:29:09 +03:00
Nikolay Krasko
4723bb12d8 Fix tests for looking implementations from Java - no search for Kotlin declaration from usages
Probably because of this commit: 7d95ff4d86

(cherry picked from commit 37fb8d6306)
2016-09-24 01:29:07 +03:00
Nikolay Krasko
85dedde6bb Solve thread leaking problem in intellij idea ultimate with obfuscated fileds
(cherry picked from commit 4adfb18990)
2016-09-24 01:29:06 +03:00
Nikolay Krasko
9c8ba4620f Problem: fix thread leaking check fail on teamcity for ultimate rename tests
(cherry picked from commit d69e7c7aec)
2016-09-24 01:29:04 +03:00
Nikolay Krasko
2879693c39 Problem: workaround thread leaking problem
(cherry picked from commit ea1aac07ec)
2016-09-24 01:29:03 +03:00
Nikolay Krasko
1af4b5e634 Register TypeAnnotationModifier EP in environment for web demo converter
(cherry picked from commit 835474e5a1)
2016-09-24 01:29:01 +03:00
Nikolay Krasko
a4f641c44a Ignore irrelevant java classes in search results
It looks like JavaClassInheritorsSearcher started to give classes based on useScope

(cherry picked from commit bf12908dfc)
2016-09-24 01:28:59 +03:00
Nikolay Krasko
c6d120f264 Fix goto implementation tests - deffered task should be executed
(cherry picked from commit 6cdb578f76)
2016-09-24 01:28:58 +03:00
Nikolay Krasko
e5b9e4e5ad Add standard inheritors to hierarchy test
(cherry picked from commit 00db1c1490)
2016-09-24 01:28:56 +03:00
Nikolay Krasko
9734c42d1d Make caret left move not-applicable on first function parameter
(cherry picked from commit 89a1389512)
2016-09-24 01:28:55 +03:00
Nikolay Krasko
0ba2cbeb26 Update to 2016.2.3
(cherry picked from commit 5337fd05fb)
2016-09-24 01:28:53 +03:00
Nikolay Krasko
fe8857ad2b Don't run applicationEx.invokeAndWait in testing mode
(cherry picked from commit 7b19454d58)
2016-09-24 01:28:52 +03:00
Nikolay Krasko
d594a94070 Test only: method signature changed
(cherry picked from commit 058dbd3375)
2016-09-24 01:28:50 +03:00
Nikolay Krasko
946f4ca7cd Update compilation in 2016.2
(cherry picked from commit 80bf0b9c3e)
2016-09-24 01:28:49 +03:00
Nikolay Krasko
df9b14b9b2 Update to 162.1447.7
(cherry picked from commit 4b9b3b07e7)
2016-09-24 01:28:47 +03:00
Denis Zharkov
a26c0da48a Use editor instead of file in TypingIndentationTest
Nobody guarantees that changes in editor are saved immediately

(cherry picked from commit 329c1a1e72)
2016-09-24 01:28:46 +03:00
Denis Zharkov
8b561774be Temporary move annotation to methods' modifier list
Java resolver ignores return type annotations if there are ones on modifier list

Related to this commit a2497edcee

(cherry picked from commit 10c840327d)
2016-09-24 01:28:44 +03:00
Denis Zharkov
c30a1a861b Implement a bunch of string based postfix templates
#KT-4710 Fixed

(cherry picked from commit 189705727f)
2016-09-24 01:28:43 +03:00
Denis Zharkov
a612c94004 Implement for/iter postfix templates
#KT-4710 In Progress

(cherry picked from commit 1b39112)
2016-09-24 01:28:41 +03:00
Denis Zharkov
87a8b915a7 Introduce var/val postfix templates
#KT-4710 In Progress

(cherry picked from commit b702886f0d)
2016-09-24 01:28:38 +03:00
Denis Zharkov
514006bcb6 Minor. Introduce 'isVar' parameter for KotlinIntroduceVariableHandler.doRefactoring
(cherry picked from commit 7ba914f92a)
2016-09-24 01:28:36 +03:00
Denis Zharkov
d478ac6341 Implement if/else/null/notnull/when/try postfix templates
#KT-4710 In Progress

(cherry picked from commit 4d28199cc2)
2016-09-24 01:28:35 +03:00
Denis Zharkov
5a9123ac6e Implement 'Surround expression with if' surrounder
#KT-3363 Fixed

(cherry picked from commit 09266b222b)
2016-09-24 01:28:33 +03:00
Denis Zharkov
13904186e3 Implement 'not' postfix template
#KT-4710 In Progress

(cherry picked from commit f18b9cc)
2016-09-24 01:28:32 +03:00
Denis Zharkov
aefc5e0ee5 Update IDEA version to 2016.2
(cherry picked from commit 1eeec18303)
2016-09-24 01:28:30 +03:00
Nikolay Krasko
a453837277 Fix tests for move: check applicability from changed text
Presentation status has stopped working after 18ce2c6070

(cherry picked from commit 3d0d82b862)
2016-09-24 01:28:29 +03:00
Nikolay Krasko
3a9c5e6c3c Register TypeAnnotationModifier as extension point
(cherry picked from commit a471d8907a)
2016-09-24 01:28:27 +03:00
Nikolay Krasko
ffa92714ad Problem: manually shutdown AppScheduledExecutorService to allow compiler stop properly
Without such shutdown console program that gets PSI file will hang forever.

Introduced in 446b80077a

Stack example:

 java.lang.Thread.State: RUNNABLE
	  at com.intellij.util.concurrency.AppDelayQueue.<init>(AppDelayQueue.java:37)
	  at com.intellij.util.concurrency.AppScheduledExecutorService.<init>(AppScheduledExecutorService.java:50)
	  at com.intellij.util.concurrency.AppScheduledExecutorService$Holder.<clinit>(AppScheduledExecutorService.java:41)
	  at com.intellij.util.concurrency.AppScheduledExecutorService.getInstance(AppScheduledExecutorService.java:46)
	  at com.intellij.util.concurrency.AppExecutorUtil.getAppScheduledExecutorService(AppExecutorUtil.java:39)
	  at com.intellij.concurrency.JobScheduler.getScheduler(JobScheduler.java:43)
	  at com.intellij.psi.impl.source.AstPathPsiMap.<clinit>(AstPathPsiMap.java:45)
	  at com.intellij.psi.impl.source.PsiFileImpl.<init>(PsiFileImpl.java:76)
	  at com.intellij.extapi.psi.PsiFileBase.<init>(PsiFileBase.java:39)
	  at org.jetbrains.kotlin.psi.KtFile.<init>(KtFile.java:48)
	  at org.jetbrains.kotlin.parsing.KotlinParserDefinition.createFile(KotlinParserDefinition.kt:73)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:407)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:348)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:326)
	  at com.intellij.psi.SingleRootFileViewProvider.getPsiInner(SingleRootFileViewProvider.java:171)
	  at com.intellij.psi.SingleRootFileViewProvider.getPsi(SingleRootFileViewProvider.java:155)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.trySetupPsiForFile(PsiFileFactoryImpl.java:121)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:100)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:56)
	  at org.jetbrains.kotlin.psi.KtPsiFactory.doCreateFile(KtPsiFactory.kt:174)
	  at org.jetbrains.kotlin.psi.KtPsiFactory.createFile(KtPsiFactory.kt:178)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processFileSingleEvaluator(Preprocessor.kt:82)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processDirectorySingleEvaluator(Preprocessor.kt:105)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processDirectorySingleEvaluator(Preprocessor.kt:135)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processSources(Preprocessor.kt:74)
	  at org.jetbrains.kotlin.preprocessor.PreprocessorCLI.main(PreprocessorCLI.kt:35)

(cherry picked from commit 99a75021e1)
2016-09-24 01:28:26 +03:00
Nikolay Krasko
d434688a7e Update to idea 162.1024.1
(cherry picked from commit cf63a77396)
2016-09-24 01:28:24 +03:00
Nikolay Krasko
7d808a0636 Tests only: fix compiler error because of changed nullability
(cherry picked from commit e2860eb12a)
2016-09-24 01:28:23 +03:00
Nikolay Krasko
e39087050c Update to 162.844.8
(cherry picked from commit 22f3fe4784)
2016-09-24 01:28:21 +03:00
Nikolay Krasko
3bd5afc02c Tests only: codeCleanup() method signature was changed
(cherry picked from commit dc35524fe1)
2016-09-24 01:28:20 +03:00
Nikolay Krasko
752328d1c8 Compile error because of changed nullability
(cherry picked from commit 89175a0165)
2016-09-24 01:28:18 +03:00
Nikolay Krasko
bc40107902 API change: parameter became NotNull
(cherry picked from commit 1a89d138fb)
2016-09-24 01:28:17 +03:00
Nikolay Krasko
d63dc1535a Build against 162.646.4
(cherry picked from commit 6a11055389)
2016-09-24 01:28:15 +03:00
Nikolay Krasko
18496a5438 Problem: remove static import (temp workaround)
See KT-13954 for details

(cherry picked from commit ff9f3694f1)
2016-09-24 01:28:14 +03:00
Nikolay Krasko
b42c9f42e6 Problem: remove static import (temp workaround)
(cherry picked from commit d5ae37d33a)
2016-09-24 01:28:12 +03:00
Nikolay Krasko
7f2ef4e030 Mock implementation for ExternalAnnotationsManager and InferredAnnotationsManager services
(cherry picked from commit bfef8726bb)
2016-09-24 01:28:11 +03:00
Nikolay Krasko
7876dc54c5 Update to idea 162
(cherry picked from commit dc49f7f21b)
2016-09-24 01:28:09 +03:00
Nikolay Krasko
516f82b40f More write action requirement remove
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock

(cherry picked from commit dba55ec34d)
2016-09-24 01:28:08 +03:00
Nikolay Krasko
fe679690a9 Tests only: add new method in MockPsiManager.java
(cherry picked from commit 7d1a5f1d2b)
2016-09-24 01:28:06 +03:00
Nikolay Krasko
34672edd3f Problem: define idea.plugins.compatible.build setting explicitly to avoid exception about bad idea home path
(cherry picked from commit b05105e849)
2016-09-24 01:28:05 +03:00
Nikolay Krasko
9ec3437e2f API Change: Implement new method isSuppressAll()
(cherry picked from commit 72c6c66b48)
2016-09-24 01:28:03 +03:00
Nikolay Krasko
5776501584 API Change: remove explicit generic type information
(cherry picked from commit db20daae88)
2016-09-24 01:28:02 +03:00
Nikolay Krasko
0c4465aa7f Tests only: No more WatchMessageNode
55029007ad
(cherry picked from commit 9674e1a6c7)
2016-09-24 01:28:00 +03:00
Nikolay Krasko
95a92e1f50 Tests only: Debugger test data modification: extra removed
(cherry picked from commit 58ff7f53fa)
2016-09-24 01:27:59 +03:00
Nikolay Krasko
5da713707e Tests only: implement new method
(cherry picked from commit c7ac8e1650)
2016-09-24 01:27:57 +03:00
Nikolay Krasko
50eb23ea24 Tests only: Constructor for XWatchesViewImpl was changed
1a8de38449
(cherry picked from commit 226735ae05)
2016-09-24 01:27:56 +03:00
Nikolay Krasko
f637eb7bc0 Tests only: reparseRange parameters changed
94863a8df4
(cherry picked from commit 99ed926554)
2016-09-24 01:27:54 +03:00
Nikolay Krasko
f5dddd381e registerUnresolvedError is in base class in idea from br146
(cherry picked from commit bea45ff2e5)
2016-09-24 01:27:52 +03:00
Nikolay Krasko
b6d49b0c7c No jsr166e.jar anymore in br146
(cherry picked from commit 06a0ebe352)
2016-09-24 01:27:51 +03:00
Nikolay Krasko
de4c72c042 Add run configuration for downloading br146
(cherry picked from commit 5cecdddcb6)
2016-09-24 01:27:49 +03:00
Alexey Sedunov
c6d795ae68 Redundant 'toString()' in String Template: Disable for qualified expressions with 'super' receiver
#KT-13942 Fixed
(cherry picked from commit d6daaf0)
2016-09-23 20:58:14 +03:00
Alexey Sedunov
cbad0dc328 Move Files/Directories: Fix behavior of "Open moved files in editor" checkbox
#KT-13909 Fixed
(cherry picked from commit 85c45cf)
2016-09-23 20:58:13 +03:00
Alexey Sedunov
a9ad2384cc Move Nested Class to Upper Level: Preserve state of "Search in comments"/"Search for text occurrences" checkboxes
#KT-13904 Fixed
(cherry picked from commit ad8b534)
2016-09-23 20:58:12 +03:00
Alexey Sedunov
1738945f81 Convert Parameter to Receiver: Do not qualify companion members with labeled 'this'
#KT-13933 Fixed
(cherry picked from commit 79f5097)
2016-09-23 20:58:12 +03:00
Alexey Sedunov
c149f1e351 Move to Companion Object: Warn if companion object already contains function with the same signature
#KT-13877 Fixed
(cherry picked from commit 75481c3)
2016-09-23 20:58:11 +03:00
Alexey Sedunov
1d532cd358 Move to Companion Object: Forbid for functions/properties referencing type parameters of the containing class
#KT-13876 Fixed
(cherry picked from commit 72ff5dd)
2016-09-23 20:58:10 +03:00
Alexey Sedunov
c83857b9c9 Move: Do not ignore target directory selected in the dialog (DnD mode)
#KT-13901 Fixed
(cherry picked from commit 4cd4b87)
2016-09-23 20:58:09 +03:00
Alexey Sedunov
cd925d1966 Move Nested Class to Upper Level: Do not show directory selection dialog twice
#KT-13906 Fixed
(cherry picked from commit 65a1ecc)
2016-09-23 20:58:08 +03:00
Alexey Sedunov
b423273f40 Minor: Add test for KT-13916
(cherry picked from commit 6366383)
2016-09-23 20:58:07 +03:00
Alexey Sedunov
769b8ddd0f Move: Remove companion object which becomes empty after the move
#KT-13903 Fixed
(cherry picked from commit 951dc6a)
2016-09-23 20:58:06 +03:00
Alexey Sedunov
bf9c435c30 Move to Companion Object: Fix exception when applied to class
#KT-13883 Fixed
(cherry picked from commit 11a7a24)
2016-09-23 20:58:05 +03:00
Alexey Sedunov
4e55647255 Move to Companion: Fix AssertionError on running refactoring from Conflicts View
#KT-13874 Fixed
(cherry picked from commit 64e5baa)
2016-09-23 20:58:05 +03:00
Alexey Sedunov
7a9d3a1813 Presentation: Add file name to the presentation of private top-level declaration
#KT-13838 Fixed
(cherry picked from commit 4313f24)
2016-09-23 20:58:04 +03:00
Alexey Sedunov
4878bde795 Shorten References: Compare resolved calls when shortening receiver of qualified call expression
#KT-13660 Fixed
(cherry picked from commit cf28dd0)
2016-09-23 20:58:03 +03:00
Alexey Sedunov
00fd68db17 Misc: Move conflict checking to moveConflictUtils.kt
(cherry picked from commit 84aa82e)
2016-09-23 20:58:02 +03:00
Alexey Sedunov
1f80322a01 Pull Up: Drop 'override' modifier if moved member doesn't override anything
(cherry picked from commit 54faac1)
2016-09-23 20:58:01 +03:00
Alexey Sedunov
3185e92ded Introduce Lambda Parameter: Use IDEA-provided action
(cherry picked from commit dddb4fd)
2016-09-23 20:58:00 +03:00
Alexey Sedunov
a7baee7729 Minor: Fix NPE in MoveKotlinTopLevelDeclarationsDialog
#KT-13856 Fixed
(cherry picked from commit f0a298e)
2016-09-23 20:57:59 +03:00
Alexey Sedunov
0d8768f2ea Rename: Rename all overridden members if user chooses to refactor base declaration(s)
#KT-8867 Fixed
(cherry picked from commit 6e02051)
2016-09-23 20:57:59 +03:00
Alexey Sedunov
3a2bf0facd Move: Do not show directory selection dialog if target directory is already specified by drag-and-drop
#KT-13553 Fixed
(cherry picked from commit a77e1da)
2016-09-23 20:57:58 +03:00
Alexey Sedunov
8478b46fb9 Misc: Do not use empty scope for KtParameter/KtTypeParameter (possible fix for EA-1185336)
(cherry picked from commit bb859ea)
2016-09-23 20:57:57 +03:00
Alexey Sedunov
bc99f6ee62 Move to Companion Intention: Do not use qualified names as labels
#KT-11483 Fixed
(cherry picked from commit 23491af)
2016-09-23 20:57:56 +03:00
Alexey Tsvetkov
9293922d13 Update changelog for 1.0.4 2016-09-23 20:56:28 +03:00
gitreelike
d0ea9ceb07 Implement quick fix to convert a too long char literal to a string #KT-13635 Fixed
(cherry picked from commit 06c8047)
2016-09-23 16:49:27 +03:00
shiraji
89e659fc50 Add "Copy concatenation text to clipboard" intention #KT-13744 Fixed
(cherry picked from commit 391a0fd)
2016-09-23 16:48:47 +03:00
Denis Zharkov
edb4d9c2e0 Prevent generation of delegations to interfaces private methods
#KT-13381 Fixed
 #KT-13996 Fixed
2016-09-23 14:55:37 +03:00
Alexey Tsvetkov
2b48f8245f Print gradle output only if test is failed 2016-09-22 20:41:43 +03:00
Nikolay Krasko
b9f3584194 Remove toString() test for StorageManager
Storing place of creating was removed in cb32bc97dd

(cherry picked from commit 293d3b4320)
2016-09-22 19:27:01 +03:00
Simon Ogorodnik
081d382b76 KT-11990 J2K native to external conversion (#957)
(cherry picked from commit ab2b674)
2016-09-22 17:12:32 +02:00
Mikhail Glukhikh
3ba98d7266 Random-order variable sets are no more in use in CFG #KT-13990 Fixed
(cherry picked from commit fc89385)
2016-09-22 14:42:08 +03:00
Alexander Udalov
e876b70a37 Exclude some codegen tests on Android
These tests rely on the fact that sources are located in the default package,
whereas Android tests alter the package name of each test

(cherry picked from commit b3803d6fe7)
2016-09-22 13:07:04 +03:00
Denis Zharkov
e8bf230011 Apply diagnostics test data difference between 1.1 and 1.0.5 2016-09-22 13:05:03 +03:00
Denis Zharkov
f84840e038 Fix false positive "Cannot capture" error reporting
There is no need to report an error in case of non-top-level
capture conversion, just don't add relevant capture type in the system instead

If system can be solved successfully without captured type, then it's just fine
(see KT-13950)
In case of contradiction TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR is reported

 #KT-13950 Fixed
2016-09-21 20:44:15 +03:00
Denis Zharkov
04f75e76c2 Fix inference when captured type is used as a lambda parameter type
Use lower approximation bound to obtain acceptable types for lambda parameters
those types depend on captured type

 #KT-12238 Fixed
 #KT-10627 Fixed
2016-09-21 20:44:15 +03:00
Nikolay Krasko
9fc9f1f144 Remove logging in LockBasedStorageManager creation as it all the same useless
HEAD - 3 leads to "org.jetbrains.kotlin.storage.LockBasedStorageManager.createWithExceptionHandling(LockBasedStorageManager.java:65)" debug string

(cherry picked from commit cb32bc9)
2016-09-21 16:10:58 +03:00
Nikolay Krasko
42076b0842 Remove another place with mentioning bare plugin
(cherry picked from commit b7b6d31)
2016-09-21 16:10:57 +03:00
Nikolay Krasko
893c5635ea Fix severe freezes because of long lint checks on large files (KT-13071)
- Run lint analyze under indicator with write action priority. Otherwise ProgressManager.checkCanceled() checks doesn't work
 - Move ProgressManager.checkCanceled() up or they are not called in large files without lint warnings

(cherry picked from commit d96863d)

 #KT-13071 Fixed
2016-09-19 19:01:10 +03:00
Nikolay Krasko
07f3a9a762 Skip lazy parsable lambdas without actually parsing them
(cherry picked from commit 131e779)
2016-09-19 19:01:09 +03:00
Alexey Andreev
1df29e90e9 KT-13664: write values of long compile-time constants as constants. Fix #KT-13664 2016-09-19 12:32:46 +03:00
Mikhail Glukhikh
0cc58bb50e Minor refactoring: convert to expression body
(cherry picked from commit 1e5fb91)
2016-09-19 11:52:43 +03:00
Mikhail Glukhikh
3da99b3e0d J2K fix: do not use auto-conversion of accessors to = Unit format
(cherry picked from commit 909b9b6)
2016-09-19 11:52:31 +03:00
Mikhail Glukhikh
5788c9ec7e Convert to expression body fix: do not allow = Unit for constructors
(cherry picked from commit 4509cd4)
2016-09-19 11:52:18 +03:00
Mikhail Glukhikh
bfc126ca82 Minor: WITH_RUNTIME removed from a set of intention tests
(cherry picked from commit 24c7efd)
2016-09-19 11:52:05 +03:00
Mikhail Glukhikh
7141bdb477 Partial build fix (new convert to expression body opportunity in quick-fixes)
(cherry picked from commit 9ad8202)
2016-09-19 11:51:52 +03:00
Mikhail Glukhikh
e0b7b765ac Add function to supertype immediately removes redundant modifiers #KT-12297 Fixed
(cherry picked from commit 6083689)
2016-09-16 16:32:02 +03:00
Mikhail Glukhikh
bfc50c02a9 KT-12297 related: make not open quick-fix for REDUNDANT_OPEN_IN_INTERFACE
(cherry picked from commit 32d11c3)
2016-09-16 16:31:05 +03:00
shiraji
5878dc3e46 Allow to convert empty Unit returning functions to expression form #KT-13588 Fixed
(cherry picked from commit 4f49444)
2016-09-16 15:40:00 +03:00
Ilya Gorbunov
f8febada54 Fix js RegExp test not to rely on array equality. #KT-8283 2016-09-16 10:13:56 +03:00
Yan Zhulanow
de55de218f Use LightParameter from Kotlin light classes to add an inner class constructor parameter instead of calling addParameter(name, type). The latter tries to load an icon :( (KT-13798)
(cherry picked from commit cc86d79)
2016-09-15 19:23:21 +03:00
Yan Zhulanow
198115bbbf Kapt: Return substituted supertypes in directSupertypes() for immediate class types (KT-13746)
(cherry picked from commit 3aae990)
2016-09-15 19:23:20 +03:00
Yan Zhulanow
49b07a7905 asMemberOf() should always substitute type parameters for methods using the relevant substitutor
(cherry picked from commit dfadd17)
2016-09-15 19:23:19 +03:00
Yan Zhulanow
95dde72ae6 Kapt: Allow to make CompilerConfiguration mutable again
(cherry picked from commit 0780de8)
2016-09-15 19:23:18 +03:00
Yan Zhulanow
60c807ed96 Kapt: allow to use Kapt from compileBunchOfSources()
(cherry picked from commit 09d857b)
2016-09-15 19:23:17 +03:00
Yan Zhulanow
1d8d533d24 Kapt: Fix erasure() for immediate class types (KT-13748)
(cherry picked from commit f9860cb)
2016-09-15 19:23:15 +03:00
Yan Zhulanow
20c1d1ee46 Kapt: calculate default values of Kotlin annotations correctly for annotations from binaries (KT-13733)
(cherry picked from commit 94f8991)
2016-09-15 19:23:15 +03:00
Alexey Tsvetkov
4b7ea0c683 Avoid dexing at Kapt2IT
(cherry picked from commit e8afbf1)
2016-09-15 19:23:14 +03:00
Alexey Tsvetkov
327e36842c Do not try to remove source annotations from not .class file
(cherry picked from commit 2ce3418)
2016-09-15 19:23:13 +03:00
Alexey Tsvetkov
ab7d1b8727 Change directory for sync task cache #KT-13732 fixed
(cherry picked from commit ca06b5c)
2016-09-15 19:23:12 +03:00
Alexey Tsvetkov
b2bf1d31df Minor: fix gradle plugin order in test
(cherry picked from commit 14e677f)
2016-09-15 19:23:11 +03:00
Alexey Tsvetkov
ba7b66e2ff Remove source annotations when copy class with kapt2
Writing source annotations enables incremental compilation for kapt2.
However they are not needed in bytecode, so we remove them when
copying classes.
(cherry picked from commit 999660d)
2016-09-15 19:23:10 +03:00
Yan Zhulanow
a714e84033 Minor: Fix path separators check on Windows
(cherry picked from commit 974bbe7)
2016-09-15 19:23:09 +03:00
Yan Zhulanow
c35e139520 Kapt: load all annotations, even if annotation processors does not require it explicitly. Some annotation processors may want to process some more annotations (see DbFlow, Database annotation).
Blacklist some common-used Java and Kotlin annotations instead (like Deprecated, Nullable or Metadata).
(cherry picked from commit 6856a7c)
2016-09-15 19:23:08 +03:00
Yan Zhulanow
09180ba82a Kapt: Provide SourceRetentionAnnotationHandler for incremental compilation.
Collect annotations with the "SOURCE" retention.
(cherry picked from commit 6ef66e7)
2016-09-15 19:23:07 +03:00
Yan Zhulanow
bab8df5bc9 Kapt: Write annotations with the "SOURCE" retention if kapt2 is enabled
(cherry picked from commit 6177b2b)
2016-09-15 19:23:07 +03:00
Yan Zhulanow
dca654505e Kapt: Remove generated output directory each time before annotation processing
(cherry picked from commit c4b772a)
2016-09-15 19:23:06 +03:00
Yan Zhulanow
28c3cf3f57 Minor: fix compilation exception (due to exception in kotlinc)
(cherry picked from commit 5f2d3c4)
2016-09-15 19:23:05 +03:00
Yan Zhulanow
9cb09ac412 Kapt: support incremental compilation in Gradle (KT-13500)
Kapt will process sources on each step of incremental compilation.
(cherry picked from commit 4cb2127)
2016-09-15 19:23:04 +03:00
Yan Zhulanow
fc7fc15ae6 Kapt: Add tests with Filer.
JavaFileObject.getName() now returns a path as required.
(cherry picked from commit c611f9b)
2016-09-15 19:23:03 +03:00
Yan Zhulanow
e9c0c2b867 Kapt: support multiple annotation processing steps (KT-13651)
(cherry picked from commit 880e183)
2016-09-15 19:23:02 +03:00
Yan Zhulanow
2bf575b501 Kapt: provide a default constructor if PsiClass does not have any
(cherry picked from commit 550b1c0)
2016-09-15 19:23:01 +03:00
Yan Zhulanow
42df808b84 Kapt: Do not substitute type arguments for PsiClassReferenceType
(cherry picked from commit 3954c71)
2016-09-15 19:23:00 +03:00
Yan Zhulanow
7e66a87087 Kapt: Do not use PsiType comparison in equals() where possible
(cherry picked from commit 89ba634)
2016-09-15 19:22:59 +03:00
Yan Zhulanow
c2f5ffe523 Kapt: Represent a single element as an array if the annotation method type is array type
(cherry picked from commit 19ce4cb)
2016-09-15 19:22:58 +03:00
Yan Zhulanow
8493659162 Kapt: Fix erasure() for executable types (KT-13629)
(cherry picked from commit 461c29d)
2016-09-15 19:22:57 +03:00
Yan Zhulanow
71495c4643 Kapt: abort compilation on error in annotation processing stage (KT-13622)
(cherry picked from commit f78b8b4)
2016-09-15 19:22:56 +03:00
Yan Zhulanow
71b5cd78ed Kapt: Allow passing primitive types and void to erasure() (KT-13617)
(cherry picked from commit 91444c5)
2016-09-15 19:22:54 +03:00
Alexey Tsvetkov
06bc681c85 Fix compatibility with AS 2.2 gradle plugin
#KT-13594 fixed
(cherry picked from commit b857df2)
2016-09-15 19:22:53 +03:00
Alexey Tsvetkov
d08f54da80 Fix snapshot version for testModuleKind
(cherry picked from commit a1f91ca)
2016-09-15 19:22:52 +03:00
Alexey Tsvetkov
fedbd1e043 Assume cache format is always up-to-date when compiling non-incrementally
(cherry picked from commit a300d2c)
2016-09-15 19:22:51 +03:00
Yan Zhulanow
bea2eba319 KT-12303 Pass only relevant annotations to annotation processors
(cherry picked from commit 01742aa)
2016-09-15 19:22:49 +03:00
Yan Zhulanow
3cc6492fe4 Kapt: Fix type arguments in JeDeclaredType. In case of type variable, JeTypeVariableType should be returned
(cherry picked from commit ed34ec0)
2016-09-15 19:22:47 +03:00
Yan Zhulanow
be1ec63ff7 Kapt: JeTypeElement getInterfaces() and getSuperClass() should provide reference type mirrors
(cherry picked from commit 5f50ab6)
2016-09-15 19:22:46 +03:00
Yan Zhulanow
ef063edb25 Kapt: Support String[] in annotation proxy
(cherry picked from commit 5e9eab9)
2016-09-15 19:22:45 +03:00
Yan Zhulanow
771988168d Kapt: Use also the compile classpath, not only apt classpath
(cherry picked from commit d810119)
2016-09-15 19:22:45 +03:00
Yan Zhulanow
f73a8fc82e Kapt, Gradle: The first dependency is kotlin-annotation-processing (we reuse the old configurations from kapt)
(cherry picked from commit f95a3d1)
2016-09-15 19:22:44 +03:00
Alexey Tsvetkov
d4ccd9f706 Support multi-project IC for android projects
(cherry picked from commit a0b477a)
2016-09-15 19:22:43 +03:00
Alexey Tsvetkov
427961f8fd Fixes after review
(cherry picked from commit 973e2a8)
2016-09-15 19:22:42 +03:00
Alexey Tsvetkov
117edc968f Implement multiproject IC in Gradle
#KT-13528 fixed
(cherry picked from commit f01daf4)
2016-09-15 19:22:41 +03:00
Alexey Tsvetkov
acef77a326 Join paths to string for better assertion message in idea
(cherry picked from commit c3c4e7d)
2016-09-15 19:22:40 +03:00
Alexey Tsvetkov
3d7969f2bb Refactor version checking
(cherry picked from commit db24fe8)
2016-09-15 19:22:39 +03:00
Alexey Tsvetkov
445624c881 Introduce KotlinGradleBuildServices that is created once per build
(cherry picked from commit 9bfbdd9)
2016-09-15 19:22:38 +03:00
Alexey Tsvetkov
4a7608eda8 Minor: remove outdated TODO
(cherry picked from commit 4e696c7)
2016-09-15 19:22:37 +03:00
Alexey Tsvetkov
b1cc1ffbc9 Refactor loading kotlin version in gradle plugin
(cherry picked from commit 845d174)
2016-09-15 19:22:37 +03:00
Alexey Tsvetkov
d87c4fb1dc Ensure java is forced to compile when kotlin is compiled incrementally
Previously java compilation was not forced when there were only
removed kotlin files.
(cherry picked from commit 2eee4b0)
2016-09-15 19:22:36 +03:00
Alexey Tsvetkov
c2e37ea20d Fix incremental build with kapt and gradle 2.14
#KT-13179 fixed
(cherry picked from commit 1daee05)
2016-09-15 19:22:35 +03:00
Yan Zhulanow
b361b9ea67 Kapt: Support nested annotations property.
Also do not rely on Java class comparison, check against qualified names.
(cherry picked from commit 7610945)
2016-09-15 19:22:34 +03:00
Yan Zhulanow
8e09b4ccec Kapt: Fix broken assertion
(cherry picked from commit 36b0b52)
2016-09-15 19:22:33 +03:00
Alexey Sedunov
0eea622cbe Minor: Fix compilation 2016-09-15 16:29:51 +03:00
Alexey Sedunov
d418eeeaa3 Convert to Kotlin: AbstractExpressionSelectionTest
(cherry picked from commit a6e3aac)
2016-09-15 16:29:50 +03:00
Alexey Sedunov
4c87f46081 Convert to Kotlin: AbstractExpressionSelectionTest (rename to .kt)
(cherry picked from commit 96a2c97)
2016-09-15 16:29:49 +03:00
Alexey Sedunov
8d3935a443 Convert to Kotlin: AbstractSmartSelectionTest
(cherry picked from commit b0a1eca)
2016-09-15 16:29:48 +03:00
Alexey Sedunov
99d268f617 Convert to Kotlin: AbstractSmartSelectionTest (rename to .kt)
(cherry picked from commit 1ab40f6)
2016-09-15 16:29:48 +03:00
Alexey Sedunov
17c09c64c4 Refactoring: Split KotlinRefactoringUtil2.kt to several files
(cherry picked from commit f6d0fca)
2016-09-15 16:29:47 +03:00
Alexey Sedunov
19b592f149 Convert to Kotlin: KotlinRefactoringUtil2 (replace object with top-level declarations)
(cherry picked from commit b6a671c)
2016-09-15 16:29:46 +03:00
Alexey Sedunov
604195fa1a Convert to Kotlin: KotlinRefactoringUtil2 (prettify)
(cherry picked from commit 16b4c2c)
2016-09-15 16:29:45 +03:00
Alexey Sedunov
994b480eb9 Convert to Kotlin: KotlinRefactoringUtil2
(cherry picked from commit fc9b288)
2016-09-15 16:29:44 +03:00
Alexey Sedunov
35a8f6f29d Convert to Kotlin: KotlinRefactoringUtil2 (rename to .kt)
(cherry picked from commit 1f8dba9)
2016-09-15 16:29:43 +03:00
Alexey Sedunov
28b26f4de3 Minor: Temporary rename of KotlinRefactoringUtil before conversion to Kotlin (to avoid conflict with existing kotlinRefactoringUtil.kt)
(cherry picked from commit f47b416)
2016-09-15 16:29:42 +03:00
Alexey Sedunov
cca3824bb0 Introduce Type Parameter
#KT-13155 Fixed
(cherry picked from commit 2f9a911)
2016-09-15 16:29:41 +03:00
Alexey Sedunov
0193622ea3 Rename: Support inplace rename on type parameters
(cherry picked from commit 4e2c4d9)
2016-09-15 16:29:40 +03:00
Alexey Sedunov
a4366686f7 Quick-Fixes: Do not show Change Signature dialog when applying "Remove parameter" quick-fix
(cherry picked from commit 34c268b)
2016-09-15 16:29:39 +03:00
Alexey Sedunov
3f24cb6514 Convert Receiver to Parameter: Use template instead of the dialog
#KT-9490 Fixed
(cherry picked from commit 639186d)
2016-09-15 16:29:38 +03:00
Alexey Sedunov
b830c1d343 Create from Usage: Implement "Create type parameter" quickfix
#KT-11525 Fixed
(cherry picked from commit 63092f6)
2016-09-15 16:29:37 +03:00
Alexey Sedunov
07e129a655 Move: Forbid moving of enum entries
#KT-13215 Fixed
(cherry picked from commit 64f0532)
2016-09-15 16:28:58 +03:00
Alexey Sedunov
83e29b3355 Search: Optimize usage scope of class members
#KT-9285 Fixed
(cherry picked from commit d9698df)
2016-09-15 16:28:57 +03:00
Alexey Sedunov
69f433984d Search: Restrict KtParameter usage scope to its containing declaration
#KT-13542 Fixed
 #KT-8672 Fixed
(cherry picked from commit e908c6c)
2016-09-15 16:28:56 +03:00
Alexey Sedunov
d94219e839 Move: Report separate conflicts for each property accessor
#KT-13216 Fixed
(cherry picked from commit 6480118)
2016-09-15 16:28:55 +03:00
Alexey Sedunov
a1cf4e67bb Pull Up: Remove visibility modifiers on adding 'override'
#KT-13535 Fixed
(cherry picked from commit 9607fd0)
2016-09-15 16:28:54 +03:00
Alexey Sedunov
6e57ab9cb8 Type Hierarchy: Support Type Hierarchy on references inside of super type call entries
#KT-9125 Fixed
(cherry picked from commit 47d4454)
2016-09-15 16:28:53 +03:00
Alexey Sedunov
73a6cdf041 Convert to Kotlin: HierarchyUtils (prettify)
(cherry picked from commit cd1943c)
2016-09-15 16:28:52 +03:00
Alexey Sedunov
3218deb431 Convert to Kotlin: HierarchyUtils
(cherry picked from commit 4622f08)
2016-09-15 16:28:51 +03:00
Alexey Sedunov
9c270d54ef Convert to Kotlin: HierarchyUtils (rename to .kt)
(cherry picked from commit 91cc22e)
2016-09-15 16:28:50 +03:00
Alexey Sedunov
937020ef90 Convert to Kotlin: KotlinTypeHierarchyProvider (prettify)
(cherry picked from commit 05abc01)
2016-09-15 16:28:49 +03:00
Alexey Sedunov
e2d604849b Convert to Kotlin: KotlinTypeHierarchyProvider
(cherry picked from commit 23d9f92)
2016-09-15 16:28:49 +03:00
Alexey Sedunov
b2dd2330d8 Convert to Kotlin: KotlinTypeHierarchyProvider (rename to .kt)
(cherry picked from commit 438777a)
2016-09-15 16:28:48 +03:00
Mikhail Glukhikh
d6a5f3eca5 IntentionBasedInspection minor refactoring: inspectionRange --> inspectionTarget
(cherry picked from commit f973be2)
2016-09-15 14:35:01 +03:00
shiraji
6d9906b507 Add inspection + intention to replace .let { it.foo() } with .foo() #KT-13551 Fixed
(cherry picked from commit e4c873d)
2016-09-15 14:34:48 +03:00
Mikhail Glukhikh
8892a53532 Speed search is enable in add import action #KT-13326 Fixed
(cherry picked from commit cdf4309)
2016-09-15 14:34:33 +03:00
Denis Zharkov
5eab0e1ce6 Fix testData related to changes in special built-ins resolution 2016-09-15 10:38:01 +03:00
Mikhail Glukhikh
c9c0567c48 Minor: message fixed in diagnostics test 2016-09-15 10:38:01 +03:00
Denis Zharkov
63f6e673b7 Add compatibility flag for implicit inner classes' arguments
If the flag is set to 1, implicit arguments are resolved in the same way
they would before 1.0.5
2016-09-15 10:38:01 +03:00
Denis Zharkov
b88dd8caad Refine diagnostic about type arguments for an outer class
#KT-11263 Fixed
2016-09-15 10:38:01 +03:00
Denis Zharkov
a6f40d4c69 Fix implicit type arguments resolution for inner classes
When resolving arguments on inner classifier, one can omit the arguments
for outer class 'Outer' if they are present implicitly in the scope:
- One of the supertypes of current class is Outer
- One of the outer classes or one of their supertypes is Outer

Relevant arguments are obtained from the first type found by
the algorithm above

Note that before this commit implicit arguments were only been searched
in containing classes

 #KT-11123 Fixed
2016-09-15 10:38:01 +03:00
Denis Zharkov
5b4c81e389 Minor. Add covariant override for TypeParameterDescriptor.original 2016-09-15 10:38:01 +03:00
Alexey Andreev
5978f315cc JS: add explanation to inline/arrayLiteralAliasing.kt test 2016-09-14 16:46:10 +03:00
Alexey Andreev
1679d4939e KT-8283: fix Kotlin.equals method to compare arrays by reference 2016-09-14 16:46:09 +03:00
Alexey Andreev
41967c9700 KT-7397: use reference comparison (===) when translating a is A, where A is an object. Use more sophisticated check for reified parameters. 2016-09-14 13:17:08 +03:00
Dmitry Jemerov
098894382e fix compilation after cherry-pick 2016-09-13 17:33:50 +02:00
Simon Ogorodnik
284d5e393f #KT-13750 fix (#951)
(cherry picked from commit 115d63a)
2016-09-13 17:33:50 +02:00
Mikhail Glukhikh
a4bf73991a Minor: intention message changed for if/when -> assignment/return
(cherry picked from commit 222b964)
2016-09-12 18:17:12 +03:00
Mikhail Glukhikh
9ea351b2d8 Quick-fix for reassignment in try / catch (fold to assignment) #KT-13778 Fixed
(cherry picked from commit edacc7f)
2016-09-12 18:17:01 +03:00
shiraji
42f5d4212b KT-13674 Add quickfix to remove the final upper bound
#KT-13674 Fixed
(cherry picked from commit 7c3835b)
2016-09-12 15:07:14 +03:00
shiraji
2dc5ae2afd KT-13693 Expand selection for array brackets
#KT-13693 Fixed

(cherry picked from commit d83b174)
2016-09-12 12:28:13 +02:00
Michael Bogdanov
7070147403 'toString' implementation in DescriptorBasedFunctionHandle
(cherry picked from commit 4b0c272)
2016-09-12 13:01:07 +03:00
Alexander Udalov
9357a713cd Fix AssertionError in notFoundClasses.kt on bad FQ names (EA-85046)
FQ names like "Foo." or "Foo..Bar" were causing this exception. No tests added:
no idea how to reproduce this exception

(cherry picked from commit 81556b1339)
2016-09-12 10:45:53 +03:00
Alexander Udalov
3ba63212cb Fix reflective access on overridden generic property reference
Generation of callable reference's signature in codegen should use the same
mechanism for obtaining the signature as the runtime in RuntimeTypeMapper,
namely DescriptorUtils.unwrapFakeOverride(...).original

 #KT-13700 Fixed

(cherry picked from commit 90eafe0d71)
2016-09-12 10:45:48 +03:00
Alexey Andreev
ac5b14937c JS: fix compile-time failure when inheriting one local class from another local class 2016-09-09 17:55:04 +03:00
Denis Zharkov
32029c5d4b Fix signature clash problems caused by special built-ins
Do not treat members with already changed signature as a reason
to create a hidden copy

See tests for clarification:
- There are `charAt` method in B that has different name in Kotlin - `get`,
  i.e. relevant descriptor has initialSignatureDescriptor != null
- When collecting methods from supertypes, `charAt` from A is also get
  transformed to `get`
- So it has effectively the same signature as B.get (already declared)
- If by an accident B.get had been declared with Kotlin signature
  we would have add A.charAt (after transformation) with special flag:
  HiddenToOvercomeSignatureClash (hides it from resolution)
- But here B.charAt was artificially changed to `get`, so no signature clash
  actually happened

 #KT-13730 Fixed
2016-09-09 17:33:13 +03:00
Simon Ogorodnik
de4848d93e Correct diagnostics and quick-fix for T::class with non-reified type parameter #KT-9590 fixed
(cherry picked from commit 2b63bca, implementation for 1.0.x)
2016-09-09 16:34:32 +03:00
Mikhail Glukhikh
25b32db782 Change to star projection no longer applied for functional types #KT-13715 Fixed
Also EA-87648 Fixed
(cherry picked from commit 998399b)
2016-09-09 15:05:59 +03:00
Mikhail Glukhikh
13a0413e4e Convert lambda to reference intention: apply shorten references to callable reference only, not to the whole argument list
(cherry picked from commit 23132ad)
2016-09-09 15:05:44 +03:00
Mikhail Glukhikh
33b7fb0077 Refactoring: add braces to when entry intention is integrated into general add braces intention
(cherry picked from commit 06b7881)
2016-09-09 15:05:29 +03:00
Mikhail Glukhikh
010d9073e2 Minor: remove braces is now applicable for the whole loop or when entry
(cherry picked from commit cbc7f72)
2016-09-09 15:05:18 +03:00
Mikhail Glukhikh
2deaa27e7c Refactoring: remove braces from when entry intention is integrated into general remove braces intention
(cherry picked from commit cf2839e)
2016-09-09 15:05:04 +03:00
Mikhail Glukhikh
5791b4d385 Convert lambda to reference has now INFO severity
(cherry picked from commit 7f955fd)
2016-09-09 15:04:53 +03:00
Alexey Andreev
a8ce855dd8 JS: fix tests that don't fail due to lack of support of strict mode (multiValInIntFor, multiValInIntRangeFor). 2016-09-09 14:36:00 +03:00
Alexey Andreev
9e75072327 KT-12868: if a property initializer is a complex expression that emits additional statements, emit these statements directly before assignment to the property, not at the beginning of constructor 2016-09-09 14:35:59 +03:00
Alexey Andreev
c09e5e5412 KT-13583: allow local classes to capture members of outer classes 2016-09-09 14:35:59 +03:00
Nikolay Krasko
ca2e7792b7 Make removing artifacts work with rri branches 2016-09-08 21:35:04 +03:00
shiraji
9d0b449652 Add quickfix for FINAL_UPPER_BOUND: inline type parameter #KT-13773 Fixed
(cherry picked from commit 9d768e2)
2016-09-08 17:52:28 +03:00
Nikolay Krasko
e7cdba7260 More tests for ChangeVisibilityModifierIntention 2016-09-07 18:46:55 +03:00
Nikolay Krasko
bf2aadea66 Restrict default applicability range for intentions to enclosing block 2016-09-07 18:46:54 +03:00
Nikolay Krasko
533fca11c7 Make KtLambdaExpression lazy parsable element 2016-09-07 18:46:50 +03:00
Michael Bogdanov
fa21a3225b Support for property reference inlining
(cherry picked from commit 7230965)
2016-09-07 14:59:42 +03:00
Michael Bogdanov
9b092d0068 Mark linenumber in property reference
(cherry picked from commit 237afb4)
2016-09-07 13:59:16 +03:00
Michael Bogdanov
0a0cfc4878 PropertyReferenceCodegen refactoring
(cherry picked from commit b4ae701)
2016-09-07 13:57:46 +03:00
Michael Bogdanov
f00aca2907 Check lambda inlining in package part files in test framework
(cherry picked from commit a12d7b6)
2016-09-07 13:43:16 +03:00
Nikolay Krasko
a21e85b172 j2k: fix converter 2016-09-06 15:18:55 +03:00
Nikolay Krasko
c0db343bd0 j2k: right after convert 2016-09-06 15:18:52 +03:00
Nikolay Krasko
8deaa34a57 j2k: rename file 2016-09-06 15:18:51 +03:00
Nikolay Krasko
0b25723f07 Extract base class for goto action tests 2016-09-06 15:18:49 +03:00
Nikolay Krasko
3cd100bbcf Tests for GotoTypeDeclaration action 2016-09-06 15:18:48 +03:00
Nikolay Krasko
9eddf05676 Force building with 1.0.4
Stay on 1.0.4 intentionally to make the moment of pushing incompatible changes explicit as they will
be visible as failure on buildserver.
2016-09-06 15:16:18 +03:00
Nikolay Krasko
3dba661bed Update more usages of ResolveEverythingToKotlinAnyLocalClassifierResolver 2016-09-06 14:49:25 +03:00
Nikolay Krasko
ea8811900d Fix compile error for 1.0.x compiler 2016-09-06 14:46:34 +03:00
Alexey Andreev
b864737330 KT-13658: don't capture FakeCallableDescriptorForObject in closure 2016-09-06 11:02:50 +03:00
Denis Zharkov
35ff738f5e Fix decompilation of types based on local classifiers
If deserializing a type with arguments based on a local class for
decompiler, then just return Any type (without arguments).

Previously Any constructor was used with serialized arguments, that lead
to exception

Note that in case of deserialization for compiler nothing changes about
local-classes-based types (LocalClassifierResolverImpl is just inlined)

 #KT-13408 Fixed
2016-09-05 18:58:43 +03:00
Alexander Udalov
c3a83a9ea7 Add -language-version 1.0 to compiler settings 2016-09-05 18:56:58 +03:00
Alexander Udalov
24ebd4479c Exclude more irrelevant maven-generated stuff in CodeConformanceTest
(cherry picked from commit 1be3b9c192)
2016-09-05 16:48:55 +03:00
Alexander Udalov
ed96f715af Fix concurrent access issues in CallableReference implementations
Because of multiple reads from the same non-volatile variable, NPE was possible
to achieve in a multi-threaded application

(cherry picked from commit dc689ff514)
2016-09-05 16:48:47 +03:00
Alexander Udalov
41be67a161 Fix occasional NPE from reflection initialization
This could happen when a .jar containing Kotlin stdlib and reflection classes
was launched with 'java -jar'

(cherry picked from commit 8fb5858dae)
2016-09-05 16:48:42 +03:00
Alexander Udalov
773bb67e5f Minor, rename ConsPStack$1 -> ConsPStack$Itr
To somewhat improve stack traces (see
http://stackoverflow.com/questions/34214290/kotlin-massive-amounts-of-conspstack-how-can-i-avoid/34214718#34214718)

(cherry picked from commit 9da1840523)
2016-09-05 16:48:39 +03:00
Alexander Udalov
9ab01053b5 Optimize KClass creation from Class instance
Don't create unnecessary iterator every time in HashPMap.get (see
https://github.com/hrldcpr/pcollections/pull/41). Also fix a warning and remove
misleading comment

(cherry picked from commit f4a1aa640e)
2016-09-05 16:48:36 +03:00
Alexander Udalov
9ece8a69ec Optimize argument array creation in reflection call
(cherry picked from commit d0d1824e7d)
2016-09-05 16:48:34 +03:00
Alexander Udalov
39fc50dbbc Fix NPE in CallableReferencesResolutionUtils.kt on incomplete code
#KT-13685 Fixed

(cherry picked from commit c8b30d3310)
2016-09-05 13:08:09 +03:00
Nikolay Krasko
07bc4d0087 Show lint diagnostics even if there're errors in the file (KT-12022)
It also affects working with KotlinChangeLocalityDetector. Right after error is fixed in local context file is still reported as having errors and diagnostics are not counted.

(cherry picked from commit 67f3539)

 #KT-12022 Fixed
2016-09-02 13:55:54 +03:00
Nikolay Krasko
86094f3a2d Don't highlight declaration with WRAPPED_INTO_REF
Leave highlighting only for usage. This may allow to make highlighting more local and lazy.
Java follows the same rules for "Implicit anonymous class parameter".

(cherry picked from commit 795fef2)
2016-09-02 13:55:52 +03:00
Nikolay Krasko
3bba94f222 Precheck method is called main in RunConfiguration check
(cherry picked from commit f797d53)
2016-09-02 13:55:50 +03:00
Nikolay Krasko
0f9ef7bacd Drop kotlin-bare-plugin (KT-11859)
(cherry picked from commit 9a54aa9)
2016-09-02 13:55:49 +03:00
Nikolay Krasko
baf1f9928c Minor: toString() for NONE filter
(cherry picked from commit 4a0f14b)
2016-09-02 13:55:47 +03:00
Nikolay Krasko
bab8ea4725 Make changes in super call lambda not cause out-of-block modification (KT-13474)
(cherry picked from commit 52dd02f)

 #KT-13474 Fixed
2016-09-02 13:55:42 +03:00
Nikolay Krasko
42ed4c91cd Test that out-of-block behaviour conforms running the analyze of the nearest expression
Mark as exceptions cases with field initialize expression and body of class init for now

(cherry picked from commit 64d5115)
2016-09-02 13:53:08 +03:00
Nikolay Krasko
cc50667eab Use AtomicLong for modification stamp
(cherry picked from commit ec6780b)
2016-09-02 13:53:06 +03:00
Nikolay Krasko
c0cf9c0e0a Re-highlight only single function after local modifications
(cherry picked from commit 82bcd81)
2016-09-02 13:52:57 +03:00
Nikolay Krasko
8a1206d56f Minor: remove warnings and refactoring
(cherry picked from commit 043502f)
2016-09-02 13:47:25 +03:00
Stanislav Erokhin
43a49078e7 Potential fix for some random errors about "cannot choose between equals invoke functions".
(cherry picked from commit 407fe02)
2016-09-01 15:53:01 +03:00
Stanislav Erokhin
c37f4f1dcf Set reference target and report custom error instead unresolved reference for cases: interface, generic parameter, object + invoke, class without companion.
#KT-2787 Fixed.
2016-09-01 15:19:58 +03:00
Mikhail Glukhikh
c39c2efe21 Convert lambda to reference: use fully qualified type names if needed #KT-13438 Fixed
(cherry picked from commit e2e761e)
2016-09-01 14:41:27 +03:00
Mikhail Glukhikh
f68d7399fc Convert lambda to reference: flexible receiver types are handled correctly #KT-13411 Fixed
(cherry picked from commit ecad1c3)
2016-09-01 14:41:21 +03:00
Mikhail Glukhikh
ecb2a9576a Convert lambda to reference: no more allowed for extension KFunction parameters #KT-13527 Fixed
(cherry picked from commit 84c4ff7)
2016-09-01 14:41:15 +03:00
Mikhail Glukhikh
bc4a2ee9e1 Convert lambda to reference: range reduced to a call itself #KT-13661 Fixed
(cherry picked from commit f7b5d34)
2016-09-01 14:41:10 +03:00
Alexey Sedunov
1d3e09695a Find Usages: Do not duplicate containing declaration in super member warning dialog
#KT-10209 Fixed
(cherry picked from commit 9fd61b8)
(cherry picked from commit 0d63004)
2016-09-01 14:37:19 +03:00
Alexey Sedunov
9a657c8c38 Create from Usage: Place extension properties after the usage and generate stub getter
#KT-11795 Fixed
(cherry picked from commit c2b38cf)
(cherry picked from commit c7ae2e9)
2016-09-01 14:37:18 +03:00
Alexey Sedunov
851e4b11f7 Create from Usage: Make extension functions/properties 'private' by default
#KT-11799 Fixed
(cherry picked from commit 99ba340)
(cherry picked from commit 0fb8f49)
2016-09-01 14:37:17 +03:00
Alexey Sedunov
61117d6ab8 Remove Unused Receiver: update function/property usages
#KT-8903 Fixed
(cherry picked from commit 92b0c85)
(cherry picked from commit cd3f6d6)
2016-09-01 14:37:16 +03:00
Alexey Sedunov
0d26035ef4 Rename: Support rename of packages with non-standard quoted names
#KT-13488 Fixed
(cherry picked from commit 0fc28fe)
(cherry picked from commit a3eebe3)
2016-09-01 14:37:15 +03:00
Alexey Sedunov
89d1cb870f Rename: Do not search for component convention usages
#KT-9381 Fixed
(cherry picked from commit f6de6ea)
(cherry picked from commit ad4c7d5)
2016-09-01 14:37:14 +03:00
Alexey Sedunov
530b5bfe68 Rename: Fix parameter rename when new name matches call selector
#KT-13476 Fixed
(cherry picked from commit f507eed)
(cherry picked from commit 3ee20d9)
2016-09-01 14:37:13 +03:00
Alexey Sedunov
eb6ca55bfd Rename: Quote parameter name when necessary
#KT-13463 Fixed
(cherry picked from commit 5e577c3)
(cherry picked from commit 67543b0)
2016-09-01 14:37:12 +03:00
Alexey Sedunov
c94f35d435 Override/Implement: Make return type non-nullable (platform collection case) when overriding Java method
#KT-13455 Fixed
(cherry picked from commit 238f99a)
(cherry picked from commit dfa4b7f)
2016-09-01 14:37:11 +03:00
Alexey Sedunov
7dedfa07c5 Intentions: Implement intention to replace camel-case test function name with a space-separated one
#KT-12489 Fixed
(cherry picked from commit 21e24a1)
2016-09-01 14:37:10 +03:00
Mikhail Glukhikh
c81d533914 CFA: additional jumps to catch / finally generated in the end of try / before exits from try #KT-5469 Fixed
Also #KT-13612 Fixed
(cherry picked from commit 7c188b3)
2016-08-31 19:06:13 +03:00
Mikhail Glukhikh
4ca8316e76 KT-13612 KotlinPositionManager: fixed initialization in try / catch
(cherry picked from commit ecae5c6)
2016-08-31 19:06:02 +03:00
Mikhail Glukhikh
b4fb5bd53f UNUSED_VALUE is now reported on expression only if this expression is unused in all (e.g. finally) branches #KT-9825 Fixed
(cherry picked from commit aac8e94)
2016-08-31 19:05:41 +03:00
Mikhail Glukhikh
5c3ec6cfbd Nested classes are no more allowed inside any anonymous objects or local classes #KT-13510 Fixed 2016-08-31 12:21:46 +03:00
Alexey Andreev
08b0a3eca1 KT-12873: add temporary variables generated by delegation expression to class initializer. Fix #KT-12873 2016-08-30 12:29:36 +03:00
Sergey Mashkov
e6f743aad8 KT-12810 IDL: support special modifiers(e.g. getter and setter) 2016-08-29 17:57:42 +03:00
Yoshinori Isogai
c955f88d03 KT-5193 Make multiline strings foldable (#938)
* KT-5193 Make multiline strings foldable
 #KT-5193 Fixed

* Avoid multiple replace call

(cherry picked from commit e1eba8f)
2016-08-29 16:54:41 +02:00
Alexander Udalov
1655792a22 Support "-no-reflect" in "kotlin" command
#KT-13491 Fixed

(cherry picked from commit 3298649bd7)
2016-08-26 21:45:38 +03:00
Ilya Gorbunov
2963fc5017 JS: Implement Long.hashCode function.
#KT-13576 Fixed

(cherry picked from commit 25d8af3112)
2016-08-26 18:19:05 +03:00
Ilya Gorbunov
e94444cb07 JS: Remove intrinsic for Long.equals, because it's applied incorrectly for nullable longs.
#KT-7500 Fixed

(cherry picked from commit 813bee62e5)
2016-08-26 18:18:36 +03:00
Alexey Tsvetkov
e6d45ebc6a Update link to jarjar 2016-08-26 18:15:13 +03:00
Mikhail Glukhikh
95add79c66 CFG refactoring: extractVariableDescriptorFrom 2016-08-26 14:11:32 +03:00
Dmitry Jemerov
a8009dc26f show primary constructor properties in project view when "Show members" is enabled
#KT-11776 Fixed

(cherry picked from commit 9264c87)
2016-08-25 14:23:37 +02:00
Dmitry Jemerov
e13e54c55e KtClassOrObjectTreeNode: cleanup after J2K
(cherry picked from commit 1cf79d9)
2016-08-25 14:23:29 +02:00
Dmitry Jemerov
614cc843d9 KotlinProjectViewUtil, KtClassOrObjectTreeNode: J2K
(cherry picked from commit fceb626)
2016-08-25 14:23:22 +02:00
Dmitry Jemerov
5f69b25df7 KtClassOrObjectTreeNode: rename to .kt
(cherry picked from commit a7d5b7c)
2016-08-25 14:23:14 +02:00
Dmitry Jemerov
f6e5866036 KotlinProjectViewUtil: rename to .kt
(cherry picked from commit 49c9573)
2016-08-25 14:23:06 +02:00
Dmitry Jemerov
015dd21aab show icon of class initializer
#KT-11775 Fixed

(cherry picked from commit 3ec583b)
2016-08-25 14:22:58 +02:00
Dmitry Jemerov
e42cabb949 show local functions in structure view
#KT-13473 Fixed

(cherry picked from commit 8ff0814)
2016-08-25 14:22:50 +02:00
Dmitry Jemerov
86c7898bb8 KotlinStructureViewElement: cleanup after J2K
(cherry picked from commit 5091420)
2016-08-25 14:22:43 +02:00
Dmitry Jemerov
6b7da50a79 KotlinStructureViewElement: J2K
(cherry picked from commit 50b1951)
2016-08-25 14:22:35 +02:00
Dmitry Jemerov
e081b99231 KotlinStructureViewElement: rename to .kt
(cherry picked from commit 2ebacb6)
2016-08-25 14:22:25 +02:00
Nikolay Krasko
eb160a26f8 Remove net/sf/cglib/ classes from Kotlin compiler (KT-13565)
#KT-13565 Fixed
2016-08-25 15:20:12 +03:00
Nikolay Krasko
e90e5f9088 Debugger doesn't step into 'for' body if there's inline function call in range expression (KT-13534)
#KT-13534 Fixed
2016-08-25 15:20:12 +03:00
Nikolay Krasko
1b7d4ef5a0 More emulate debugging after dexing - dex removes several lines mapped to one instruction 2016-08-25 15:20:12 +03:00
Mikhail Glukhikh
47a55f6c1a Has platform type inspection: do not suggest !! for not-null types #KT-12820 Fixed
(cherry picked from commit 8830ff7)
2016-08-25 10:26:16 +03:00
Mikhail Glukhikh
5447242e5e KT-13536 related: correct handling of objects
(cherry picked from commit 7ae9b6b)
2016-08-25 10:26:08 +03:00
Mikhail Glukhikh
0c6d233875 No more SOE in UnusedSymbolInspection #KT-13536 Fixed
(cherry picked from commit 23961ee)
2016-08-25 10:25:59 +03:00
Mikhail Glukhikh
d2a2dfad9a Invert if: more correct handling of empty returns #KT-13444 Fixed
(cherry picked from commit be2adaf)
2016-08-25 10:25:51 +03:00
Mikhail Glukhikh
d7fc708ee6 Pseudocode label now cannot be bound to a non-owning pseudocode #KT-13555 Fixed
Also EA-77641 Fixed
(cherry picked from commit 07643ce)
2016-08-25 10:25:42 +03:00
Mikhail Glukhikh
d1f4f2d694 PseudocodeLabel is extracted from PseudocodeImpl (now not an inner class), some its properties / functions are supported now by base Label
(cherry picked from commit 30dd52e)
2016-08-25 10:25:32 +03:00
Mikhail Glukhikh
56cd8c2209 Label.java converted to Kotlin
(cherry picked from commit 3891d76)
2016-08-25 10:25:23 +03:00
Mikhail Glukhikh
a73e495677 CFG: break and continue are now handled in the same (safe) way EA-85060 Fixed
(cherry picked from commit eec4b1b)
2016-08-25 10:25:15 +03:00
Mikhail Glukhikh
f7718468e9 BreakableBlockInfo : converted to Kotlin
(cherry picked from commit 22c7ee5)
2016-08-25 10:25:07 +03:00
Mikhail Glukhikh
005c80fdd6 BreakableBlockInfo.java -> BreakableBlockInfo.kt
(cherry picked from commit d5f7c3f)
2016-08-25 10:24:59 +03:00
Mikhail Glukhikh
a6aad3d6b7 LoopInfo: converted to Kotlin
(cherry picked from commit f64d60e)
2016-08-25 10:24:48 +03:00
Mikhail Glukhikh
8a468a1759 LoopInfo.java --> LoopInfo.kt
(cherry picked from commit d952dbd)
2016-08-25 10:24:39 +03:00
Mikhail Glukhikh
e44a6e6724 EA-85060: BreakableBlockInfo is split into LoopInfo & SubroutineInfo to make code more clear
(cherry picked from commit 48faf4a)
2016-08-25 10:24:31 +03:00
Alexey Andreev
4ceee60166 JS: add support of JS module kind to Gradle task. Add tests of support of module kind to Maven tests 2016-08-23 18:26:45 +03:00
Alexey Andreev
f9894ca04c JS: refactor how cached access translators work. Fix cached access translator in case of arrays. Use cached access translator to translate reassignments 2016-08-23 18:25:10 +03:00
Alexey Andreev
7139540dd7 JS: don't translate RHS of overloaded assignment operators twice. It can break compilation in some cases, for example, when there are lambdas in RHS.
Fix #KT-12808 #KT-12807
2016-08-23 18:25:10 +03:00
Mikhail Glukhikh
c71b65622b USELESS_ELVIS_RIGHT_IS_NULL : build fix (add to different files in DiagnosticsTestGenerated), do not report if USELESS_ELVIS already exists 2016-08-23 16:25:04 +03:00
Alexey Andreev
adb8502655 KT-13025: when receiver of call of 'invoke' method is a Function, check whether receiver is an extension function and generate additional '.call' invocation. Fix #KT-13025 2016-08-23 15:53:25 +03:00
Alexey Andreev
61ddd39f7e KT-13043: fix translation of super call from secondary constructor when base constructor has default arguments 2016-08-23 15:53:25 +03:00
Pavel V. Talanov
4e51d904d2 IntentionBasedInspection: Removing synchronizing on intention instances
Recreate intention instance in `buildVisitor`
Lock caused contention for UpSource
(cherry picked from commit 1b6c96c)
2016-08-23 10:25:04 +03:00
shiraji
dc810d548e KT-13521 Warning right part of "expression ?: null" is useless
cherry picked from commit a3f131d)
2016-08-23 10:19:14 +03:00
Kirill Rakhman
cb23c68422 Clean up quick fix package
(cherry picked from commit 2dd4194)
2016-08-22 18:16:52 +03:00
Mikhail Glukhikh
01fa0139c6 Replace with safe calls forbidden for comparisons #KT-13432 Fixed
(cherry picked from commit c07906f)
2016-08-22 18:16:43 +03:00
Kirill Rakhman
4ba465e839 Add quickfix for "A type annotation is required on a value parameter" #KT-12804 Fixed
(cherry picked from commit 1fbd667)
2016-08-22 18:16:38 +03:00
shiraji
5e68c30448 Inspection to warn on using == with array types #KT-13384 Fixed
(cherry picked from commit 1bbde54)
2016-08-22 18:03:13 +03:00
Mikhail Glukhikh
7f8a723f34 Added fake override search in unused symbol inspection #KT-13288 Fixed
(cherry picked from commit b3b83e3)
2016-08-22 18:02:18 +03:00
Mikhail Glukhikh
a67a83c61f Build fix (RemoveEmptyParenthesesFromLambdaCallInspection) : IntentionBasedInspection 1.0.x / master incompatibility 2016-08-22 17:59:37 +03:00
Dmitry Jemerov
d21a0d4f41 use less brute-force method for updating converted file content in J2K (may fix KT-13493 and friends)
(cherry picked from commit ebd45a8)
2016-08-22 16:23:06 +02:00
Kirill Rakhman
912a5db41f Add intention+inspection to remove empty parentheses from method call with single lambda parameter
Fixes #KT-13519
(cherry picked from commit 1bc2af6)
2016-08-22 15:23:30 +03:00
Kirill Rakhman
2319bfe705 fix "Can be replaced with comparison" false positive if extension method called 'equals' is used
Fixes #KT-13480
(cherry picked from commit e6e4680)
2016-08-22 15:23:18 +03:00
Kirill Rakhman
2e2b252546 Clean up intentions package
(cherry picked from commit 45b5157)
2016-08-22 15:23:05 +03:00
Yoshinori Isogai
3df578d09e KT-4519 Show first line with content of block comment when collapsed (#928)
(cherry picked from commit 7d35316)
2016-08-22 13:10:24 +02:00
Yoshinori Isogai
1ddb1f2e73 KT-12697 Expand selection action select ": Type" (#898)
(cherry picked from commit 4669fb3)
2016-08-22 12:37:47 +02:00
Ilya Gorbunov
8da75d5691 Kotlin script execution for maven: include kotlin-runtime as explicit dependency for script.
Relates to #KT-11839
(cherry picked from commit 0f8bf31)
2016-08-19 18:42:27 +03:00
Dmitry Jemerov
4a7891d8c4 diagnostics that helped catch KT-13381
(cherry picked from commit 742d7db)
2016-08-19 16:31:23 +02:00
Dmitry Jemerov
7739ae06d1 diagnostics for EA-86187 - KNPE: KDocElementFactory.createNameFromText
(cherry picked from commit ac6f0b5)
2016-08-18 17:33:43 +02:00
Dmitry Jemerov
e47bc77f06 don't try to walk over the siblings of PsiFile to check if "introduce variable" is enabled (EA-86136 - assert: SharedPsiElementImplUtil.getChildIndex)
(cherry picked from commit 8a22e1e)
2016-08-18 17:33:35 +02:00
Dmitry Jemerov
fe70636f42 stop at file level when going up the tree in KtPsiUtil.areParenthesesNecessary() (EA-86495 - NPE: KtPsiUtil.areParenthesesNecessary)
(cherry picked from commit 7ee72f2)
2016-08-18 17:33:28 +02:00
Dmitry Jemerov
2a7af137c2 check for project disposed in NewKotlinActivityAction (EA-82450 - assert: ComponentManagerImpl.getPicoContainer)
(cherry picked from commit ef791fe)
2016-08-18 17:33:20 +02:00
Mikhail Glukhikh
670e651f39 More correct handling of compile time constant types #KT-13421 Fixed
(cherry picked from commit ac3dfd9)
2016-08-18 17:46:53 +03:00
Kirill Rakhman
b4cee026d5 Add Intention to replace a..b-1 with a until b and vice versa #KT-13483 Fixed
(cherry picked from commit 354d047)
2016-08-18 17:46:40 +03:00
Alexey Sedunov
2eff9cd4a7 Light Classes: Support property accessors with non-conventional names
#KT-13032 Fixed
(cherry picked from commit fbd6edc)
2016-08-18 13:21:52 +03:00
Alexey Sedunov
76a35a7e5b Pull Up: Skip super members without explicit declarations
#KT-13124 Fixed
(cherry picked from commit 94c4b42)
2016-08-18 13:21:51 +03:00
Alexey Sedunov
0617df933b Push Down: Do not specifiy visibility on generated overriding members
#KT-12971 Fixed
(cherry picked from commit 6766494)
2016-08-18 13:21:51 +03:00
Alexey Sedunov
d583809ed7 Rename: Use RenameKotlinParameterProcessor for constructor/lambda parameters
#KT-13253 Fixed
(cherry picked from commit ad3ffda)
2016-08-18 13:21:50 +03:00
Alexey Sedunov
a61bce207c Rename: Do not report shadowing conflict if redeclaration is detected
#KT-13240 Fixed
(cherry picked from commit 2e887eb)
2016-08-18 13:21:49 +03:00
Alexey Sedunov
f9a2c3a669 Move: Warn about accessibility conflicts when moving entire file
#KT-13175 Fixed
(cherry picked from commit 8232c66)
2016-08-18 13:21:48 +03:00
Alexey Sedunov
1eb279830c Move: Warn about accessibility conflicts due to moving to unrelated module
#KT-13174 Fixed
(cherry picked from commit baa549e)
2016-08-18 13:21:47 +03:00
Alexey Sedunov
ccd1c11f1f Rename: Warn about function name conflicts
#KT-13239 Fixed
(cherry picked from commit 6a42802)
2016-08-18 13:21:46 +03:00
Alexey Sedunov
43400200c0 Rename: Fix name quoting for automatic renamers
#KT-13282 Fixed
 #KT-13283 Fixed
(cherry picked from commit 385640c)
2016-08-18 13:21:45 +03:00
Alexey Sedunov
bd126420b6 Rename: Conflict detection for type parameters
#KT-13254 Fixed
(cherry picked from commit a5da9e8)
2016-08-18 13:21:44 +03:00
Alexey Sedunov
65cfb6062d Create from Usage: Disable "Create property" (non-abstract) in interfaces. Make "Create function" (non-abstract) generate function body in interfaces
#KT-13365 Fixed
(cherry picked from commit 562488b)
2016-08-18 13:21:43 +03:00
Alexey Sedunov
f21a8c1681 Change Signature: Yield to other usage processor if target element is neither KtFunction, nor PsiMethod
#KT-13277 Fixed
(cherry picked from commit f4d9f33)
2016-08-18 13:21:43 +03:00
Kirill
dd50c29cad Make folding if to return/assignment work with if-else if-else #KT-13452 Fixed
(cherry picked from commit 1926825)
2016-08-18 09:40:25 +03:00
Kirill
0c43ff0068 Minor: make var val
(cherry picked from commit 6bb4c28)
2016-08-18 09:40:12 +03:00
Zalim Bashorov
d975f21e99 Use target of current module when find libraries with incompatible binary format
#KT-12977 Fixed
2016-08-17 20:41:18 +03:00
Nikolay Krasko
d6d3846137 Reformat main function templates 2016-08-17 20:23:47 +03:00
Nikolay Krasko
cf1bdba2cf Introduce 'maino' and 'psvmo' templates for generating main in object (KT-6520)
#KT-6520 Fixed
2016-08-17 20:22:40 +03:00
Yan Zhulanow
467d0fd10f Kapt: Gradle integration tests for the new kapt 2016-08-17 16:40:07 +03:00
Yan Zhulanow
bb370f1732 Kapt: Get rid of the 'compiler-tests' dependency in 'plugins-tests' 2016-08-17 16:40:03 +03:00
Yan Zhulanow
1391e597b4 Kapt: compile annotation-processing artifact with target "1.6" 2016-08-17 16:40:01 +03:00
Yan Zhulanow
9686344ade Kapt: Make javaCompile parameter in KotlinGradleSubplugin non-null 2016-08-17 16:40:00 +03:00
Yan Zhulanow
a9c77e1d69 Kapt: Fix type arguments order for JeDeclaredType, should not use substitutor 2016-08-17 16:39:59 +03:00
Yan Zhulanow
3ced8a677f Kapt: Support default packages in Filer 2016-08-17 16:39:58 +03:00
Yan Zhulanow
02a3e6bafe Kapt: Support inherited annotations 2016-08-17 16:39:58 +03:00
Yan Zhulanow
b248b2062f Kapt: Filter out kapt2 sources in KotlinCompile task 2016-08-17 16:39:57 +03:00
Yan Zhulanow
6e72dc83bc Kapt Gradle plugin: use the old configuration names 2016-08-17 16:39:56 +03:00
Yan Zhulanow
f4fc8f13c1 Kapt: Gradle plugin for the new kapt 2016-08-17 16:39:55 +03:00
Yan Zhulanow
e6067d595d Kapt: verbose output mode 2016-08-17 16:39:55 +03:00
Yan Zhulanow
df9c825726 Kapt: Provide toString() implementations for no-types 2016-08-17 16:39:50 +03:00
Yan Zhulanow
a14d7cee28 Kapt: Fixes in KotlinElements:
1. 'overrides()' when 'type' extends containing(overrider) and implements containing(overridden). According to documentation, In this case the function should return true.
2. Handle both kotlin.Deprecated and java.lang.Deprecated for Kotlin in 'isDeprecated'.
3. Fix 'isFunctionalInterface'.
2016-08-17 16:39:48 +03:00
Yan Zhulanow
0ff95846fb Kapt: Calculate constant values in the similar way.
Always use originalElement in JeAnnotationValue factory.
2016-08-17 16:39:44 +03:00
Yan Zhulanow
ed8e2e49ac Kapt: Use the base types in KotlinProcessingEnvironment 2016-08-17 16:39:41 +03:00
Yan Zhulanow
948a4b6157 Kapt: add some JeElement tests 2016-08-17 16:39:40 +03:00
Yan Zhulanow
3eecf78307 Kapt: add JeElementRenderer 2016-08-17 16:39:40 +03:00
Yan Zhulanow
649b93833c Kapt: Minor, refactor JeAnnotationMirror:getElementValues() 2016-08-17 16:39:39 +03:00
Yan Zhulanow
4591f134d7 Kapt: annotation-processing is not dependent on 'cli' module anymore 2016-08-17 16:39:38 +03:00
Yan Zhulanow
be31262f0e Kapt: Fixes on review 2016-08-17 16:39:34 +03:00
Yan Zhulanow
7a06a91f41 Kapt: Support Java source root processing.
Support resource file writing.
2016-08-17 16:39:32 +03:00
Yan Zhulanow
27ec053f93 Kapt: Support "*" in supported annotation qualified names (all annotations) 2016-08-17 16:39:31 +03:00
Yan Zhulanow
71c8dfb57a Kapt: Check DEFAULT modifier only in Java 8 2016-08-17 16:39:27 +03:00
Yan Zhulanow
82dcbf36e5 Kapt: Drop custom annotation stub factory, implement it with AnnotationParser in sun.reflect as done in Javac 2016-08-17 16:39:19 +03:00
Yan Zhulanow
0a684aa1d1 Kapt: Refactor kapt type wrappers. Now every ordinary (not NoType) type has a backed PsiType so it's easy to call utility functions from IntelliJ. 2016-08-17 16:39:12 +03:00
Yan Zhulanow
17ad807b82 Kapt: Analyze sources again if the received analysis result is 'RetryWithAdditionalJavaRoots'. ->
Add additional Java roots to Java source roots and clear diagnostic messages before the next analysis round.
2016-08-17 16:38:55 +03:00
Yan Zhulanow
7180961212 Kapt: Add ability to get constant value from KtLightAnnotation 2016-08-17 16:38:48 +03:00
Yan Zhulanow
32c461a7a7 Kapt: Implement Annotation Processing plugin in Kotlin (KT-13499) 2016-08-17 16:38:43 +03:00
Yan Zhulanow
1214513498 Kapt: Add APT wrappers for PSI elements 2016-08-17 16:38:33 +03:00
Zalim Bashorov
5cadbb2d20 JS: fix runtime type checking for native non-fake interfaces on WebKit (JavaScriptCore); add tests for object and object expressions.
(cherry picked from commit 33e96fc)
2016-08-17 14:27:17 +03:00
Alexander Udalov
8baf9ce3a0 Rename CompanionObjectMapping.hasMappingToObject -> isMappedIntrinsicCompanionObject
(cherry picked from commit 18887f8bec)
2016-08-16 15:04:59 +03:00
Alexander Udalov
9e6812408c Make KClasses for primitives equal to KClasses for wrapper types
Both primitive int and wrapper type java.lang.Integer are represented by the
single type kotlin.Int in Kotlin, so inequality between the corresponding
KClasses was confusing here. To keep the old behavior, one may call 'k1.java ==
k2.java' instead of `k1 == k2`

 #KT-13462 Fixed

(cherry picked from commit 5b1ee13db8)
2016-08-16 15:04:59 +03:00
Alexander Udalov
bd2763a797 Fix NPE on .companionObjectInstance for built-in classes
#KT-13370 Fixed

(cherry picked from commit 3efa738bc0)
2016-08-16 15:04:59 +03:00
Alexander Udalov
8bc65875ff Minor, make CompanionObjectMapping a singleton
(cherry picked from commit 611899e9d3)
2016-08-16 15:04:59 +03:00
Denis Zharkov
16fe13fbb3 Remove JavaToKotlinClassMap dependency on built-ins instance
(cherry picked from commit 7fe5a9db8d)
2016-08-16 15:04:59 +03:00
Kirill Rakhman
41cf8680af Allow suppressing warnings for secondary constructor (KT-12627)
#KT-12627 Fixed
2016-08-16 12:56:00 +03:00
Nikolay Krasko
970ac5a508 Make quick evaluate work on receiver in qualified expressions (KT-13269)
#KT-13269 Fixed
2016-08-16 12:32:43 +03:00
Michael Bogdanov
c427f1f7ef Fix for KT-13374: CompilationException: Inline function call with anonymous object implementing an interface by delegation
#KT-13374 Fixed
(cherry picked from commit 7325baa)
2016-08-16 10:53:21 +03:00
Natalia Ukhorskaya
ade959ef0c Eval4J: loadClass should return prepared class, otherwise ClassNotPreparedException fails in invokeMethod
#KT-12641 Fixed
2016-08-16 09:35:08 +03:00
Natalia Ukhorskaya
3caea45918 Debugger: allow to evaluate 'this' and fields in java files 2016-08-16 09:34:59 +03:00
Natalia Ukhorskaya
c6ff1b2c32 Fixes after review: get last statement in codeFragmetn using psi instead of findElementAt 2016-08-16 09:34:49 +03:00
Natalia Ukhorskaya
eb0bc8cab3 Minor: extract similar parts to separate function 2016-08-16 09:34:37 +03:00
Natalia Ukhorskaya
0ca207acb8 Debugger: allow to evaluate kotlin expressions in java files
#KT-7549 Fixed

 If the context is inside PsiJavaFile, get list of all local variables available in current frame (this logic was removed in 29778311e8 01.12.2015 Drop unnecesary logic about additional context for lambda in debugger). For each variable create KtProperty inside top-level KtFunction in KtFile and set it as contextElement for KtCodeFragment. This file should have all imports from PsiJavaFile. We do not create properties on top-level because they will be highlighted as top-level vals/vars.
2016-08-16 09:34:24 +03:00
Natalia Ukhorskaya
df375f3f1b Debugger tests: mark objects using NodeDescriptorImpl.getMarkup. Primitive values cannot be marked. 2016-08-16 09:33:45 +03:00
Stanislav Erokhin
8a38ec01a5 Fixed exception AssertionError: Illegal resolved call to variable with invoke
#KT-13330 Fixed
#KT-13349 Fixed
(cherry picked from commit 85a951d)
2016-08-15 19:25:44 +03:00
Mikhail Glukhikh
17cc7be30e Do not suggest "Replace infix with safe call" inside conditions or binary / unary expressions #KT-13328 Fixed
(cherry picked from commit b53cb91)
2016-08-15 18:49:39 +03:00
shiraji
11b4c387ff Fix problem with appending literal to variable omitting braces #KT-13336 Fixed
(cherry picked from commit 4296927)
2016-08-15 18:49:28 +03:00
Kirill
290124b3fe Implement intentions to add/remove braces to/from when entries #KT-12043 Fixed
(cherry picked from commit 223fd9f)
2016-08-15 17:20:03 +03:00
Kirill Rakhman
a7a97b6aaf Highlight use of toString() inside string interpolation as redundant #KT-10731 Fixed
(cherry picked from commit d68a681)
2016-08-15 17:19:50 +03:00
Kirill Rakhman
3f472143f2 Format spaces around !is and !in (KT-13314)
#KT-13314 Fixed
2016-08-15 16:14:00 +03:00
Mikhail Glukhikh
3edb91c98d KT-13430 related: add non-null assertion works also for UNSAFE_INFIX_CALL
(cherry picked from commit 52dacd1)
2016-08-15 10:15:28 +03:00
Mikhail Glukhikh
f3d1e7c5ae Add non-null assertion: correct handling of unary expression unsafe calls #KT-13430 Fixed
(cherry picked from commit cf2d575)
2016-08-15 10:15:16 +03:00
Mikhail Glukhikh
26d3a3dd76 Minor: convert to expression body is forbidden also for nested non-exhaustive whens
(cherry picked from commit e01e084)
2016-08-15 10:15:04 +03:00
Mikhail Glukhikh
405d966ec2 Unused symbol: handling of import as alias not only for objects / enums #KT-11933 Fixed
(cherry picked from commit 1397577)
2016-08-15 10:14:48 +03:00
Mikhail Glukhikh
013d605dca Convert to expression body is forbidden for if without else #KT-12951 Fixed
(cherry picked from commit 6a6c67d)
2016-08-15 10:14:35 +03:00
Mikhail Glukhikh
3d59603fa8 Report of UNINITIALIZED_ENUM_COMPANION also for implicit receivers #KT-11769 Fixed
(cherry picked from commit 1c5c650)
2016-08-12 18:04:45 +03:00
Mikhail Glukhikh
53775140e2 KT-11769 case with companion function call: error is now detected if companion receiver is stated explicitly
(cherry picked from commit 04f71bc)
2016-08-12 18:04:34 +03:00
shiraji
ebdda7a0ad Add quickfix for adding 'inline' to a function with reified generic #KT-6975 Fixed
(cherry picked from commit 3e58283)
2016-08-12 15:14:12 +03:00
Sergey Mashkov
25f414c099 KT-13211 KotlinCompileMojoBase could provide better compilation failure info
(cherry picked from commit 3c00262)
2016-08-12 14:02:11 +03:00
Mikhail Glukhikh
b9d2d17602 Fix for SOE in VarianceChecker #KT-13401 Fixed
(cherry picked from commit 6cf90cf + modification due to refactoring in 1.1)
2016-08-11 13:23:30 +03:00
Alexey Tsvetkov
d47dbfd163 Revert replacing convention with extension
It seems that was wrong
2016-08-10 22:20:24 +03:00
Alexey Sedunov
d6fb46c969 Introduce Property: Fix duplicate count in popup window
#KT-13395 Fixed
(cherry picked from commit 3475a1f)
2016-08-10 16:03:13 +03:00
Alexey Sedunov
71720af295 Light Classes: Do not compute annotations for light elements with invalid
origin (possible fix for KT-13199)
(cherry picked from commit ab7d48a)
2016-08-10 16:03:12 +03:00
Alexey Sedunov
f918756ad8 Move: Quote package name (if necessary) when moving declarations to new file
#KT-13385 Fixed
(cherry picked from commit 4ab25bd)
2016-08-10 16:03:12 +03:00
Alexey Sedunov
8f76445ea7 Extract Function: Skip callable reference selectors
#KT-13218 Fixed
(cherry picked from commit b793252)
2016-08-10 16:03:11 +03:00
Alexey Sedunov
22f3bd994d Create from Usage: Do not suggest creating annotations/enum classes for unresolved type parameter bounds
#KT-13364 Fixed
(cherry picked from commit 6e3d1d7)
2016-08-10 16:03:10 +03:00
Alexey Sedunov
d680ebde03 Override/Implement Members: Do not make return type non-nullable if base
return type is explicitly nullable
 #KT-13383 Fixed
 #KT-13379 Fixed
(cherry picked from commit 1a4ff59)
2016-08-10 16:03:09 +03:00
Alexey Sedunov
a06e5b207e Quick Fixes: Use simple class name in "Change function return type" quickfix
#KT-12919 Fixed
(cherry picked from commit 75573bd)
2016-08-10 16:03:08 +03:00
Alexey Sedunov
ca083757aa Override/Implement Members: Support "Copy JavaDoc" options for library classes
#KT-12997 Fixed
(cherry picked from commit f57c927)
2016-08-10 16:03:07 +03:00
Alexey Sedunov
7af981c274 Introduce Variable: Skip leading/trailing comments inside selection
#KT-13054 Fixed
(cherry picked from commit 8a9a328)
2016-08-10 16:03:07 +03:00
Alexey Sedunov
074e9620a7 Introduce Variable: Retain entered name after changing "Specify type explicitly" option
#KT-13128 Fixed
(cherry picked from commit 00b6839)
2016-08-10 16:03:06 +03:00
Alexey Sedunov
2ac07f4a41 Extract Function: Extract Function: Fix generation of destructuring declarations
#KT-13010 Fixed
(cherry picked from commit 792177f)
2016-08-10 16:03:05 +03:00
Alexey Sedunov
7cab3f102b Extract Function/Parameter/Type Alias: Automatically quote declaration name when necessary
#KT-13157 Fixed
(cherry picked from commit 06e7672)
2016-08-10 16:03:04 +03:00
Alexey Sedunov
1d74fd56ab Presentation: Render function signature in RefactoringDescriptionLocation
#KT-12943 Fixed
(cherry picked from commit 59a714c)
2016-08-10 16:03:03 +03:00
Alexey Sedunov
f420c8fb9f Introduce Variable: Do not suggest expressions without type
#KT-12922 Fixed
(cherry picked from commit 892c843)
2016-08-10 16:03:02 +03:00
Alexey Sedunov
a535daba1e Rename: Fix function description in super method warning dialog
#KT-12945 Fixed
(cherry picked from commit 3cd35f8)
2016-08-10 16:03:02 +03:00
Alexey Sedunov
d639d4099d Refactoring: Allow multiple ElementKinds when choosing element to refactor
(cherry picked from commit b5828a5)
2016-08-10 16:03:01 +03:00
Alexey Sedunov
87f93fda26 Misc: Update function/type alias signature preview upon changing checkbox state
(cherry picked from commit 09d3629)
2016-08-10 16:03:00 +03:00
Alexey Sedunov
f849cf993d Change Signature: Consider super call a by-name propagation site if either its class, or its primary constructor is a propagation target.
This fixes testJavaConstructorParameterPropagation test flickering
(cherry picked from commit 57bc0d6)
2016-08-10 16:02:59 +03:00
Alexey Sedunov
a662feb39b Convert to Kotlin: AbstractParameterTablePanel.java
(cherry picked from commit ce0e5b4)
2016-08-10 16:02:58 +03:00
Alexey Sedunov
de0012086a Convert to Kotlin: AbstractParameterTablePanel.java (rename to .kt)
(cherry picked from commit 27773fb)
2016-08-10 16:02:58 +03:00
Alexey Sedunov
3a894fdb65 Convert to Kotlin: ExtractFunctionParameterTablePanel.java
(cherry picked from commit 3d49b27)
2016-08-10 16:02:57 +03:00
Alexey Sedunov
b9ff03b510 Convert to Kotlin: ExtractFunctionParameterTablePanel.java (rename to .kt)
(cherry picked from commit abe7b8c)
2016-08-10 16:02:56 +03:00
Alexey Sedunov
c592e3f90f Refactoring: Extract AbstractParameterTablePanel class
(cherry picked from commit 6b0968c)
2016-08-10 16:02:55 +03:00
Alexey Sedunov
362b393b8d Minor: Move and rename KotlinFunctionSignatureComponent
(cherry picked from commit 9e339c1)
2016-08-10 16:02:54 +03:00
Alexey Sedunov
0d9633cff8 Refactoring: Extend expression selection utilities to support KtTypeElement
(cherry picked from commit 301f86c)
2016-08-10 16:02:54 +03:00
Alexey Sedunov
9549d623d0 Inline Variable/Property: Move test data
(cherry picked from commit 7773a1c)
2016-08-10 16:02:53 +03:00
Alexey Tsvetkov
5696c3b667 Invalidate jar cache at the end of a Gradle build
#KT-12912 fixed
2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
e1316ff069 Add simple file modification util for gradle incremental tests 2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
4e5092e2a6 Refactoring: cleanup gradle plugin 2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
a7582f6f0b Refactoring: move util functions to gradleUtils.kt 2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
af053ef160 Refactoring: remove unused ScriptHandler 2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
c5243e323c Refactoring: simplify KotlinSourceSet creation 2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
ce4f220bd9 Refactoring: extract constants 2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
7a1d7c4af5 Refactoring: stop using internal classes to create DSL extensions 2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
7b1bd21366 Refactoring: taskUtils.kt->gradleUtils.kt 2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
a204c0a4c7 Refactoring: remove usages of ProjectInternal 2016-08-10 15:52:55 +03:00
Alexey Tsvetkov
9ac897f36c Refactoring: inject FileResolver
This is part of refactoring to minimize using of internal API in gradle plugin
2016-08-10 15:52:55 +03:00
Ilya Chernikov
8c40d4aadd Attempt to fix EA-82064:
"java.lang.NoClassDefFoundError: Could not initialize class kotlin.Unit"
2016-08-10 14:15:05 +02:00
Zalim Bashorov
1bcb3eda93 JS backend: fix runtime type checking for interfaces
(cherry picked from commit 9ece62f)
2016-08-10 15:13:03 +03:00
Zalim Bashorov
0cfcef2279 Fix printing file size of generated js files for TeamCity statistics
(cherry picked from commit 060255e)
2016-08-10 15:12:56 +03:00
Dmitry Jemerov
a33c4b8f03 workaround for IDEA's issue that throws an exception when using union() on a LocalSearchScope with no elements (EA-82063 - AIOOBE: GlobalSearchScope.union)
(cherry picked from commit f08a7f1)
2016-08-10 13:29:49 +02:00
Dmitry Jemerov
2d66aa54b3 don't use document for checking whether a folding region is one-line, use only PSI, as it may not correspond to the state of the document (EA-81838 - IOOBE: LineSet.findLineIndex)
(cherry picked from commit 180f70b)
2016-08-10 13:29:38 +02:00
Dmitry Jemerov
375c3b9214 don't crash if we don't have a descriptor for the declaration under caret (EA-86248 - KNPE: KDocNameCompletionSession.doComplete)
(cherry picked from commit a4aa3cd)
2016-08-10 13:29:30 +02:00
Dmitry Jemerov
3e478f096b correct fix for showing dialog from popup callback (EA-86138)
(cherry picked from commit ddb91cc)
2016-08-10 13:29:18 +02:00
Dmitry Jemerov
c354cdef5b correct fix for invoking 'safe delete' refactoring outside of write action (EA-80766 - E: BaseRefactoringProcessor.run)
(cherry picked from commit 5c113a4)
2016-08-10 13:29:11 +02:00
Dmitry Jemerov
763fa7d193 one more missing read action in Find Usages (EA-81276 - assert: SharedImplUtil.getParent)
(cherry picked from commit 5d92f65)
2016-08-10 13:29:01 +02:00
Dmitry Jemerov
ae50e1f766 check element validity in KotlinSelectInProjectViewProvider (EA-84485 - PIEAE: OwnBufferLeafPsiElement.getContainingFile)
(cherry picked from commit f9d3804)
2016-08-10 13:28:52 +02:00
Dmitry Jemerov
033ee0953e don't check intention availability on PsiFile (EA-85587 - assert: SharedPsiElementImplUtil.getChildIndex)
(cherry picked from commit 8632790)
2016-08-10 13:28:45 +02:00
Mikhail Glukhikh
56869950c8 Do not report USELESS_CAST when casting null to nullable (special case)
(cherry picked from commit 687698d)
2016-08-10 12:36:39 +03:00
Mikhail Glukhikh
fbb9b09870 Minor: imports removed, formatting
(cherry picked from commit 8d537d2)
2016-08-10 12:29:34 +03:00
Mikhail Glukhikh
5dc7975b95 CAST_NEVER_SUCCEEDS: do not report when casting nullable to nullable #KT-260 Fixed
(cherry picked from commit 098520d)
2016-08-10 12:29:18 +03:00
Ilya Gorbunov
026134e7e0 Changelog for 1.0.4: stdlib changes
(cherry picked from commit 0ce4bce)
2016-08-09 19:08:03 +03:00
Ilya Gorbunov
08201ddb9f Docs: clarify docs for 'generateSequence'.
(cherry picked from commit ae985e24ca)
2016-08-09 18:18:26 +03:00
Ilya Gorbunov
c544ed1b70 Docs: preserve empty lines in the generated documentation to separate summary and paragraphs in the body.
(cherry picked from commit fed24c2be6)
2016-08-09 18:18:25 +03:00
Ilya Gorbunov
a245ec691d Improve FileTreeWalk documentation,
#KT-13297 Fixed

(cherry picked from commit e31167e74f)
2016-08-09 18:18:24 +03:00
Ilya Gorbunov
e933f8ebcd Document that sequences could be iterated multiple times.
#KT-13115 Fixed

(cherry picked from commit e7d250b7d7)
2016-08-09 18:18:22 +03:00
Ilya Gorbunov
69309a038e Support platform null sneaking to Closeable.use.
#KT-12894
2016-08-09 18:15:23 +03:00
Alexander Udalov
51aa31c5a5 CLI, Ant: add kotlin-reflect.jar to classpath by default, support "-no-reflect"
Note that now "-no-stdlib" implies "-no-reflect".

 #KT-13237 Fixed

(cherry picked from commit 0d26087040)
2016-08-09 11:27:32 +03:00
Mikhail Glukhikh
7606b1db1f Minor: test comment, relevant to KT-13322 2016-08-08 19:24:11 +03:00
Mikhail Glukhikh
5ac31268c8 Rewrite slice error removed for LEAKING_THIS #KT-13371 Fixed
Also EA-86478 fixed
2016-08-08 19:24:01 +03:00
Mikhail Glukhikh
94d3b4c2de Correct CFA order for enums: first own members, then entries, and at last companion object members #KT-6054 Fixed 2016-08-08 19:02:36 +03:00
Mikhail Glukhikh
7b2857f261 Report UNINITIALIZED_VARIABLE also for qualified object property #KT-12809 Fixed 2016-08-08 14:36:33 +03:00
Mikhail Glukhikh
76ac6d1571 UNINITIALIZED_ENUM_ENTRY compiler warning introduced #KT-2349 Fixed 2016-08-08 14:36:28 +03:00
Mikhail Glukhikh
4b09de89a0 CFA: No more UNRESOLVED_CALL for object / enum entry qualifiers 2016-08-08 14:36:23 +03:00
Mikhail Glukhikh
a1394bc39c ControlFlowInformationProvider: convert to Kotlin 2016-08-08 14:36:18 +03:00
Mikhail Glukhikh
28bb9ea90c ControlFlowInformationProvider.java --> ControlFlowInformationProvider.kt 2016-08-08 14:36:13 +03:00
Mikhail Glukhikh
e0d7f78bd4 DataFlowValueFactory: converted to Kotlin
(cherry picked from commit 7f9b9dd)
2016-08-08 14:36:08 +03:00
Mikhail Glukhikh
f34c9ba5c6 DataFlowValueFactory.java --> DataFlowValueFactory.kt
(cherry picked from commit b1a2a07)
2016-08-08 14:36:03 +03:00
Valentin Kipyatkov
32c6eac1f6 KT-12793 Code completion doesn't suggest abstract protected extension methods
#KT-12793 Fixed
(cherry picked from commit 6ff91d1)
2016-08-05 19:38:18 +03:00
Zalim Bashorov
5ccd5246eb JS backend: add the ability to get JS constructor function by class name and from instance. Support it for reified type parameters too. Add ability to get name of class.
#KT-5987 Fixed
 #KT-4115 Fixed
(cherry picked from commit 88ad00b)
2016-08-05 18:37:46 +03:00
Zalim Bashorov
29da38a9d2 JS backend: always (explicitly) generate constructor function for classes. Use name of class as name of constructor function when it isn't special.
#KT-4115 In Progress
(cherry picked from commit e7eb35b)
2016-08-05 18:37:05 +03:00
Nikolay Krasko
8a6fe3c1b7 Minor: rename variables 2016-08-05 16:42:06 +03:00
Nikolay Krasko
886a36da8f Decrease xmx in tests 2016-08-05 16:42:05 +03:00
Nikolay Krasko
67022ab0f8 Use nullable value and destroy it in tearDown for REPL tests 2016-08-05 16:42:03 +03:00
Nikolay Krasko
78a983c952 Fix compile error 2016-08-05 16:42:02 +03:00
Alexey Andreev
96612cae72 JS: add tests to show that #KT-12865 fixed as well 2016-08-05 16:34:27 +03:00
Alexey Andreev
861a6821a6 KT-12864: add Comparable interface to Enum metadata so that RTTI should handle is Comparable case correctly 2016-08-05 16:34:26 +03:00
Nikolay Krasko
4f466b168c Report RETURN_NOT_ALLOWED and RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY only on the return with label (KT-13340)
#KT-13340 Fixed
(cherry picked from commit 300e0ac)
2016-08-05 15:03:22 +03:00
Michael Bogdanov
0db13823e1 Disable kt13133 test on android
(cherry picked from commit 67808ef)
2016-08-05 14:17:25 +03:00
Stanislav Erokhin
e2a9c956bf Add more debug info for EA-85303 and EA-79267 2016-08-04 17:59:20 +03:00
Alexey Tsvetkov
767329fcab Update changelog for 1.0.4 2016-08-04 11:26:03 +03:00
Pavel V. Talanov
74e6d59885 Add assertions to prohibit creating LazyJavaClassDescriptor by KtLightClass
Diagnosing KT-12966
2016-08-03 17:54:07 +03:00
Pavel V. Talanov
7a4c9ab1f2 KtLightClassForDecompiledDeclaration is now marked by KtLightClassMarker
Rename: KtJavaMirrorMarker -> KtLightClassMarker
Introduce code to be able to tell light classes from source and binaries apart in 'frontend.java'
2016-08-03 17:53:54 +03:00
Alexey Tsvetkov
150b1c2640 Update changelog for 1.0.4 2016-08-03 14:59:39 +03:00
Alexey Tsvetkov
ae39a58614 Configure KotlinCompile.destinationDir before evaluation
Previously it was possible to refer to destinationDir
in gradle scripts (evaluation phase), so in order to
preserve compatibility destinationDir should be configured
before evaluation.

This does not affect android plugin because in this case kotlin
tasks were created after evaluation anyway, so it
was not possible to refer to destinationDir
during evaluation anyway.
2016-08-02 20:59:03 +03:00
shiraji
45d82f1cb7 Intention / inspection for unnecessary lateinit #KT-13011 Fixed 2016-08-02 19:52:32 +03:00
Nikolay Krasko
f7830a5843 Ignore intervals that has no mapping for origin line (KT-12896)
(cherry picked from commit a9ee10a)
2016-08-02 13:29:53 +03:00
Nikolay Krasko
aa50374705 Better search for inlined strings in strata: there might me several file mappings to the same file (KT-12896)
#KT-12896 In Progress
(cherry picked from commit 2dd7470)
2016-08-02 13:29:51 +03:00
Nikolay Krasko
7fcc7795ad Refactorings: functions moves
(cherry picked from commit ace58e8)
2016-08-02 13:29:50 +03:00
Nikolay Krasko
f7d162476a Fix breakpoints in inline functions after dexing (KT-12896)
#KT-12896 In Progress
(cherry picked from commit 5df7358)
2016-08-02 13:29:48 +03:00
Nikolay Krasko
7fa096bc43 Allow to step into inline functions while debugging Android app (KT-12896)
#KT-12896 In Progress
(cherry picked from commit 64979ae)
2016-08-02 13:29:47 +03:00
Nikolay Krasko
908debe7eb Emulate debugging after dexing for stepping tests with 'dex' prefix (KT-12896)
Remove SourceDebugExtension attribute from resulting class files

 #KT-12896 In Progress
(cherry picked from commit 2a2d7cd)
2016-08-02 13:29:45 +03:00
Nikolay Krasko
134824549a Refresh output dirs to make CompilerPaths.getModuleOutputDirectory() method work
(cherry picked from commit ad1907f)
2016-08-02 13:29:44 +03:00
Nikolay Krasko
b4f3df9224 Refactoring: introduce constants with strata names and reuse them in debugger
(cherry picked from commit 64e0349)
2016-08-02 13:29:42 +03:00
Nikolay Krasko
b8e96c48e2 Refactoring: move smapUtil and DebuggerUtils to debugger package
(cherry picked from commit 66bbcf4)
2016-08-02 13:29:41 +03:00
Mikhail Glukhikh
4c7a42ad29 KT-13113 related: KtStringTemplateExpression.singleExpressionOrNull() fixed 2016-08-02 12:59:56 +03:00
Mikhail Glukhikh
266f9d0d40 Single-expression string template is inspection for strings and intention otherwise #KT-13113 Fixed 2016-08-02 12:42:22 +03:00
shiraji
49a3ef35a7 KT-13113: Add inspection to detect single-expression string template 2016-08-02 12:42:08 +03:00
Mikhail Glukhikh
7f6be5b0bd Build fix: replace call with comparison inspection test 2016-07-29 19:46:40 +03:00
Mikhail Glukhikh
8f13c84e7c KT-13262 related: surround with null check is applicable now also for qualified calls with argument type mismatch 2016-07-29 19:17:04 +03:00
Mikhail Glukhikh
7044348086 Wrap with safe let call handles qualified calls correctly #KT-13262 Fixed 2016-07-29 19:14:01 +03:00
Mikhail Glukhikh
042fc0d3b8 Replace call with comparison inspection introduced #KT-11425 Fixed 2016-07-29 19:07:04 +03:00
Mikhail Glukhikh
7219904a87 KT-11425: convert a.compareTo(b) to binary comparison if possible 2016-07-29 19:06:37 +03:00
Mikhail Glukhikh
56c7786756 KT-11425: convert !a.equals(b) to a != b 2016-07-29 18:55:58 +03:00
Mikhail Glukhikh
5d47fdf557 KT-11425: replace call with binary operator works now also with equals() and == 2016-07-29 18:32:02 +03:00
Mikhail Glukhikh
679867bff9 ReplaceInfixCallFix --> ReplaceInfixOrOperatorCallFix 2016-07-29 18:27:27 +03:00
Mikhail Glukhikh
208798d4b0 Replace with safe call works now on UNSAFE_IMPLICIT_INVOKE #KT-12628 Fixed 2016-07-29 18:27:23 +03:00
Mikhail Glukhikh
56c9d7ecac KT-12628: !! is now correctly added to array expressions 2016-07-29 18:27:19 +03:00
Mikhail Glukhikh
3d67f8432e KT-12628: replace infix call supports now array accesses too 2016-07-29 18:27:14 +03:00
Mikhail Glukhikh
a7e4e2d5b0 KT-12628: new test for arg + something with nullable arg 2016-07-29 18:27:10 +03:00
Stanislav Erokhin
24b5be3ebe KT-13264 IAE: Argument for @NotNull parameter 'errorClass' createErrorTypeConstructorWithCustomDebugName must not be null
#KT-13264 Fixed
(cherry picked from commit aa91b5a)
2016-07-29 18:12:15 +03:00
Stanislav Erokhin
f6f5af9baa Do not add receiver for function expression by expected type.
(cherry picked from commit 2c2f105)
2016-07-29 18:12:14 +03:00
Mikhail Glukhikh
dd30bd5749 Make constructor parameter a property: additional test for private property in superclass 2016-07-29 17:58:21 +03:00
Mikhail Glukhikh
dc8c19590e Make constructor parameter a property: select 'private' to be able to remove it #KT-13187 Fixed 2016-07-29 17:58:16 +03:00
Mikhail Glukhikh
19389093c2 Make constructor parameter a property: message shortened a bit 2016-07-29 17:58:12 +03:00
Alexey Tsvetkov
3af7494d94 Add additional java source dir to source set in android test 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
57f721bb6e Refactoring: extract function to map classpath 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
9795864e30 Move call to kotlinTask.source to doTargetSpecificProcessing 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
4b825509ca Refactoring: move mapKotlinTaskProperties call to createKotlinJVMTask 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
c808fc368f Refactor classpath handling in KotlinCompile
#KT-13234 fixed
2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
167a83970d Add test for code using internal compiled incrementally
The issue was fixed during refactoring

    #KT-12923 fixed
2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
7a06d4dfe2 Track changes in generated source files
#KT-12962 fixed
2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
535ca5ddd4 Refactoring: simplify source roots search 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
7397e05aa4 Refactoring: use convention mapping for configuring classpath of kotlin tasks
#KT-12658 fixed
    #KT-12750 fixed
2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
cc5a3caf55 Refactor source configuration for android 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
c51ec9a67d Minor: cleanup 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
a8a021306e Refactoring: set task properties directly 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
28eb5c8d8e Refactoring: remove extra property to pass stubs directory 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
207b609f95 Refactoring: do not use extraProperties to pass kapt options to task 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
d65a31bea1 Refactoring: remove reflection calls 2016-07-29 17:52:28 +03:00
Alexey Tsvetkov
bf1af18dd6 Refactoring: remove remainings of custom classloader in gradle plugin 2016-07-29 17:52:28 +03:00
Pavel V. Talanov
bf68d4286a Fix compilation with '1.0.x' compiler 2016-07-29 14:55:41 +03:00
Pavel V. Talanov
9a4a7cadac Sync code in 'idea-ultimate' 2016-07-29 14:55:40 +03:00
Pavel V. Talanov
d5e8b7ab18 Fix test data 2016-07-29 14:55:38 +03:00
Pavel V. Talanov
6455c838c5 KtLightClassForSourceDeclaration.create(): check for enum entry earlier 2016-07-29 14:55:36 +03:00
Pavel V. Talanov
c0ed8b0158 LightClassDataProvider: FqName calculation is redundant now 2016-07-29 14:55:35 +03:00
Pavel V. Talanov
2fefba0802 Light class test for classes with dollars in name 2016-07-29 14:55:33 +03:00
Pavel V. Talanov
57c3f90ff2 PsiChecker test for classes with dollars in name 2016-07-29 14:55:32 +03:00
Pavel V. Talanov
985c78ea56 StubClassBuilder: correctly calculate short name when building delegates for light classes 2016-07-29 14:55:30 +03:00
Pavel V. Talanov
945e7e7889 Do not build light classes for scripts
Supports old behaviour
2016-07-29 14:55:28 +03:00
Pavel V. Talanov
5baa962dde FqName is not required to create source light classes 2016-07-29 14:55:27 +03:00
Pavel V. Talanov
e8e2d89314 Drop KtLightClass#getFqName() and some usages of classFqName in KtLightClassForDecompiledDeclaration 2016-07-29 14:55:25 +03:00
Pavel V. Talanov
2cddd4220a Local classes do not have qualified names
Mirros java psi
2016-07-29 14:55:24 +03:00
Pavel V. Talanov
43d37ff0a4 Refactor: restructure light class hierarchy for sources
KtLightClassBase
	| KtLightClassForSourceDeclaration
		| KtLightClassImpl (new!) // top level or inner/nested of top level class
		| KtLightClassForInterfaceDefaultImpls
		| KtLightClassForLocalDeclaration (new!)
			| KtLightClassForAnonymousDeclaration
				| KtLightClassForEnumEntry
2016-07-29 14:55:22 +03:00
Pavel V. Talanov
62e5fdac78 Refactor: rename KtWrappingLightClass -> KtLightClassBase 2016-07-29 14:55:21 +03:00
Pavel V. Talanov
186409902f Refactor: rename KtLightClassForExplicitDeclaration -> KtLightClassForSourceDeclaration 2016-07-29 14:55:19 +03:00
Pavel V. Talanov
a7a01654d7 Refactor: move KotlinCodeBlockModificationListener to 'idea-analysis' module 2016-07-29 14:55:17 +03:00
Pavel V. Talanov
d19e81716c Refactor: move OldPackageFacadeClassUtils to 'frontend.jvm' module 2016-07-29 14:55:16 +03:00
Pavel V. Talanov
83f38a03d9 Refactor: split classes in 'asJava' package into several subpackages to reflect their structure 2016-07-29 14:55:14 +03:00
Nikolay Krasko
02c7528cb2 Refactoring: move KtLightField interface to file with light elements 2016-07-29 14:55:12 +03:00
Pavel V. Talanov
d94b98dbc0 Drop PsiCodegenPredictor 2016-07-29 14:55:10 +03:00
Nikolay Krasko
f67f051b8f Postpone counting fqName for anonymous classes (KT-12645)
#KT-12645 Fixed
2016-07-29 14:55:09 +03:00
Alexander Udalov
0c0c8364ae Fix test data after bc8953b 2016-07-29 14:43:55 +03:00
Nikolay Krasko
d9715cc286 Refactoring: extract DebuggerClassNameProvider
(cherry picked from commit 5a5cd0e)
2016-07-28 16:07:39 +03:00
Nikolay Krasko
8466158c0d Minor: invert if, clean up
(cherry picked from commit 50e196d)
2016-07-28 16:07:38 +03:00
Nikolay Krasko
95592e83b0 Refactoring: fix weak warning about unnecessary escaped dot
(cherry picked from commit 097288d)
2016-07-28 16:07:36 +03:00
Nikolay Krasko
8237c71aa4 Refactoring: extract pattern to variable and add language injection
(cherry picked from commit e7ee0d1)
2016-07-28 16:07:34 +03:00
Nikolay Krasko
8384e2fe76 Refactoring: additional changes in smap functions and KotlinExceptionFilter
(cherry picked from commit 071285f)
2016-07-28 16:07:33 +03:00
Nikolay Krasko
27b44e7383 Refactoring: working with smap methods
(cherry picked from commit f71e244)
2016-07-28 16:07:32 +03:00
Nikolay Krasko
24d3bc60ec Refactoring: extract functions working with smap to separate file
(cherry picked from commit fcf0b7a)
2016-07-28 16:07:30 +03:00
Stanislav Erokhin
8903350918 Add assertion for variable as function call with explicit type parameters.
(cherry picked from commit f3be1b8)
2016-07-27 18:49:57 +03:00
Alexey Andreev
8e3d8169b7 KT-13160: when decomposing assignment with lhs like array[index], extract array instead of supporting only qualifier.name` 2016-07-27 18:38:03 +03:00
Dmitry Petrov
515570c935 KT-13241 Indices optimization leads to VerifyError with smart cast receiver
Use expected receiver type from the corresponding extension function.
2016-07-27 12:55:00 +03:00
Alexander Udalov
8bdca3b31e Never resolve modality of members to SEALED
(cherry picked from commit 0380b6cd88)
2016-07-26 22:19:05 +03:00
Alexander Udalov
7d2fbd683d Fix algorithm of determining modality for fake overrides
Previously we inferred "open" if there was at least one open member in the
hierarchy. However, that's not correct when that member is overridden by
another member in the hierarchy which is abstract. This led to incorrect code
being accepted by the front-end, and an exception during the bridge generation

 #KT-12467 Fixed

(cherry picked from commit b72293883d)
2016-07-26 22:16:57 +03:00
Mikhail Glukhikh
63435b4d77 Cast never succeeds: special 'Nothing' / 'Nothing?' case 2016-07-26 19:43:35 +03:00
Mikhail Glukhikh
68af26c994 Standard library regenerated 2016-07-26 19:43:29 +03:00
Mikhail Glukhikh
feab6f3262 kotlin-stdlib-gen: UNCHECKED_CAST instead of CAST_NEVER_SUCCEEDS 2016-07-26 19:43:23 +03:00
Mikhail Glukhikh
7d9aa0449f Suppress CAST_NEVER_SUCCEEDS removed from standard library code 2016-07-26 19:43:18 +03:00
Mikhail Glukhikh
d448a920ec Suppress CAST_NEVER_SUCCEEDS removed from source code 2016-07-26 19:43:12 +03:00
Mikhail Glukhikh
5fc797a3ef CAST_NEVER_SUCCEED: replace subtyping check with subclassing check #KT-13206 Fixed 2016-07-26 19:43:06 +03:00
Mikhail Glukhikh
47fd9906d5 KT-13170 related: correct handling of inspection parameters in additional checker 2016-07-26 19:17:21 +03:00
Mikhail Glukhikh
0589b4829a Has platform type inspection: do not report by default on Kotlin types with platform arguments #KT-13170 Fixed
Also #KT-12820 Obsolete
2016-07-26 19:17:16 +03:00
Mikhail Glukhikh
57eb4c1fcb Can be val inspection: local functions are taken into account #KT-13151 Fixed 2016-07-26 19:16:27 +03:00
Nikolay Krasko
501f2d199b Don't store analyze result longer than ModuleResolverProvider valid time
For synthetic files there might be file modifications without PsiModificationTracker.MODIFICATION_COUNT increment.
2016-07-26 17:45:00 +03:00
Nikolay Krasko
5c3e65da8c Remove psi modification tracker from pooled threads (EA-86038, KT-13163)
IDEA 163 explicitly forbids such tricks with exceptions.
(cherry picked from commit 3c8e35f)

 #KT-13163 Fixed
2016-07-26 17:24:55 +03:00
Michael Bogdanov
c1c53b42d6 Test for KT-13182: Regression: compiler internal error at inline
(cherry picked from commit 9b9abb2)
2016-07-26 16:18:54 +03:00
Michael Bogdanov
3e807149d9 Fix for KT-13133: Incorrect InnerClasses attribute value for anonymous object copied from an inline function
#KT-13133 Fixed
(cherry picked from commit 99cdc41)
2016-07-26 16:18:07 +03:00
Nikolay Krasko
f05364c8f9 Run SafeDeleteFix without run action to avoid "Refactorings should not be started inside write action" (KT-13207)
(cherry picked from commit a0226f3)
 #KT-13207 Fixed
2016-07-26 13:57:41 +03:00
Nikolay Krasko
919ef3c8ad Add "Studio" as version separator (KT-13184)
#KT-13184 Fixed
2016-07-26 13:57:41 +03:00
Alexander Udalov
54e81bc6b9 Move tests on KClass.java* to box/classLiteral/java
Also replace WITH_REFLECT to WITH_RUNTIME to test that these cases correctly
work without reflection in the classpath

(cherry picked from commit 0ea885ce58)
2016-07-26 13:53:56 +03:00
Alexander Udalov
ed8601797d Minor, make JavaClassProperty intrinsic a singleton
(cherry picked from commit 28dc5d788c)
2016-07-26 13:52:38 +03:00
Pavel V. Talanov
f326b95703 Show all Kotlin annotations when browsing hierarchy of "java.lang.Annotation" 2016-07-26 11:43:48 +03:00
Pavel V. Talanov
2c7d02fb7d Index enum classes as if they have "Enum" in supertypes
#KT-13057 Fixed
2016-07-26 11:43:36 +03:00
Pavel V. Talanov
9cc7591f90 Add test for KT-13057 with infrastructure 2016-07-26 11:43:25 +03:00
Alexey Andreev
491210db1e KT-12275 Add JS optimization that transforms the following code
```
do {
    X
    if (B) break;
} while (A)
```

to

```
do {
    X
} while (!B && A)
```

Add inversion that takes boolean expression and applies negation to it, simplifying if possible (like !!a => a).
2016-07-25 18:49:09 +03:00
Alexey Andreev
ce9fc1030a KT-12275 Add JS optimization that transforms the following code
```
do {
    guard: {
        // do something
        break guard;
        // do something
    }
} while (condition)
```

to

```
do {
    // do something
    continue;
    // do something
} while (condition)
```
2016-07-25 18:49:09 +03:00
Alexey Andreev
62f21eef3a KT-12275 Preserve evaluation order when do..while loop with extractable condition contains continue statement 2016-07-25 18:49:08 +03:00
Alexander Udalov
0e0d818006 Fix compilation 2016-07-25 16:42:23 +03:00
Alexander Udalov
c930b4f7c1 Minor, add comment, remove warning suppression
(cherry picked from commit 3ef3bb8251)
2016-07-25 15:58:04 +03:00
Alexander Udalov
cd37eded97 Move some members from OverrideResolver to OverridingUtil
(cherry picked from commit d945c33d5e)
2016-07-25 15:57:55 +03:00
Alexander Udalov
88ce657e1b Minor, inline HashSetUtil#symmetricDifference
(cherry picked from commit aaf618e035)
2016-07-25 15:57:13 +03:00
Alexander Udalov
03b32e74fa Simplify OverrideResolver#filterOverrides
- move source vs binary equivalent call filtering hack to
  ResolutionResultsHandler (see c4778bfe5a for
  the original commit introducing this behavior)
- rewrite the algorithm so that it doesn't need noDuplicates in the beginning:
  modulo the hack above whish is only needed in ResolutionResultsHandler,
  descriptor equivalence is checked anyway in OverrideResolver#overrides

(cherry picked from commit 475fb6e8a7)
2016-07-25 15:57:09 +03:00
Alexander Udalov
4c015924c5 Move OverrideResolver#generateOverridesInAClass to CollectionStubMethodGenerator
Also simplify substantially

(cherry picked from commit a6faab834d)
2016-07-25 15:57:05 +03:00
Alexander Udalov
33a787f4ae Use kotlin.Function1 instead of intellij Function in OverrideResolver
(cherry picked from commit bbd1e889a6)
2016-07-25 15:57:00 +03:00
Alexander Udalov
a50ad588ad Remove OverrideResolver#filterOutOverriding, simplify the only usage
(cherry picked from commit 191f532675)
2016-07-25 15:56:56 +03:00
Alexander Udalov
2c4128b50c Remove unreachable code in ResolutionResultsHandler
(cherry picked from commit 5d04fa3c2f)
2016-07-25 15:56:52 +03:00
Alexander Udalov
bb6414a217 Move utilities used in IDE from OverrideResolver to descriptorUtils.kt
(cherry picked from commit 89c5799155)
2016-07-25 15:56:40 +03:00
Alexander Udalov
cb510a993e Remove unnecessary loop from OverrideResolver#filterOverrides
It was not needed because overridability in both ways is already checked in
DescriptorEquivalenceForOverrides, which is called in
OverrideResolver#overrides

(cherry picked from commit 24c383a009)
2016-07-25 15:56:11 +03:00
Alexey Tsvetkov
bcf3db7979 Update changelog 2016-07-25 15:53:46 +03:00
Kirill Rakhman
39e0cb9cd4 Quickfix "Make primary constructor parameter a val" makes the val private now
Fixes #KT-13187
(cherry picked from commit ce80f94)
2016-07-25 12:29:02 +03:00
Yoshinori Isogai
90180172bc KT-12887 Extend selection should select call's invoked expression (#904)
#KT-12887 fixed
(cherry picked from commit 8aaf28e)
2016-07-22 20:28:59 +02:00
Alexander Udalov
bc8953b957 Remove quotes around visibility in invisible member diagnostic
(cherry picked from commit 83000c50ff)
2016-07-22 18:15:52 +03:00
Alexander Udalov
81c5211007 Improve error message for inaccessible invisible_fake members
#KT-8989 Fixed

(cherry picked from commit b6b2303aa7)
2016-07-22 18:15:50 +03:00
Alexander Udalov
67465fda94 Do not report "reflection is not available" on built-in sources
(cherry picked from commit a92f0a0446)
2016-07-22 18:15:47 +03:00
Alexander Udalov
289b8682a9 Check presence of dispatch receiver parameter in modifier checks
Also fix typo in "inapplicable infix" diagnostic message

(cherry picked from commit 9be219b69c)
2016-07-22 18:15:38 +03:00
Alexander Udalov
e4c7395950 Fix quotes in diagnostic messages
See 8316953259

(cherry picked from commit 2a390155a9)
2016-07-22 18:15:32 +03:00
Mikhail Glukhikh
5232af595c KT-10903 Lambda to callable reference: use named arguments if needed, lift restriction about parameter default values 2016-07-22 17:24:08 +03:00
Kirill Rakhman
4755596301 AddConstModifierIntention: handle more edge cases #KT-13173 Fixed 2016-07-22 16:13:54 +03:00
Nikolay Krasko
f1d463fd80 Do not fail on adding sources to libraries that can't be recognized (EA-73238)
It's valid situation when user in Gradle project had created ordinal Java module and wants to configure
it with Kotlin. We should add Gradle library to dependency but there's no need to configure sources for it.

(cherry picked from commit adbb07f)
2016-07-22 15:30:34 +03:00
Nikolay Krasko
af53d56d47 Minor: fix warning
(cherry picked from commit 0f4319d)
2016-07-22 15:30:33 +03:00
Nikolay Krasko
2f93710e92 Evaluate getting text under read action (EA-82155, EA-82587)
(cherry picked from commit 95d0604)
2016-07-22 15:30:31 +03:00
Nikolay Krasko
8824c1fa0d Don't fail if there's no modules in combobox with unconfigured modules (EA-76203)
Confirmed reproduction steps:
1. Open Kotlin gradle project (or do the sync) - it will be considered unconfigured until synchronisation is finished
2. Click configure and see Choose Configuration popup
3. Wait sync is finished
4. Click proposed configurator in popup

As all projects are considered configured now, single module selection will be empty
(cherry picked from commit 3d0cfdf)
2016-07-22 15:30:30 +03:00
Alexander Udalov
d581e4a08c Fix type of reference to protected var
#KT-12982 Fixed

(cherry picked from commit 9ab8da2ef9)
2016-07-22 12:07:54 +03:00
Alexander Udalov
52979fd215 Minor, inline LexicalScope.Companion.empty
(cherry picked from commit 6baf3ae737)
2016-07-22 12:07:54 +03:00
Alexander Udalov
a29ef253bf Simplify code in callable reference resolution
(cherry picked from commit 2fcd4e955a)
2016-07-22 12:07:54 +03:00
Alexander Udalov
50f9dc364b Fix "rewrite at slice LEXICAL_SCOPE" during callable reference resolution
Following the TODO in CallableReferencesResolutionUtils.kt, delete the
suspicious scope and use the new resolution process with the qualifier which
was obtained after the resolution of LHS. However, by default the tower
resolution algorithm also considers each qualifier as a class value as well,
which would be wrong here because resolution of LHS as a "value" happens
earlier in DoubleColonExpressionResolver and with slightly different rules. To
avoid that, do not mix in the "explicit receiver" scope tower processor when
creating processors for callable reference resolution.

Also delete unused functions and classes related to deleted scope, refactor
Scopes.kt

 #KT-8596 Fixed

(cherry picked from commit 00f1415ed7)
2016-07-22 12:07:54 +03:00
Mikhail Glukhikh
e5ecad7379 Build fix: inconsistency with master in *.txt rendering in tests 2016-07-22 11:56:39 +03:00
Mikhail Glukhikh
f47cd6e9d5 Source code cleanup: leaking this quick fixes applied
(cherry picked from commit 31cdc91)
2016-07-22 10:17:36 +03:00
Mikhail Glukhikh
28261f651b KT-12152: quick fix "make final" for member / containing class
(cherry picked from commit de3fbe3)
2016-07-22 10:16:13 +03:00
Mikhail Glukhikh
4c7d96160d KT-12152 : leaking this inspection: accessing non-final member / this in non-final class
(cherry picked from commit a22e7d3)
2016-07-22 10:16:02 +03:00
Mikhail Glukhikh
f8b0dafb04 KT-12152 : constructor consistency: non-final function calls
(cherry picked from commit 3d6bd81)
2016-07-22 10:15:30 +03:00
Mikhail Glukhikh
d940b1138b KT-12152 : constructor consistency: distinguish properties with and w/o backing fields, with default / custom accessors
(cherry picked from commit be40cf8)
2016-07-22 10:15:18 +03:00
Mikhail Glukhikh
e0dbef4dd5 KT-12152 : constructor consistency: handle open property accessing
(cherry picked from commit 422ea4c)
2016-07-22 10:15:08 +03:00
Mikhail Glukhikh
314615c8fa KT-12152 : constructor consistency: handle non-final classes
(cherry picked from commit f7b5d67)
2016-07-22 10:14:53 +03:00
Mikhail Glukhikh
0ceabd434f KT-12152 : constructor consistency analysis, base cases
(cherry picked from commit 8e18165)
2016-07-22 10:14:42 +03:00
Michael Bogdanov
6392b1cb8d 'superConstructorCall' test folder moved under 'innerNested'
(cherry picked from commit 1d5924d)
2016-07-21 19:12:21 +03:00
Michael Bogdanov
7f1e28ad94 Removed obsolete code in 'lookupConstructorExpressionsInClosureIfPresent' method
(cherry picked from commit 55382ba)
2016-07-21 19:12:18 +03:00
Michael Bogdanov
be56010608 Fix for KT-11833: Error generating constructors of class null with kind IMPLEMENTATION on anonymous object inheriting from nested class of super class
#KT-11833 Fixed
(cherry picked from commit 5dca4db)
2016-07-21 19:12:15 +03:00
Mikhail Glukhikh
2ac8a66ad9 A pair of "Suppress" changed from CAST_NEVER_SUCCEEDS to UNCHECKED_CAST 2016-07-21 15:35:19 +03:00
Mikhail Glukhikh
2629d5502b Array<Subtype> can be now cast to Array<Supertype(?)> without CAST_NEVER_SUCCEEDS #KT-6391 Fixed 2016-07-21 15:35:16 +03:00
Mikhail Glukhikh
9e6f4bf5d7 KT-6391: Arrays with same erased types counted as cast-compatible now 2016-07-21 15:35:13 +03:00
Mikhail Glukhikh
731a6704ab Remove setter parameter type inspection #KT-5771 Fixed 2016-07-21 15:22:28 +03:00
Alexey Tsvetkov
4df0432d83 Update changelog for 1.0.4 2016-07-21 14:59:03 +03:00
Alexey Tsvetkov
bf00a7c0e3 Update changelog for 1.0.4 2016-07-20 22:31:55 +03:00
Michael Bogdanov
f1ee066bd5 'getSuperCallLabelTarget' refactoring
(cherry picked from commit 6da9702)
2016-07-20 16:59:34 +03:00
Michael Bogdanov
bc70b0d822 Fix for KT-11634: UOE in ConstructorContext.getOuterExpression for super call in delegation
#KT-11634 Fixed
(cherry picked from commit 6f41e3b)
2016-07-20 16:59:32 +03:00
Natalia Ukhorskaya
0de42d9660 Debugger: check that label for marked object is a valid java identifier (KT-12651)
#KT-12651 Fixed
2016-07-19 17:56:15 +03:00
Nikolay Krasko
216c7c04b1 Remove call invokeAndWait() under read lock in debugger (KT-13037)
Call to invokeAndWait() in dispatch thread or in situation when read lock isn't held left untouched. Can't remove invokeAndWait() completely because without the
progress bar idea looks to be stacked on debugger start because of long search for inline functions usages (searching for breakpoints places).

 #KT-13037 Fixed
2016-07-19 16:22:47 +03:00
Mikhail Glukhikh
d9818bd3a5 Grammar: obsolete 'annotationEntry' changed to 'unescapedAnnotation' in a few places 2016-07-19 15:02:55 +03:00
Mikhail Glukhikh
7bdf55646e Grammar: obsolete 'package' element removed #KT-8429 Fixed 2016-07-19 15:02:52 +03:00
Mikhail Glukhikh
904a18cf08 A set of soft modifiers added to grammar #KT-13143 Fixed 2016-07-19 15:02:48 +03:00
Dmitry Jemerov
ba5760c913 fix muted test KotlinFindUsagesWithLibraryTestGenerated$KotlinLibrary.testLibraryCompanionObjectUsages
(cherry picked from commit 3ad6dae)
2016-07-19 13:28:22 +02:00
Dmitry Jemerov
59fcab987c in REPL tests, wait for process destroyed handler to fire after destroying process and before performing the rest of dispose
(cherry picked from commit dc0020b)
2016-07-19 13:28:16 +02:00
Dmitry Jemerov
b5a0cef907 fix muted test MultiFileIntentionTestGenerated.testImplementAbstractMember_implementVarInJava_ImplementAllInJava: apply intention in deterministic order, remove trailing space in expected output file
(cherry picked from commit 30f00bb)
2016-07-19 11:29:53 +02:00
Dmitry Jemerov
fa8d62c834 fix testdata for muted test IntentionTestGenerated$ReplaceItWithExplicitFunctionLiteralParam.testApplicable_nestedFunctionWithIt
(cherry picked from commit 9100ca8)
2016-07-19 11:29:53 +02:00
Kirill
a9bfb336f9 Implement quickfix for wrong long suffix
Fixes: KT-13134
(cherry picked from commit b9d235d)
2016-07-19 09:52:17 +03:00
Alexey Andreev
536f5f04d1 JS: in tests add verifier that checks whether no expression statements with only null expression exist 2016-07-18 19:31:40 +03:00
Alexey Andreev
4722752fd0 JS: add TranslationContext.cacheExpressionIfNeeded and use it where possible 2016-07-18 19:31:40 +03:00
Alexey Andreev
03d3035efe JS: add tests for support of 'for' statement in TemporaryAssignmentElimination 2016-07-18 19:31:40 +03:00
Alexey Andreev
d0d66f7719 JS: add tests to prove that KT-8003, KT-8318 and KT-12157 are no longer reproducible 2016-07-18 19:31:39 +03:00
Alexey Andreev
06bab7aa15 JS: minor code style and formatting fixes 2016-07-18 19:31:39 +03:00
Alexey Andreev
1e018388b6 JS: refactor generation of temporary variables 2016-07-18 19:31:39 +03:00
Alexey Andreev
fffec436a5 JS: get rid of JsEmptyExpression, use JsLiteral.NULL instead, rely on optimizer to remove redundant code 2016-07-18 19:31:38 +03:00
Alexey Andreev
f389c17c30 JS: during translation of expression mark assignment to temporary variables as synthetic statement.
This helps optimizer to find and eliminate temporary variables.
2016-07-18 19:31:38 +03:00
Dmitry Jemerov
73ec2163b6 to reduce VM contention between JVM with tests and JVM with Ant, run Ant with -Xmx128m
(cherry picked from commit 82babaf)
2016-07-18 17:01:34 +02:00
Dmitry Jemerov
54d61dc86b to ensure that JNA uses the DLL version from the jar and not an incompatible version that happens to be available on the machine running the tests, run tests with -Djna.nosys option
(cherry picked from commit 5224ad7)
2016-07-18 17:01:27 +02:00
Dmitry Jemerov
38341e0acd delete work dir after each JPS test
(cherry picked from commit b315a07)
2016-07-18 17:01:19 +02:00
Mikhail Glukhikh
5cafae59e1 KotlinJUnitStaticEntryPoint.wasSelected made public field #KT-13114 Fixed 2016-07-18 14:19:36 +03:00
Mikhail Glukhikh
ce0c43c59a Lambda to callable reference: inspection is optional depending on text length 2016-07-18 12:20:04 +03:00
Mikhail Glukhikh
b620099f32 Convert lambda to callable reference intention / inspection #KT-10903 Fixed 2016-07-18 12:19:47 +03:00
Denis Zharkov
f316973e12 Fix test data after 4725dd3 2016-07-16 09:12:57 +03:00
Denis Zharkov
df64f5ff19 Fix ConvertTextJavaCopyPasteProcessor after 4725dd3
In cases like 'fun foo() = \n fun dummy(){}'
declaration on the next line is parsed as top-level declaration.

But ConvertTextJavaCopyPasteProcessor expects that 'fun dummy(){}'
would be a part of an expression body, so we replace "\n" with " "
to turn off recovery in the case

See TextJavaToKotlinCopyPasteConversionTestGenerated.testAsExpressionBody
2016-07-16 09:12:57 +03:00
Denis Zharkov
8c22e8588a Minor. Drop unused method 2016-07-15 19:08:43 +03:00
Denis Zharkov
3ddd48472a Implement recovery for incomplete expression before declaration
It's needed when declarations are parsed as a part of previous expression
(see tests)

Currently we apply this kind of recovery in a conservative way,
only when declaration starts at the next line, and while
the condition could be relaxed, there's no need to do this

 #KT-4948 Fixed
 #KT-7118 Fixed
2016-07-15 19:08:43 +03:00
Denis Zharkov
00ccd3eccb Minor. Invert boolean parameter meaning
It looks much more sensible to me
2016-07-15 19:08:43 +03:00
Denis Zharkov
c2ac753758 Add EOL to EXPRESSION_FOLLOW recovery set
This change is used in further commits, but it's extracted
to emphasize that testData modifications are caused by this.
2016-07-15 19:08:42 +03:00
Alexey Sedunov
a51d3fc12a Create from Usage: Show target class name in the text of "Create member" quick fix 2016-07-15 02:20:22 +03:00
Alexey Sedunov
47073b5381 Minor: Convert CallablePlacement to sealed class 2016-07-15 02:20:20 +03:00
Alexey Sedunov
7b54ad0ec9 Rename: Fix exception on property rename preview 2016-07-15 02:20:19 +03:00
Alexey Sedunov
c0d5df15f7 Create from Usage: Show receiver type in the text of "Create extension" quick fix 2016-07-15 02:20:18 +03:00
Alexey Sedunov
917cd22327 Create from Usage: Approximate unresolvable types
#KT-7722 Fixed
2016-07-15 02:20:17 +03:00
Dmitry Jemerov
2cbabcc50f show line markers for properties defined in the primary constructor (KT-12626)
(cherry picked from commit e224041)
2016-07-14 23:37:34 +02:00
Dmitry Jemerov
313aab24d6 do not reenter indices to avoid deadlock
#KT-12718 Fixed
(cherry picked from commit 4391d83)
2016-07-14 23:36:24 +02:00
Dmitry Jemerov
34f8371613 don't consider calls to methods with the same name as a property to be calls to accessors of that property
#KT-12813 Fixed
(cherry picked from commit 5380b63)
2016-07-14 23:36:07 +02:00
Dmitry Jemerov
51d30a036a correctly find usages of overridden Java method through synthetic accessors
#KT-12869 Fixed
(cherry picked from commit 14037f0)
2016-07-14 23:35:48 +02:00
Alexey Andreev
dda9ae3d41 JS: refactor TemporaryVariableElimination 2016-07-14 18:02:16 +03:00
Alexey Tsvetkov
792d33f1f6 Correct test case for KT-12776
After minifying test, it stopped failing without fix
2016-07-14 16:43:32 +03:00
Alexey Tsvetkov
3ec6e94955 Do not force dependency resolution when configuring kapt with stabs
#KT-12776 fixed
2016-07-14 16:00:03 +03:00
Dmitry Jemerov
1f3b0ee950 Kotlin JUnit run configuration producer needs to take precedence over IDEA's PatternConfigurationProducer
#KT-13084 Fixed
(cherry picked from commit b09fc7c)
2016-07-13 16:08:52 +02:00
Dmitry Jemerov
af6c73156e add alternate path to common.jar dependency to work around the fact that it's no longer shipped in plugins/android/lib since AS 2.2 preview
(cherry picked from commit e66e292)
2016-07-13 13:43:34 +02:00
Dmitry Jemerov
25e8fea4fd ClsWrapperStubPsiFactory can be a singleton
(cherry picked from commit 5201fc1)
2016-07-13 13:17:12 +02:00
Alexander Udalov
2ede98f430 Minor, fix yellow code in OverrideResolver and OverridingUtil
(cherry picked from commit 87387d030f)
2016-07-13 13:44:36 +03:00
Alexander Udalov
d7158cab88 Suppress UNCHECKED_CAST instead of CAST_NEVER_SUCCEEDS in several places
This is related to KT-6611 being fixed recently. Note that not all cases of
incorrect "cast never succeeds" were fixed

(cherry picked from commit 8f33830f29)
2016-07-13 13:44:12 +03:00
Alexander Udalov
f143c8a40a Fix AssertionError in DescriptorResolver#checkBounds
#KT-9620 Fixed

(cherry picked from commit 13b0fda3c2)
2016-07-13 13:44:05 +03:00
Denis Zharkov
d0b4c29c9e Increase SOURCE_STUB_VERSION
It's necessary because of changes in parser
(mostly recovery f1026935a0)
2016-07-13 13:22:58 +03:00
shiraji
543c6bc6a1 Implement inspection to remove @ from annotation argument #KT-9228 Fixed 2016-07-13 12:57:29 +03:00
Dmitry Jemerov
0ad8c53706 specify FQ names for collection types as well
(cherry picked from commit c80e094)
2016-07-12 17:35:18 +02:00
Dmitry Jemerov
7b761dcf55 more sensible docs for @MustBeDocumented
(cherry picked from commit e492d23)
2016-07-12 16:26:58 +02:00
Dmitry Jemerov
4983b787d8 fix qualified links in Module.md
#KT-11373 Fixed
(cherry picked from commit ccbc19f)
2016-07-12 16:26:51 +02:00
Mikhail Glukhikh
c1faed5ab9 KT-12942 related: remove braces now does not work for if inside if 2016-07-12 17:20:34 +03:00
Mikhail Glukhikh
29a7bfed09 When to if now add braces for if branches inside #KT-12942 Fixed 2016-07-12 17:20:29 +03:00
Mikhail Glukhikh
828f4bfada Specify type explicitly: do not consider star projection arguments in KotlinType.isFlexibleRecursive() #KT-13055 Fixed 2016-07-12 17:19:32 +03:00
Mikhail Glukhikh
eb05a7a493 Can be primary constructor property: check whether property belongs to the same class #KT-12876 Fixed 2016-07-12 17:18:56 +03:00
Nikolay Krasko
b6a9e2da16 Generate linenumber for goto instruction in while (KT-13059)
Otherwise linenumber for previous instruction will be used in debugger. That can lead to error stepping
because it might be line that isn't reachable on current iteration.

 #KT-13059 Fixed
2016-07-12 14:37:02 +03:00
Nikolay Krasko
db2de7f55f Refactoring: invert if 2016-07-11 20:21:23 +03:00
Nikolay Krasko
d518fe67a6 Disable local mirrors for public teamcity 2016-07-11 20:21:23 +03:00
Nikolay Krasko
887e334517 Tests for Gradle inspections with configured Gradle project 2016-07-11 20:21:23 +03:00
Nikolay Krasko
0a9e48dd6a Warn about using different versions of Kotlin plugin and standard library in Gradle (KT-12730)
#KT-12730 Fixed
2016-07-11 20:21:23 +03:00
Nikolay Krasko
87f7a1b784 Fix getting external path for retrieving gradle model 2016-07-11 20:21:23 +03:00
Nikolay Krasko
f2eb7a5c59 Refactoring: extract method for getting Kotlin plugin version and remove findAllRecursively usage 2016-07-11 20:21:23 +03:00
Nikolay Krasko
607020e781 Use internalName for compare with module name 2016-07-11 20:21:23 +03:00
Pavel V. Talanov
60a3f2b268 Increase BINARY_STUB_VERSION
Should have been done after earlier changes: 022ef6410d
2016-07-11 19:05:29 +03:00
Pavel V. Talanov
0780c5d9b8 Put all stub versions into one place, explain their meaning 2016-07-11 19:05:27 +03:00
Pavel V. Talanov
fe8d0a8578 update ChangeLog for 1.0.3 2016-07-11 19:05:25 +03:00
Nikolay Krasko
1a6c7a6bf8 Fix LocalVarShadowingMemberProperty test by renaming test files 2016-07-11 13:06:05 +03:00
Denis Zharkov
3a1db42b6a Fix ClassCastException when data object is being analyzed
#KT-12687 Fixed
2016-07-10 15:05:10 +03:00
Michael Bogdanov
6af3635ba8 Print bytecode on linenumber test fail
(cherry picked from commit 93f6761)
2016-07-09 15:24:31 +03:00
Michael Bogdanov
e0b551443a Fix for KT-13040: Invalid bytecode generated for extension lambda invocation with safe call
#KT-13040 Fixed
(cherry picked from commit 23a0e19)
2016-07-09 15:10:33 +03:00
Michael Bogdanov
3ae5d3ad08 Fix for KT-12908: Variable initialization in loop causes VerifyError bad local variable type
#KT-12908 Fixed
(cherry picked from commit 486aa56)
2016-07-09 15:08:51 +03:00
Nikolay Krasko
be1241bf6d Fix bad refactoring 2016-07-08 21:37:49 +03:00
Nikolay Krasko
eeada69515 Minor: add some comments after review 2016-07-08 21:20:20 +03:00
Nikolay Krasko
0ddc79dc0f Support multi-module environment in DifferentKotlinGradleVersionInspection 2016-07-08 21:20:18 +03:00
Nikolay Krasko
38adac8612 Make DifferentKotlinGradleVersionInspection inpection work for classpath call with braces 2016-07-08 21:20:11 +03:00
Nikolay Krasko
737a1d0dbf Update description in DifferentKotlinMavenVersionInspection 2016-07-08 21:20:09 +03:00
Nikolay Krasko
2b697a69e2 Refactoring: extract strings 2016-07-08 21:20:08 +03:00
Nikolay Krasko
a27c3f506b Fallback to properly resolved version if heuristic doesn't work in DifferentKotlinGradleVersionInspection 2016-07-08 21:20:06 +03:00
Nikolay Krasko
59da76d7d1 Add inspection that warns if Gradle plugin version differs from the one in IDE (KT-12730)
#KT-12730 Fixed
2016-07-08 21:20:05 +03:00
Dmitry Jemerov
121b3db2e9 fix incompatibility with ASM 6: don't call getReturnType() on a type which is not a method type (IDEA-158090) 2016-07-08 17:20:31 +02:00
Denis Zharkov
0d5090c41d Extend recovery set when expecting property accessor
#KT-12987 Fixed
2016-07-08 16:12:34 +03:00
Denis Zharkov
3cd8a15477 Add recovery for properties without name
If property name is parsed on the next line and declaration is invalid
(no receiver/type/initializer), treat that name as it does not belong to property

 #KT-12987 In Progress
2016-07-08 16:12:34 +03:00
Denis Zharkov
3798f3932e Minor. Drop redundant AnnotationParsingMode 2016-07-08 16:07:59 +03:00
Denis Zharkov
162f7a4e40 Minor. Extract parsePropertyDelegateOrAssignment 2016-07-08 16:07:59 +03:00
Denis Zharkov
4d651fd54a Minor. Cleanup KotlinParsing
- Remove unused field and commented code
- Add some comments
- jet -> kotlin
2016-07-08 16:07:59 +03:00
Denis Zharkov
63cdf5955a Minor. Drop unreachable conditional branch
- allowShortAnnotations is true only for IN_ANNOTATION_LIST
- when starting parsing of annotation list we can't come to modifier list
(see the only usage of IN_ANNOTATION_LIST)
2016-07-08 16:07:59 +03:00
Denis Zharkov
127fbcd85e Add val/var tokens in parameter name recovery set
Recovery after val/var everywhere beside value parameters works
properly without this change

 #KT-7915 Fixed
2016-07-08 16:07:59 +03:00
Dmitry Petrov
8f130495e3 KT-13023 Char operations throw ClassCastException for boxed Chars
Char is not a Number, so we can't use the same coercion strategy for Char members,
since it doesn't work for boxed Chars.
(cherry picked from commit b0edec8)
2016-07-08 13:28:41 +03:00
Dmitry Petrov
f792b19cae Minor: fix NPE in CallableMethod.toString for methods of primitive types
(cherry picked from commit 2ccb0ca)
2016-07-08 13:28:10 +03:00
Dmitry Petrov
d2b22c37a2 KT-6916: do not create Progression instances in for-in-downTo loops
(cherry picked from commit bf4f263)
2016-07-08 09:53:35 +03:00
Dmitry Jemerov
1c11f8a75e add test for resolving links to library classes from KDoc comments
(cherry picked from commit dec2f98)
2016-07-07 19:32:18 +02:00
Dmitry Jemerov
945938ef8b use navigation element to resolve KDoc links, so that we have correct context when resolving links in the documentation of library elements
#KT-10654 Fixed
(cherry picked from commit 80e10c6)
2016-07-07 19:31:42 +02:00
Dmitry Jemerov
790330f804 use a better API for locating target element when navigating by documentation link, to ensure we find the source for descriptors belonging to library classes
#KT-12932 Fixed
(cherry picked from commit fac1b85)
2016-07-07 19:31:32 +02:00
Dmitry Jemerov
9ac01d633a use QualifiedNameResolver for resolving links in KDoc
#KT-10398 Fixed
(cherry picked from commit 88fe668)
2016-07-07 19:31:23 +02:00
Valentin Kipyatkov
f4e7c7b940 KT-12803 Unused import when class is used in method reference
#KT-12803 Fixed
(cherry picked from commit 5e48b73)
2016-07-07 20:15:18 +03:00
Valentin Kipyatkov
11b62d0cad KT-10433 Copy-pasting reference to companion object member causes import dialog in specific case
#KT-10433 Fixed
(cherry picked from commit 1941572)
2016-07-07 20:15:18 +03:00
Valentin Kipyatkov
659f916086 KT-12646 ConvertToBlockBody intention should use BodyResolveMode.PARTIAL
#KT-12646 Fixed
(cherry picked from commit 9463880)
2016-07-07 20:15:18 +03:00
Dmitry Jemerov
7ca54b9011 avoid NPE when trying to create a file that already exists
#KT-12655 FIxed
(cherry picked from commit 60523fb)
2016-07-07 18:04:16 +02:00
Dmitry Jemerov
9199bafe10 check that main() returns Unit
#KT-12760 Fixed
(cherry picked from commit 972ebd5)
2016-07-07 18:04:11 +02:00
Dmitry Jemerov
6b68377954 MainFunctionDetector: cleanup after J2K
(cherry picked from commit 30d721c)
2016-07-07 18:04:05 +02:00
Dmitry Jemerov
b8ac43c9d9 MainFunctionDetector: J2K
(cherry picked from commit b58c659)
2016-07-07 18:03:59 +02:00
Dmitry Jemerov
8a6e761bdb MainFunctionDetector: rename to .kt
(cherry picked from commit b9a9f25)
2016-07-07 18:03:54 +02:00
Dmitry Jemerov
5a1860833b to restore pre-1.0.3 highlighting behavior, inherit "extension function" and "extension property" colors from "static method" and "static field"
#KT-12937 Fixed
(cherry picked from commit 193a404)
2016-07-07 18:03:49 +02:00
Dmitry Jemerov
c352822539 fix rendering of code blocks escaped with multiple backticks or containing backslashes
#KT-12998 Fixed
 #KT-12999 Fixed
(cherry picked from commit 216d548)
2016-07-07 18:03:42 +02:00
Dmitry Jemerov
4423daa9e1 don't lose ! when rendering markdown
#KT-13000 Fixed
(cherry picked from commit 801a128)
2016-07-07 18:03:36 +02:00
Alexey Tsvetkov
14a74446f3 Fix kapt stubs generation 2016-07-07 17:23:56 +03:00
Alexey Tsvetkov
3495c0fe86 Do not run integration tests with old gradle versions
Reason finalizedBy is not supported with gradle < 2.0
2016-07-07 15:40:39 +03:00
Alexander Udalov
5f3ef4f6cf Minor, fix NonExistentClass name and format
(cherry picked from commit 720c29e8f4)
2016-07-07 14:57:57 +03:00
Alexander Udalov
e544013a4c Get rid of CallChecker#checkPropertyCall, create fake ResolvedCall
(cherry picked from commit ceb54492e6)
2016-07-07 14:55:00 +03:00
Dmitry Jemerov
a63d5956f6 fix ASM 5 src download URL (file was removed in IDEA commit ed9c9fc)
(cherry picked from commit 623673c)
2016-07-07 12:50:16 +02:00
Nikolay Krasko
6dc1c67900 Add description for Kotlin gradle plugin 2016-07-06 20:13:23 +03:00
Nikolay Krasko
6c6c7b246b Refactoring: better name for SameVersionInspection
It now has better suppression string
2016-07-06 20:13:23 +03:00
Nikolay Krasko
b9e3b9ef46 Refactoring: rename SameVersionIDEPluginInspection
It now has better suppression string
2016-07-06 20:13:23 +03:00
Nikolay Krasko
205a95a03d Show versions that are reported different in SameVersionIDEPluginInspection 2016-07-06 20:13:23 +03:00
Nikolay Krasko
6b79c09ad2 Avoid "loader constraint violation: when resolving method "ActionsKt.runReadAction()" 2016-07-06 20:13:23 +03:00
Nikolay Krasko
60ae115f33 Read test files with \r removed on Windows 2016-07-06 20:13:23 +03:00
Nikolay Krasko
62c6a599c1 Fix AbstractAnnotationProcessorBoxTest on Windows: load text without \r 2016-07-06 20:13:23 +03:00
Nikolay Krasko
d4e2da0b3c Minor: mark folder as resources not a source root 2016-07-06 20:13:23 +03:00
Alexey Tsvetkov
f418af9c74 Remove dependency on Files from guava 2016-07-06 16:29:57 +03:00
Alexey Tsvetkov
4d108f4aec Gradle: copy kotlin classes after java compilation
#KT-9392 fixed
    #KT-12295 fixed
    #KT-12736 fixed
2016-07-06 16:29:57 +03:00
Alexander Udalov
08827a5177 Minor, move isInfixCall implementation out of InfixCallChecker
(cherry picked from commit d331b6ae8e)
2016-07-05 19:33:40 +03:00
Alexander Udalov
6045b9d934 Minor, fix typo in KParameter#isOptional kdoc
(cherry picked from commit a48e1680e9)
2016-07-05 19:33:09 +03:00
Alexander Udalov
f29dc71a32 Fix reflection on reference to generic property
See a93484b457 for the similar fix to function
references

 #KT-12967 Fixed

(cherry picked from commit 3b349e9be0)
2016-07-05 19:32:54 +03:00
Alexander Udalov
a88e2e1db7 Fix AssertionError in OverrideResolver on bad hierarchy
Previously the code was operating under the assumption that if the
implementation of some function (both the implementation and the function come
from supertypes) does not have a proper return type (the one which is a subtype
of return type of all declarations of this function in the supertypes), then
there's necessarily at least one abstract declaration of the function, such
that the implementation's return type is not a subtype of the return type of
that declaration. The assertion makes sense when the hierarchy above the
current class does not have any errors: we should report at least one function
as being "not implemented" in the current class.

However, as demonstrated by the test case, if there's an error already in the
supertypes with regard to overridability of members, this assertion may be
wrong. Reporting the "not implemented" error in such case is in fact not
necessary because of the already existing error ("return type mismatch" in the
test) in the supertypes

 #KT-12482 Fixed

(cherry picked from commit 48fe9fb2c0)
2016-07-05 19:32:47 +03:00
Alexander Udalov
3c711dddee Fix debug names for some slices
Also move RUNTIME_ASSERTION_INFO and LOAD_FROM_JAVA_SIGNATURE_ERRORS to a
single class for simplicity

(cherry picked from commit a533f8597d)
2016-07-05 19:32:02 +03:00
Alexander Udalov
8df12e5933 Fix test data for KT-11075
References to object members are not supported in 1.0.x branch

 #KT-11075 Fixed
2016-07-05 18:06:10 +03:00
Dmitry Petrov
35591839e5 KT-12983 java.lang.VerifyError: Bad type on operand stack in arraylength
Use proper receiver value type.
2016-07-05 17:52:58 +03:00
Dmitry Petrov
41118ceb13 Minor: extract optimized loop codegen creation logic for optimized 'for' cases.
There will be some more of those, and they all require some ad hock processing.
(cherry picked from commit e187f79)
2016-07-05 17:52:57 +03:00
Dmitry Petrov
8e10b99037 KT-12733 'rangeTo' as a non-qualified call is not optimized in 'for'
Use ResolvedCall corresponding to 'for' loop range expression
for optimized "for-in-range-literal".
Cleanup.
2016-07-05 17:52:57 +03:00
Kirill Rakhman
6fd9b29157 Show quick doc for implicit lambda parameter 'it' (#889)
* Show quick doc for implicit lambda parameter 'it'
Fixes #KT-9271

* Remove useless code
(cherry picked from commit 79fff4a)
2016-07-05 14:01:45 +02:00
Dmitry Jemerov
3bdb4fd376 fix test
(cherry picked from commit a770fe2)
2016-07-05 13:44:08 +02:00
Kirill Rakhman
9fe233b312 Implement quickfix for wrong primitive literal (#885)
* Implement quickfix for wrong primitive literal
Fixes: KT-12251

* fix style issue
(cherry picked from commit b50176f)
2016-07-05 13:44:01 +02:00
Kirill Rakhman
54a039de77 Add quickfix for "Illegal usage of inline parameter" that adds noinline (#888)
Fixes #KT-12838
(cherry picked from commit 3b290ce)
2016-07-05 12:15:22 +02:00
Dmitry Petrov
aa5401ceed KT-11892: explicitly qualified 'super' with a supertype that is overridden
by a different explicitly declared supertype is an error (as in Java)
(see http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.12.3)
2016-07-05 11:01:42 +03:00
Dmitry Petrov
de73cdd117 Minor: use NoLookupLocation.WHEN_GET_SUPER_MEMBERS
for unqualified 'super' resolution
2016-07-05 11:01:42 +03:00
Denis Zharkov
06018b9ca8 Report declaration that was being analyzed when internal error happened
#KT-12188 Fixed
2016-07-04 18:23:58 +03:00
Denis Zharkov
a1fa8ebe81 Minor. Move KotlinFrontEndException to frontend module 2016-07-04 18:23:58 +03:00
Denis Zharkov
cf43eba70c Do not add error types as upper bounds in type parameter
#KT-10237 Fixed
 #KT-11821 Fixed
 #KT-8200 Fixed
2016-07-04 18:23:58 +03:00
Denis Zharkov
febe3d4380 Minor. Change CompilationException parameter to @Nullable
A lot of call sites actally pass null as an element,
so it's better to fail with original stack-trace instead of NPE
caused by nullability check
2016-07-04 18:23:18 +03:00
Alexander Udalov
3042f31cd0 Do not consider fake variables for objects in :: resolution
The main change is in
NewResolutionOldInference.ResolutionKind.CallableReference, where
createVariableProcessor creates a processor which no longer lists objects

 #KT-12322 Fixed

(cherry picked from commit b44f060ffa)
2016-07-04 15:52:17 +03:00
Alexander Udalov
a5d1b7f503 Initial support of type inference for callable references
There are two main changes here:

- In CallCompleter, there was a bug: we assumed that the return type of a
  candidate must be a subtype of the expected type and were adding a
  corresponding constraint to the system. However, this is not true for
  callable references where the type of the expression is KFunctionN<...> and
  the return type of the candidate must be a subtype of the _last generic
  argument_ of the functional type.
- In CandidateResolver, we use a more correct (although still not precise)
  heuristic to determine if a candidate fits based on the non-substituted type
  of the callable reference expression which it would produce.

This can be further improved, see TODOs in CallCompleter. Also this does not
influence resolution of callable references being passed as arguments to
generic calls (that happens in GenericCandidateResolver)

 #KT-10968 Fixed
 #KT-11075 Fixed
 #KT-12286 Fixed
 #KT-12963 Open
 #KT-12964 Open

(cherry picked from commit f290f1be68)
2016-07-04 15:52:03 +03:00
Alexander Udalov
c7ec2e7eb6 Fix AssertionError on property generation in multi-file classes
See 4a533168d9 for the original change which
introduced the problem

Note that the added test case _was not failing_ before the change. It's added
because there were no tests on multi-file class behavior in light classes mode
at all. The actual repro for the problem is difficult to make a test from

 #KT-12755 Fixed

(cherry picked from commit 24682bf1ec)
2016-07-04 15:51:52 +03:00
Denis Zharkov
648cc1cf9e Refine definition of whether single parameter the method should be boxed
Only 'Collection<Int>.remove(E): Boolean' should match
2016-07-04 15:48:22 +03:00
Denis Zharkov
8c7319aaea Introduce additional overridability rule
It works only for Java methods and it's purpose is Java overridability rules emulation,
namely distinction of primitive types and their wrappers.

For example `void foo(Integer x)` should not be an override for `void foo(int x)`

 #KT-11440 Fixed
 #KT-11389 Fixed
2016-07-04 15:48:22 +03:00
Denis Zharkov
b78a16d9e9 Minor. Extract overridability rule into separate method 2016-07-04 15:48:22 +03:00
Denis Zharkov
5660709c2d Temporary return BuiltinOverridabilityCondition class
Otherwise bootstrap problems appear
2016-07-04 15:48:22 +03:00
Denis Zharkov
c2ad32135e Rename: BuiltinOverridabilityCondition -> JavaIncompatibilityRulesOverridabilityConditionBuiltinOverridabilityCondition 2016-07-04 15:48:22 +03:00
Denis Zharkov
d4d97eb950 Use signatures instead of fq-names in special built-ins
Partially apply 55c4f875c8 in 1.0.x
2016-07-04 15:48:22 +03:00
Denis Zharkov
84596d92e4 Partially apply 1efed64014
JvmTypeFactory implementation will be used further in 1.0.x version
2016-07-04 15:48:22 +03:00
Denis Zharkov
a460c3b107 Extract JVM descriptors type mapping from backend to core
Also unbind it from ASM types
2016-07-04 15:48:22 +03:00
Alexey Andreev
310e17f938 Fix configuration of maven test of moduleKind configuration property 2016-07-04 15:02:17 +03:00
Alexey Andreev
df38d90d65 KT-12928: decompose invocation like "a.foo(b)" to "$t = a; $s = $t.foo.bind($t); $s(b)" instead of "$t = a.foo; $t(b)", since in the latter case foo won't receive proper this. Add optimization that replaces "foo.bar.bind(baz)(args)" with "baz.bar(args)" 2016-07-04 14:53:11 +03:00
Zalim Bashorov
43c476f26f JS: generate a function with the required name for callable references instead try to change the name later. The previous solution doesn't work properly on some JS VMs (e.g. in FireFox)
#KT-12929 Fixed
(cherry picked from commit 48617ca)
2016-07-01 21:16:43 +03:00
Nikolay Krasko
ea01e3c142 Build against 1.0.4 in branch 1.0.4 2016-07-01 18:31:10 +03:00
Ilya Gorbunov
8b0350a021 Minor: make tryInlined test not depend on 'Closeable.use' implementation.
(cherry picked from commit 17e7c269ad)
2016-07-01 04:52:00 +03:00
Alexander Udalov
216ac9cbc4 Minor, remove unused components in ForLoopConventionsChecker
This is an addition to 8357f30

(cherry picked from commit 95ed3ed78b)
2016-06-30 21:29:57 +03:00
Alexey Sedunov
5397e11940 Minor: Fix compilation 2016-06-30 20:37:32 +03:00
Alexey Sedunov
bc4c013e03 Create from Usage: Support "Create member/extension" corresponding to the extension receiver of enclosing function
#KT-10668 Fixed
2016-06-30 20:37:31 +03:00
Alexey Sedunov
75f6b7fcd8 Create from Usage: Support "Create abstract function/property" inside an abstract class
#KT-7492 Fixed
2016-06-30 20:37:30 +03:00
Alexey Sedunov
3641ad6cf7 Code Insight: Format generated declarations
#KT-11176 Fixed
2016-06-30 20:37:28 +03:00
Alexey Sedunov
a3a2e573de Override/Implement Members: Implement Members: Fix base member detection when abstract and non-abstract members with matching signatures are inherited from an interface
#KT-11115 Fixed
2016-06-30 20:37:27 +03:00
Alexey Sedunov
b53d8da648 Inline Property: Support "Do not show this dialog" and "Inline this occurrence" options
#KT-12017 Fixed
2016-06-30 20:37:26 +03:00
Alexey Sedunov
2852f44951 Introduce Property: Do not skip outer classes if extractable expression is contained in object literal. Skip outer classes of non-inner class
#KT-12084 Fixed
2016-06-30 20:37:25 +03:00
Alexey Sedunov
78212a4ade Introduce Property: Fix extraction of expressions referring to primary constructor parameters
#KT-12294 Fixed
2016-06-30 20:37:24 +03:00
Alexey Sedunov
f417b05769 Change Signature: Consider default value context an initial type context. Use parameter list as a type context for bodyless function
#KT-12413 Fixed
2016-06-30 20:37:23 +03:00
Denis Zharkov
1266950809 Minor. Cleanup getSpecialBridgeSignatureIfExists 2016-06-30 20:21:22 +03:00
Denis Zharkov
3529499282 Simplify method contract and add assertion
We don't generate stubs for final built-ins anyway
(as well as special bridges)
2016-06-30 20:21:22 +03:00
Denis Zharkov
64114b0762 Refine stubs generation for special built-ins
Do not generate stub if declaration has the same signature

 #KT-12909 Fixed
2016-06-30 20:21:22 +03:00
Denis Zharkov
80e923fe46 Fix stub generation for special built-ins
Do not generate stubs if there is no special bridge in the current class
- there are already Kotlin super class in hierarchy
- special bridge has the same signature as method itself

 #KT-11915 Fixed
2016-06-30 20:21:22 +03:00
Alexey Tsvetkov
7e4b93f06e Fix shading of META-INF/services in kotlin-compiler-embaddable 2016-06-30 20:17:13 +03:00
Alexander Udalov
3999709bda Fix KCallable#callBy to JvmStatic companion object members
#KT-12915 Fixed

(cherry picked from commit c07d0d48d3)
2016-06-30 20:08:31 +03:00
Michael Bogdanov
37acb3cd30 Compile android tests against jdk 6
(cherry picked from commit 476c1ec)
2016-06-30 09:33:23 +03:00
Alexander Udalov
1b6a6c510a Do not report errors on fake elements in call checkers
#KT-12875 Fixed

(cherry picked from commit 8357f3021e)
2016-06-30 02:19:09 +03:00
Alexander Udalov
181ac887e3 Minor, move some checkers to more appropriate places
(cherry picked from commit 95291cdc18)
2016-06-30 02:18:27 +03:00
Alexander Udalov
c2e7847134 Report error on protected setter call from super's companion
#KT-12847 Fixed

(cherry picked from commit ff72348105)
2016-06-30 02:17:01 +03:00
Alexander Udalov
133fa036c6 Rename SymbolUsageValidator -> ClassifierUsageChecker
Also validateTypeUsage -> check

(cherry picked from commit 77bb691d4e)
2016-06-30 02:16:01 +03:00
Alexander Udalov
04301828c8 Move SymbolUsageValidator#validatePropertyCall to CallChecker
(cherry picked from commit 89730dfbc3)
2016-06-30 02:15:47 +03:00
Alexander Udalov
dfca1c2b61 Drop SymbolUsageValidator#validateCall in favor of CallChecker#check
(cherry picked from commit d599d87978)
2016-06-30 02:14:20 +03:00
Alexander Udalov
b62aaebe5c Invoke call checkers where symbol usage validators are called
The change in componentAccess.kt is a minor regression that should be addressed
later

(cherry picked from commit 260689eb8c)
2016-06-30 02:13:13 +03:00
Alexander Udalov
d0a389997f Support smart casts for functions of property delegates
(cherry picked from commit 4a05c749b5)
2016-06-30 02:12:03 +03:00
Alexander Udalov
6c685ec295 Drop resolution of deprecated plus/minus/get/set conventions
Also remove the corresponding quick fix

(cherry picked from commit 70a994b135)
2016-06-30 02:08:37 +03:00
Alexander Udalov
60f348824d Remove obsolete errors related to 'invoke' called on extension
(cherry picked from commit 291f1f6c3a)
2016-06-30 02:05:07 +03:00
Alexander Udalov
f0bc904526 Refactor CallChecker and subclasses
Encapsulate everything that is needed in checkers into CallCheckerContext. Pass
an instance of this context instead of BasicCallResolutionContext to checkers.

Also pass an instance of the element to report errors on: this is useful
because before this, every checker had its own way of determining where should
the error be reported on. Some of them, for example, were not doing anything if
Call#calleeExpression returned null, which is wrong, see operatorCall.kt

 #KT-12875 Open

(cherry picked from commit 6ba32ed624)
2016-06-30 02:02:36 +03:00
Alexander Udalov
a8666865cb Minor, extract validatePropertyCall out of SymbolUsageValidator#validateCall
BasicExpressionTypingVisitor#checkLValue is the only place where it's used.
There's no ResolvedCall instance for the setter call (only for the property
itself), that's why this special method is needed

(cherry picked from commit f6f825e0dc)
2016-06-30 01:49:40 +03:00
Alexander Udalov
2aa68a0f3f Drop SymbolUsageValidator.Composite, use validators similarly to call checkers
Also fix warnings in DeprecatedSymbolValidator, DelegatedPropertyResolver and
elsewhere

(cherry picked from commit d7d2780666)
2016-06-30 01:49:31 +03:00
Alexander Udalov
5725c196ff Make infix & operator checkers implement CallChecker
Instead of SymbolUsageValidator

(cherry picked from commit e94fd8f777)
2016-06-30 01:47:37 +03:00
Nikolay Krasko
8834f0ad44 Don't fail in setup because of access restricted exception 2016-06-29 18:30:32 +03:00
Kirill Rakhman
639d6a71b1 Formatter: Remove spaces before question mark in nullable types (KT-12830)
#KT-12830 Fixed
2016-06-29 18:30:11 +03:00
Yan Zhulanow
33af8ba5a5 KT-12895, EA-84877: Fix NoSuchMethodError thrown when saving a Kotlin file.
newOutputStreamSupplier() is deprecated and was deleted in Guava 18.
(cherry picked from commit bb083a5)
2016-06-29 17:53:31 +03:00
Alexey Tsvetkov
9de22c3549 Prevent usage of deprecated constructor
This removes warning with gradle 2.14.
Before 2.14 constructor was removed, then it was returned and deprecated.

    #KT-12786 fixed
2016-06-29 15:17:19 +03:00
Alexey Tsvetkov
c03e50c5a1 Fix CCE when creating kotlin-js task in gradle plugin 2016-06-29 15:17:15 +03:00
Alexey Andreev
44cabf8376 KT-12893: fix another potential issue (could not reproduce) 2016-06-29 14:28:08 +03:00
Alexey Andreev
d101281b36 KT-12893: when opening Kotlin compiler settings while kotlinc.xml does not specify which module kind to use, fallback to default value ("plain").
Fix #KT-12893
2016-06-29 12:03:42 +03:00
Michael Bogdanov
fd96c02be0 Fix for KT-11964: No TABLESWITCH in when on enum bytecode if enum constant is imported
#KT-11964 Fixed
(cherry picked from commit 3b419e8)
2016-06-29 09:35:11 +03:00
Alexander Udalov
e93c85aa54 Simplify ImplementationBodyCodegen#generateToArray
- don't do anything for interfaces because there's no point in generating
  abstract methods which are already abstract in supertypes
- don't use getDeclaredFunctionByRawSignature, check function signature
  manually instead
- don't use isOrOverridesSynthesized because 'toArray' is never synthesized
2016-06-28 16:40:58 +03:00
Pavel V. Talanov
c2129365cb ChangeLog, minor: make usages of quotes and backticks more consistent 2016-06-28 16:05:59 +03:00
Pavel V. Talanov
729690e055 Minor: fix typos in ChangeLog 2016-06-28 16:05:57 +03:00
Pavel V. Talanov
6beb99db9e Update Changelog for 1.0.3 2016-06-28 16:05:55 +03:00
Alexey Sedunov
8e631b6810 Rename: Update references to facade class when renaming file via matching top-level class
#KT-11903 Fixed
(cherry picked from commit a1d9a25)
2016-06-28 15:28:49 +03:00
Alexey Sedunov
4475fc022a Line Markers: Filter out irrelevant declarations before resolving in KotlinTestRunLineMarkerContributor
#KT-12647 Fixed
(cherry picked from commit cceeaeb)
2016-06-28 15:28:34 +03:00
Alexey Sedunov
af63b58b6f Rename: Constraint search scope of parameter declared in a private member
#KT-9649 Fixed
(cherry picked from commit fa144b0)
2016-06-28 15:28:10 +03:00
Alexey Sedunov
d763308431 Rename: Disable JavaMemberByKotlinReferenceInplaceRenameHandler for synthetic properties referenced from Kotlin code
#KT-9168 Fixed
(cherry picked from commit dfebdaf)
2016-06-28 15:27:55 +03:00
Alexey Sedunov
73fbc093b7 Rename: Support automatic test renaming for facade files
#KT-10578 Fixed
(cherry picked from commit 35050f4)
2016-06-28 15:27:39 +03:00
Alexey Sedunov
8628f9ee37 Override/Implement: Prefer not-nullable return type when overriding Java method without nullability annotation
#KT-12381 Fixed
(cherry picked from commit 2b87f8e)
2016-06-28 15:27:26 +03:00
Alexey Sedunov
bda39e3f77 Move: Support quoted package names
#KT-12411 Fixed
(cherry picked from commit 95239e5)
2016-06-28 15:27:16 +03:00
Alexey Sedunov
c0959496dd References: Support implicit references to annotation method 'value'. Support Find Usages/Rename on these references
#KT-12657 Fixed
(cherry picked from commit 68d0d84)
2016-06-28 15:27:02 +03:00
Alexey Sedunov
0133aef038 Rename: Suggest renaming both property accessors with matching @JvmName when renaming one of them from Java
#KT-12759 Fixed
(cherry picked from commit 81a8e6a)
2016-06-28 15:26:47 +03:00
Alexey Sedunov
dd476563a3 Light Classes: Implement light elements for 'extends'/'implements' reference lists. Support adding/removing of super type list entries via light elements.
Fix exception on applying "Convert to class" intention to Java interface with Kotlin inheritor(s)
 #KT-11281 Fixed
(cherry picked from commit 4ec4914)
2016-06-28 15:26:35 +03:00
Alexey Sedunov
cad99e5ba0 Implement Abstract Member: Navigate to the generated declaration
#KT-12290 Fixed
(cherry picked from commit 6274c6b)
2016-06-28 15:26:20 +03:00
Alexey Sedunov
a44d149b4f Create from Usage: Fix exception in "Create class" quickfix applied to unresolved references in type arguments. Create class body when necessary
#KT-12777 Fixed
(cherry picked from commit dc90ec9)
2016-06-28 15:26:08 +03:00
Alexey Sedunov
ebb1c758d9 Override/Implement: Implement JavaDoc/KDoc copying
#KT-8682 Fixed
 #KT-12735 Fixed
(cherry picked from commit f4486be)
2016-06-28 15:25:55 +03:00
Alexey Sedunov
3256366ffe Minor: Rename jetRefactoringUtil.kt -> kotlinRefactoringUtil.kt
(cherry picked from commit a841f87)
2016-06-28 15:25:38 +03:00
Alexey Sedunov
0a98a2a9cb Minor: Drop unused variable
(cherry picked from commit 4441323)
2016-06-28 15:25:21 +03:00
Alexey Sedunov
ca14643834 Copy: Filter out invalid elements to prevent PsiInvalidElementAccessException
#KT-12747 Fixed
(cherry picked from commit 4a0a440)
2016-06-28 15:25:11 +03:00
Alexey Sedunov
feb84aa443 Create from Usage: Suggest "Create function/secondary constructor" quick fix on argument type mismatch
#KT-11864 Fixed
(cherry picked from commit 1912783)
2016-06-28 15:24:52 +03:00
Alexey Sedunov
19edf0f939 Rename: Qualify references to members of enum companions in case of conflict with enum entries
#KT-10033 Fixed
(cherry picked from commit 3373d54)
2016-06-28 15:24:39 +03:00
Alexey Sedunov
bff7c57c2b Inspections: Don't show "Package directive doesn't match file location" in injected code
#KT-12376 Fixed
(cherry picked from commit a5a5fe5)
2016-06-28 15:24:25 +03:00
Alexey Sedunov
264dacb5ba Rename: Preserve "Search in comments and strings" and "Search for text occurrences" settings in Rename dialog
#KT-8510 Fixed
(cherry picked from commit d9584d2)
2016-06-28 15:24:00 +03:00
Alexey Sedunov
8372b76d4e Minor: Fix changelog
(cherry picked from commit 2ea3980)
2016-06-28 15:23:28 +03:00
Alexey Sedunov
bdc299cc8a Rename: Record new name for Kotlin function which is being renamed via light method
#KT-12732 Fixed
(cherry picked from commit 28b9d3e)
2016-06-28 15:23:00 +03:00
Alexey Sedunov
60c3abcc3e Rename: Process property accesor usages (Java) in comments and string literals
#KT-9435 Fixed
(cherry picked from commit 911afee)
2016-06-28 15:22:28 +03:00
Alexey Sedunov
709082f0af Rename: Add name suggestions to Rename dialog
#KT-6372 Fixed
(cherry picked from commit 84ca283)
2016-06-28 15:21:52 +03:00
Alexey Sedunov
07af0b1c8b Rename: Rename overridden property and all its accessors on attempt to rename overriding accessor in Java code
#KT-4791 Fixed
(cherry picked from commit 29e450e)
2016-06-28 15:21:38 +03:00
Alexey Sedunov
ccb096ed99 Rename: Fix rename of ambiguous import reference to class/function when some referenced declarations are not changed
#KT-6663 Fixed
(cherry picked from commit 9ba8ecd)
2016-06-28 15:21:01 +03:00
Alexey Sedunov
528f144858 Rename: Implement conflict analysis for parameters. Qualify property references to avoid shadowing by parameters
#KT-10687 Fixed
(cherry picked from commit 7d6466d)
2016-06-28 15:20:46 +03:00
Alexey Sedunov
d38a0b6e43 Rename: Implement Rename conflict analysis for classes. Qualify class references to resove rename conflicts when possible
#KT-8611 Fixed
 #KT-8562 Fixed
(cherry picked from commit 8989ccc)
2016-06-28 15:20:33 +03:00
Alexey Sedunov
6da82ee964 Rename: Implement Rename conflict analysis for properties. Qualify property references to resove rename conflicts when possible
#KT-8732 Fixed
 #KT-12543 Fixed
(cherry picked from commit e23029d)
2016-06-28 15:20:23 +03:00
Stanislav Erokhin
a8fd840fa3 Add eap channel for 1.1 into plugin updater.
(cherry picked from commit 43f5da0)
2016-06-28 14:48:52 +03:00
Denis Zharkov
6db295524a Use modality and visibility from mutable class declaration
Otherwise open may be used instead of abstract (in most cases)
2016-06-28 14:22:59 +03:00
Denis Zharkov
c36b63dea9 Do not generate mutable collection stub methods in interfaces
#KT-12359 Fixed
2016-06-28 14:22:59 +03:00
Denis Zharkov
3807c507b7 Fix mutable collection stub methods generation for corner case
The problem is that
`override fun remove(element: E): CollectionWithRemove<E>`
seems to be illegal from Java's point of view, while it's OK for JVM

These declarations have the same signature (return type is isgnored)
- override fun remove(element: E): CollectionWithRemove<E>
- override fun remove(element: E): Boolean

When we meet such declaration we choose random declaration for fake override in synthetic class
that may lead to signature clash
2016-06-28 14:22:59 +03:00
Nikolay Krasko
4d12a242ab Use file.modificationStamp to invalidate caches for synthetic files
It previously worked because of updating all counters. That behaviour was removed in
3b860d69ee.

getUserData(FILE_OUT_OF_BLOCK_MODIFICATION_COUNT) is probably useless because copied file has
isEventSystemEnabled() == false that prevents sending notifications about PSI changes. This need additional checks.
2016-06-28 14:12:10 +03:00
Nikolay Krasko
53c2dfa49b Remove old hack: Idea doesn't expect increasing modification count during highlighting (KT-12526)
addImport() is called from ImportAllMembersIntention.isApplicableTo() and increasing modification count during highlighting ruins Idea expectations.

 #KT-12526 Fixed
2016-06-27 21:18:31 +03:00
Alexander Udalov
d8209d796d Minor, rename protobuf field according to style guide
(cherry picked from commit 601dc96a34)
2016-06-27 20:26:37 +03:00
Alexander Udalov
fa66bce9a5 Update protobuf from 2.5.0 to 2.6.1
(cherry picked from commit 4c8e8b099a)
2016-06-27 20:26:29 +03:00
Ilya Gorbunov
7f8938e074 Change snapshot versions of dependencies in gradle tests for 1.0.x branch 2016-06-27 17:35:22 +03:00
Ilya Gorbunov
93b2e1ed8b Update changelog for 1.0.3: section about new compiler options
(cherry picked from commit 1e66147e91)
2016-06-27 17:35:22 +03:00
Ilya Gorbunov
7514bbb3c9 Minor: remove unused commonArgs
(cherry picked from commit 71476d5d43)
2016-06-27 17:35:22 +03:00
Ilya Gorbunov
3fa335d6d0 Rename -jdk compiler option to -jdk-home (jdkHome), add jdk path validation.
(cherry picked from commit 7c5c4610e8)

# Conflicts:
#	compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt
2016-06-27 17:35:22 +03:00
Ilya Gorbunov
ad540b6f90 Add tests for 'jdk' compiler option for CLI, maven and gradle.
(cherry picked from commit 13016cae93)
2016-06-27 17:35:22 +03:00
Ilya Gorbunov
9197aec478 CLI: Allow to specify JDK for classpath building with '-jdk' compiler argument.
Maven: support jdk parameter linked to kotlin.compiler.jdk property.
Gradle: support jdk compiler option.

(cherry picked from commit 644df89dc9)
2016-06-27 17:35:22 +03:00
Ilya Gorbunov
c2704bdba7 Maven: support languageVersion parameter, linked to property kotlin.compiler.languageVersion.
(cherry picked from commit 1157e052ee)
2016-06-27 17:35:22 +03:00
Ilya Gorbunov
9fd23fa175 Maven and Gradle tests for jvmTarget parameter.
(cherry picked from commit 848599e940)
2016-06-27 17:35:22 +03:00
Ilya Gorbunov
4771a6cdec Maven: support jvmTarget parameter in Maven, linked to property kotlin.compiler.jvmTarget.
Gradle: support jvmTarget compiler option.

(cherry picked from commit 3f3a3820b8)
2016-06-27 17:35:22 +03:00
Alexey Andreev
b9328df0d5 KT-3008: fix ABI compatibility test 2016-06-27 16:04:26 +03:00
Alexey Andreev
c137cf681a KT-3008: minor code style fixes 2016-06-27 16:04:24 +03:00
Alexey Andreev
d48d1afd5e KT-3008: fix support of KProperty/KMutableProperty 2016-06-27 15:57:13 +03:00
Alexey Andreev
ff89622e61 KT-3008: remove unused code that handles anonymous modules, since there's no way to declare them via configuration 2016-06-27 15:57:13 +03:00
Alexey Andreev
b1198265d7 KT-3008: when inlining functions from external modules, replace calls to functions in the external module via new mechanism instead of Kotlin.modules 2016-06-27 15:57:12 +03:00
Alexey Andreev
ff44894d61 KT-3008: change the way how descriptions of module kind are rendered in IDEA configuration tab 2016-06-27 15:57:12 +03:00
Alexey Andreev
46efbac984 KT-3008: multiple minor fixes after code review 2016-06-27 15:57:11 +03:00
Alexey Andreev
6f172094ac KT-3008 Add support of module kind to Ant task. Repair Ant JS tests 2016-06-27 15:57:11 +03:00
Alexey Andreev
9ea0abc121 KT-3008 Fix CLI and JPS tests related to JS translator 2016-06-27 15:57:10 +03:00
Alexey Andreev
4671252943 KT-3008 Run Google closure compiler in a separate JVM 2016-06-27 15:57:10 +03:00
Alexey Andreev
d107ccaa97 KT-3008 Minor refactoring and clean up 2016-06-27 15:57:07 +03:00
Alexey Andreev
c5bab0d8c4 KT-3008 Add UI that allows to change module kind in IDEA Kotlin configurator 2016-06-27 15:55:53 +03:00
Alexey Andreev
2dadf0b1a4 KT-3008 Add module kind attribute to Maven plugin. Fix tests from libraries subproject 2016-06-27 15:54:15 +03:00
Alexey Andreev
176768dd3a KT-3008 Fix UMD and plain module wrappers when module id is not a valid JS identifier 2016-06-27 15:54:14 +03:00
Alexey Andreev
3cc15546f9 KT-3008 Add tests for module wrappers 2016-06-27 15:54:12 +03:00
Alexey Andreev
4fa27a7262 KT-3008 Merge JS runtime modules in one kotlin.js 2016-06-27 15:52:09 +03:00
Alexey Andreev
4bb21c71ed KT-3008 Fix JS backend tests 2016-06-27 15:52:04 +03:00
Alexey Andreev
cbd9165008 KT-3008 Implement AMD, CommonJS and UMD wrappers. Compile stdlib and builtins modules into separate JS files and wrap them in UMD. 2016-06-27 15:51:21 +03:00
Alexey Andreev
734552ad91 KT-3008 Change the way how modules are referenced in JS 2016-06-27 15:51:19 +03:00
Alexey Andreev
ed848e74f2 KT-3008 Add module kind. Include module kind and module dependencies in metadata 2016-06-27 15:38:24 +03:00
Michael Bogdanov
d8fd2c3cd1 Fix for KT-12106: import static of reified companion object method throws IllegalAccessError 2016-06-27 12:15:37 +03:00
Zalim Bashorov
608acdb373 JS: fix that kotlin's breakpoints don't work with JavaScript debugger
#KT-12773 Fixed
(cherry picked from commit 47e1ff3)
2016-06-24 16:26:58 +03:00
Denis Zharkov
3184238b9f Use 'Any?' instead of throwing NPE when calculating star projection type
It's a quite hacky solution, but the choice seems to be conservative, so these types can be refined later

 #KT-9597 Fixed
2016-06-24 10:24:46 +03:00
Yan Zhulanow
e73789dc3e Fix KT-12173 (Kotlin Lint False Positive for "Toast created but not shown" inside SAM adapter).
(cherry picked from commit 4940d3b)
2016-06-23 20:27:46 +03:00
Yan Zhulanow
48bb3ad965 KT-12681 (Lint: run from main menu / Analyze: Kotlin inspections reports only java source)
Cause we've copied Lint diagnostics to the Kotlin project, there's no harm in making them Kotlin-only.
(cherry picked from commit 7105648)
2016-06-23 20:27:43 +03:00
Yan Zhulanow
0255b2d9da KT-12674 "Calling new methods on older versions" errors for inlined constants
Inlined constants from Java should not be detected.
(cherry picked from commit b34ee4e)
2016-06-23 20:27:40 +03:00
Yan Zhulanow
868b04f36b KT-12023 Kotlin Lint: Cast doesn't trigger minSdk error
Check Kotlin as/is types.
(cherry picked from commit c0db8e0)
2016-06-23 20:27:37 +03:00
Yan Zhulanow
1142d2888f Make infix modifier diagnostic message more informative (KT-12589)
(cherry picked from commit 2744309)
2016-06-23 20:27:34 +03:00
Yan Zhulanow
a39ef7f6ca Load Gradle subplugin artifacts from the root project buildscript classpath as well (KT-11885)
(cherry picked from commit b54b0da)
2016-06-23 20:27:31 +03:00
Yan Zhulanow
5322539179 KT-12015 (Kotlin Lint False Positive for Bundle.getInt())
Java approach is not sufficient here, in Kotlin receivers can be implicit.
Use Kotlin extension/dispatch receivers to figure out the receiver type for our method call.
(cherry picked from commit cdedf1d)
2016-06-23 20:27:28 +03:00
Yan Zhulanow
9f2d789c36 Android Extensions: Fix KT-10969 (NullPointerException when finding view in Fragment if getView() is null)
(cherry picked from commit 80f5852)
2016-06-23 20:27:25 +03:00
Alexander Udalov
cfa0a79405 Add release notes for 1.0.2-1
(cherry picked from commit 1ebcd193a2)
2016-06-23 17:39:56 +03:00
Pavel V. Talanov
16558a4d32 REPL: call 'toString()' for returned values explicitly and correctly report exceptions
#KT-12389 Fixed
2016-06-23 15:55:12 +03:00
Pavel V. Talanov
c0bb933988 Refactor Repl: use sealed class to represent line result 2016-06-23 15:55:10 +03:00
Pavel V. Talanov
893fe7af11 Refactor ReplInterpreter and ReplFromTerminal classes
Drop some of the exception reporting code
2016-06-23 15:55:08 +03:00
Pavel V. Talanov
ae8d9612ae J2K ReplFromTerminal: rename file 2016-06-23 15:55:07 +03:00
Pavel V. Talanov
d8f092b06f J2K ReplFromTerminal, convert code 2016-06-23 15:55:05 +03:00
Stanislav Erokhin
24237097e2 KT-12623 Fixed ISE: Type parameter ... not found for public fun ...
#KT-12623 Fixed
Also EA-72653 fixed.
(cherry picked from commit 7c2825b)
2016-06-23 02:08:20 +03:00
Alexander Udalov
7c3a69f8e0 Minor, move utilities form CallableReferencesResolutionUtils.kt closer to usages
(cherry picked from commit 6cc10aa226)
2016-06-22 22:09:10 +03:00
Alexander Udalov
230b46cbcd Refactor CallableReferencesResolutionUtils.kt
Get rid of trace & reportOn parameters of
createReflectionTypeForCallableDescriptor: move the two checks that required
them to DoubleColonExpressionResolver and combine with other checks into a
single function that checks the validity of the referenced symbol. This also
makes these checks reported only once when invalid expressions are passed as
function arguments (previously they were also reported from
getResolvedCallableReferenceShapeType).

Also inline getReflectionTypeForCandidateDescriptor after this, and refactor
its usages

(cherry picked from commit 80bf6e1bee)
2016-06-22 21:58:03 +03:00
Alexander Udalov
d8b3c359bf Minor, refactor "is KProperty" checks in ReflectionTypes
(cherry picked from commit cf630e01db)
2016-06-22 21:42:32 +03:00
Stanislav Erokhin
d4132e767f Add debug info for EA-79267 - (T is not T) assert: TypeCheckingProcedure.checkSubtypeForTheSameConstructor
(cherry picked from commit 065c4e1)
2016-06-22 19:45:32 +03:00
Stanislav Erokhin
d4fa597245 KT-11679 Fixed exception at ResolvedCallImpl.getArgumentMapping()
#KT-11679 Fixed
Also fixed EA-75913 EA-78908
(cherry picked from commit ad285d5)
2016-06-22 19:45:29 +03:00
Stanislav Erokhin
d3a44cd4d1 Fixed visibility check on a property with private setter of the subclass
#KT-3689 Fixed
(cherry picked from commit 7389d41)
2016-06-22 19:45:25 +03:00
Pavel V. Talanov
4819247450 Update Changelog for 1.0.3-eap-58 2016-06-22 14:14:44 +03:00
Pavel V. Talanov
f18b0aab93 Add Kotlin "Tips of the day"
Content from https://youtrack.jetbrains.com/issue/DOC-4026
2016-06-22 14:13:35 +03:00
Pavel V. Talanov
9589e2c491 Update changelog for 1.0.3 2016-06-22 14:13:17 +03:00
Nikolay Krasko
e79cfa6f08 Add notes about fixes in formatter 2016-06-21 23:34:03 +03:00
Nikolay Krasko
b860846c0c Add space after a semicolon only if there's another child at the same line 2016-06-21 23:23:59 +03:00
Kirill Rakhman
2c2c9bdefc Format spaces before enum arguments
Fixes #KT-12714
2016-06-21 23:23:58 +03:00
Kirill Rakhman
ea0313106a Format spaces around semicolon
Fixes #KT-12689
2016-06-21 23:23:58 +03:00
Kirill Rakhman
0c0c113460 Format spaces after annotation in annotated expression
Fixes #KT-12781
2016-06-21 23:23:57 +03:00
Kirill Rakhman
28a414514c Format spaces inside curly braces in string template
Fixes #KT-12791
2016-06-21 23:23:56 +03:00
Kirill Rakhman
a02699f2b9 Format spaces around in keyword
Fixes: KT-10680
2016-06-21 23:23:56 +03:00
Mikhail Glukhikh
2f42f12197 Replace explicit parameter with it : correct handling of it from outer lambda #KT-12437 Fixed
(cherry picked from commit cb8fe96)
2016-06-21 22:29:50 +03:00
Mikhail Glukhikh
422795694e Fix for EA-81477 : correct handling of a property without initializer (but with e.g. getter)
(cherry picked from commit 4e2d35a)
2016-06-21 22:29:41 +03:00
Mikhail Glukhikh
d109c728a2 Can be parameter inspection: delete only particular modifiers (e.g. no vararg) #KT-12768 Fixed
(cherry picked from commit d4116b5)
2016-06-21 22:29:26 +03:00
Mikhail Glukhikh
a9d95014ae Can be constructor property: comment saver introduced to retain comments; unbound comments now added before, not after
(cherry picked from commit 886cf21)
2016-06-21 22:29:15 +03:00
Mikhail Glukhikh
57dcb8e1de Minor fixes: can be constructor property
(cherry picked from commit 4d44e15)
2016-06-21 22:29:05 +03:00
Mikhail Glukhikh
ff63ddeffd Code cleanup: "can be constructor property" applied
(cherry picked from commit 6967711)
2016-06-21 22:28:56 +03:00
Valentin Kipyatkov
af9f195af0 KT-12369 Completion: pressing dot after class name should not cause insertion of constructor call
#KT-12369 Fixed
(cherry picked from commit 0bc5007)
2016-06-21 17:14:51 +03:00
Valentin Kipyatkov
a3a36085b4 Fixed test so that it really tests what's intended
(cherry picked from commit b9719bf)
2016-06-21 17:14:43 +03:00
Valentin Kipyatkov
2a5e79117c KT-12669 Completion should show variant with () when there is default lambda
#KT-12669
(cherry picked from commit eb1dbfc)
2016-06-21 17:14:38 +03:00
Valentin Kipyatkov
0a09e49b84 KT-12447 Don't use CompletionProgressIndicator in Kotlin plugin
#KT-12447 Fixed
(cherry picked from commit 962a8f9)
2016-06-21 17:14:31 +03:00
Valentin Kipyatkov
4fba98b9a6 KT-12427 Completion doesn't work for "@receiver:" annotation target
#KT-12427 Fixed
(cherry picked from commit 4e16d67)
2016-06-21 17:14:25 +03:00
Valentin Kipyatkov
4bf5b65350 KT-12328 Qualified function name inserted when typing before "if"
#KT-12328 Fixed
(cherry picked from commit 1413a3f)
2016-06-21 17:14:20 +03:00
Valentin Kipyatkov
ab8ed97571 Fixed extension properties not completed after "get"
(cherry picked from commit 2ec81f4)
2016-06-21 17:14:14 +03:00
Valentin Kipyatkov
9b265625b5 No need to specially handle extensions from current file anymore (since searchScope for KotlinIndicesHelper includes current file)
(cherry picked from commit 88bf7f8)
2016-06-21 17:14:07 +03:00
Valentin Kipyatkov
0ddfd34c06 KT-11975 Invert if-condition intention does not simplify "is" expresssion
#KT-11975 Fixed
(cherry picked from commit 1b16ff6)
2016-06-21 17:14:01 +03:00
Valentin Kipyatkov
8303e4e852 KT-9166 Code completion does not work for synthetic extensions on typing "g"
#KT-9166 Fixed
(cherry picked from commit e8d518a)
2016-06-21 17:13:55 +03:00
Valentin Kipyatkov
612fc08825 KT-12299 Completion: incorrect priority of property foo over method getFoo in Kotlin-only code
#KT-12299 Fixed
(cherry picked from commit e04c6d1)
2016-06-21 17:13:49 +03:00
Valentin Kipyatkov
630a635beb KT-12124 No code completion for a java property in a specific position
#KT-12124 Fixed
(cherry picked from commit 97ad0d5)
2016-06-21 17:13:42 +03:00
Valentin Kipyatkov
c3b4a73afd Moved method getSmartCastVariantsWithLessSpecificExcluded() into IDE
(cherry picked from commit f6c8ac7)
2016-06-21 17:13:36 +03:00
Valentin Kipyatkov
b6c8f47e67 Minor code improvements after conversion
(cherry picked from commit b6c54ac)
2016-06-21 17:13:30 +03:00
Valentin Kipyatkov
5beb05a805 Conversion to Kotlin (step 2)
(cherry picked from commit 83714ae)
2016-06-21 17:13:23 +03:00
Valentin Kipyatkov
530dde8f8f Conversion to Kotlin (step 1)
(cherry picked from commit ccd7ae9)
2016-06-21 17:13:17 +03:00
Valentin Kipyatkov
9a6916931d Added test for KT-12124
(cherry picked from commit fe29530)
2016-06-21 17:13:11 +03:00
Valentin Kipyatkov
30c1b1307f KT-12284 "Add braces to else" has too wide range
#KT-12284 Fixed
(cherry picked from commit 9afb0d5)
2016-06-21 17:13:05 +03:00
Valentin Kipyatkov
8efe1689f9 Refactored replace with safe/dot call fixes
(cherry picked from commit 618b1b9)
2016-06-21 17:12:59 +03:00
Alexey Andreev
ee0f264f21 KT-12417: add support of RTTI against K(Mutable)Property* types 2016-06-21 16:02:31 +03:00
Pavel V. Talanov
fdbca65489 Minor, changelog: add 1.0.4 section 2016-06-21 14:01:33 +03:00
Sergey Mashkov
df32ad8f28 KT-12512 "Different IDE and Maven plugin version" inspection is being invoked for non-tracked pom.xml files 2016-06-21 13:57:15 +03:00
Sergey Mashkov
73b3869756 Fix EA-83601 - ISE: PomFile.<init> 2016-06-21 13:57:10 +03:00
Sergey Mashkov
1f3a7a0c39 KT-12558 Configure Kotlin in Project: Maven: Undo could revert changes in all poms 2016-06-21 13:57:06 +03:00
Sergey Mashkov
7d17bd8d43 Maven: script tag injects kotlin 2016-06-21 13:57:01 +03:00
Sergey Mashkov
ba563ec448 KT-12568 Maven pom.xml: execution configuration: file path completion works only in some sub-elements 2016-06-21 13:56:57 +03:00
Dmitry Jemerov
99b24227ce Merge branch 'rr/yole/ea' into 1.0.3 2016-06-21 12:03:31 +02:00
Denis Zharkov
ffa04e11a8 Fix visibility check for dynamic members within protected method
#KT-11857 Fixed
2016-06-21 11:04:23 +03:00
Mikhail Glukhikh
31e8fe51a6 dangerousFlexibleTypeOrNull : minor refactoring 2016-06-20 21:44:16 +03:00
Mikhail Glukhikh
7cc6b9b910 Has platform type inspection is now intention-based 2016-06-20 21:44:12 +03:00
Mikhail Glukhikh
ed23aa9bc0 Introduce additional fixes & configurable problem range for intention-based inspection 2016-06-20 21:44:07 +03:00
Mikhail Glukhikh
b09b5a9a28 Specify type explicitly intention: now derived from self targeting range intention 2016-06-20 21:44:02 +03:00
Mikhail Glukhikh
a084c1d395 Has platform type : public API only option 2016-06-20 21:43:57 +03:00
Kirill
af1b26b993 Add quickfix tests for HasPlatformTypeInspection 2016-06-20 21:43:51 +03:00
Kirill Rakhman
00d8c26160 Implement inspection for declarations with implicit platform types #KT-12310 Fixed 2016-06-20 21:43:46 +03:00
Nikolay Krasko
21a32408cf Wrong delegation to delegation property in debugger when property defined in another module (KT-12678)
Different bytecode can be generated for delegated property and for non-delegated one. Backend inspects DELEGATED_PROPERTY_CALL to understand the property type, and expects that
this information had been already recorded into context. Frontend writes DELEGATED_PROPERTY_CALL into context during body resolve or type inference if type is not present.

Either way in debugger context it may happen that the DELEGATED_PROPERTY_CALL won't be written into context.

 #KT-12678
2016-06-20 21:14:52 +03:00
Alexander Udalov
3321e904b3 Check return type when locating method in reflection
#KT-11824 Fixed

(cherry picked from commit 311301f430)
2016-06-20 21:05:14 +03:00
Pavel V. Talanov
5e85e85a29 Create SyntheticMemberDescriptor interface
Implement this interface by sam adapters/constructors and use it in navigation

 #KT-11708 Fixed
2016-06-20 20:23:09 +03:00
Dmitry Jemerov
765bd44207 handle IOException from File.getCanonicalFile() (EA-83981 - NA: KotlinToJVMBytecodeCompiler.reportRuntimeConflicts) 2016-06-20 18:20:21 +02:00
Dmitry Jemerov
a77f4dfb8e VirtualFile.getParent() is nullable (EA-84222 - NPE: DecompiledFileWritingAccessProvider.isPotentiallyWritable) 2016-06-20 18:17:03 +02:00
Dmitry Jemerov
c3e38dd594 PsiElement.getNode() is nullable (EA-84534 - NPE: DocCommentConverterKt.content) 2016-06-20 18:15:23 +02:00
Alexander Udalov
21952a64d3 Update diagnostic tests ReadMe, explain tests with diagnostic arguments
(cherry picked from commit 0e881daba3)
2016-06-19 13:53:22 +03:00
Alexander Udalov
602b19bf90 Type-check reference to property with invisible setter to KProperty
#KT-12337 Fixed

(cherry picked from commit 6562a2db19)
2016-06-19 13:53:22 +03:00
Ilya Gorbunov
6804bd6985 Rearrange stdlib unit tests across packages.
Rearrange JS stdlib unit tests.

(cherry picked from commit c5a208f3eb)
2016-06-18 16:53:06 +03:00
Ilya Gorbunov
2044bc9f94 Remove obsolete and not relevant to stdlib tests
(cherry picked from commit d266f546f4)
2016-06-18 16:53:04 +03:00
Alexey Tsvetkov
0aa70fc3b5 Exclude resources dir from surefire test search 2016-06-17 20:14:33 +03:00
Alexander Udalov
6356957bfb Move get-protobuf later in update_dependencies
It invokes kotlinc, so should happen after the bootstrap compiler is downloaded

(cherry picked from commit 3fa87fe4de)
2016-06-17 17:24:59 +03:00
Mikhail Glukhikh
9a50a0b4b9 Elvis / if / when are now infer error type if it exists in one of their branches #KT-6665 Fixed 2016-06-17 16:03:58 +03:00
Mikhail Glukhikh
2eaaf9c14a Sealed class hierarchies are now correctly processed in when (by checking possible smart casts to nested sealed classes) #KT-10648 Fixed 2016-06-17 14:07:42 +03:00
Stanislav Erokhin
9a17999750 Create hack for exception about "Empty intersection for types".
Hackaround for KT-11266, EA-79963, EA-72093,  EA-79976.
2016-06-17 12:14:02 +03:00
Alexander Udalov
7d501714a3 Fix compilation 2016-06-16 18:02:17 +03:00
Alexander Udalov
761116563d Do not skip synthesized members when generating bridges
The condition here is obsolete since SAM adapters can no longer be overridden:
they are now extensions in another scope

 #KT-12708 Fixed

(cherry picked from commit de986ed051)
2016-06-16 17:02:25 +03:00
Alexander Udalov
f2e5d4b699 Report error on accidentally "overriding" wait/notify
#KT-7174 Fixed

(cherry picked from commit 79ecc9751b)
2016-06-16 17:01:45 +03:00
Mikhail Glukhikh
2db7562920 Inspection "can be primary constructor property" with relevant quick-fix #KT-8477 Fixed 2016-06-16 16:20:03 +03:00
Nikolay Krasko
7e2865f500 Implement isInheritor method with utility method that has special behaviour for anonymous classes 2016-06-16 14:18:16 +03:00
Nikolay Krasko
8069aca614 Implement copy methods for anonymous and enum entry light classes 2016-06-16 14:17:40 +03:00
Nikolay Krasko
4dbac59c6e Make Kotlin light class more like PsiAnonymousClassImpl
Avoid delegating to cls delegate in more places
2016-06-16 14:17:38 +03:00
Nikolay Krasko
32ee3f2934 Compare anonymous classes with psi only to avoid counting qualified name 2016-06-16 14:17:37 +03:00
Alexey Tsvetkov
b2851cdba8 Minor test fix 2016-06-15 20:30:16 +03:00
Alexey Tsvetkov
7c9a94d674 Ensure direcory for class file stubs always exists
This fixes the warning "classpath entry does not exist"

    #KT-12352 fixed
2016-06-15 20:06:18 +03:00
Alexey Tsvetkov
cc90e80794 Set friend modules for android gradle test tasks
This fixes the following issues:
1. When product flavors were used, android unit tests could not refer
to internal symbols from main source set.
2. Android instrumentation tests could not refer
to internal symbols from main source set

    #KT-11166 fixed
2016-06-15 20:06:18 +03:00
Zalim Bashorov
fad9a9decb JPS: don't consider that production target of module "B" is depends on test target of module "A" when "B" depends on "A"
#KT-12595 Fixed
2016-06-15 14:43:32 +03:00
Alexander Udalov
3c88ac45f6 Validate "-jvm-target" value in CLI, improve message
(cherry picked from commit 9548ab97251e79cebd1d580466678d52f0080454)
2016-06-15 14:24:02 +03:00
Mikhael Bogdanov
cd460987dc Support 'jvm-target' in CLI
(cherry picked from commit 3a8591a)
2016-06-15 14:15:13 +03:00
Dmitry Petrov
9c80f87794 KT-5075 Optimize array/collection indices usage in 'for' loop
Use specialized 'for' loop code generation strategy for loops over array indices and collection indices.
(cherry picked from commit a17b0dd)
2016-06-15 14:03:42 +03:00
Alexander Udalov
477b1cf151 Fix error in kapt on enum constructors with parameters
Do not skip writing the fictitious 'java/lang/Synthetic' annotation in KAPT
mode, because its absence makes ASM confuse indices of enum constructor
parameters (it cannot figure out that there are two additional parameters, name
and ordinal)

 #KT-12694 Fixed

(cherry picked from commit 99f4c7b6e7)
2016-06-14 22:08:25 +03:00
Nikolay Krasko
53e6139def Build output parser in separate module under 1.6 (KT-12159)
KotlinOutputParser accessed from gradle execution environment that can be started under Java 1.6.

 #KT-12159 Fixed
2016-06-14 19:41:14 +03:00
Nikolay Krasko
0c6602ab84 Add dependency to tests-common in j2k module 2016-06-14 16:43:17 +03:00
Alexander Udalov
ca66f1f29b Use protobuf with renamed packages, pack to IDEA plugin
Update GenerateProtoBuf.kt to also regexp-replace com.google.protobuf with
org.jetbrains.kotlin.protobuf in generated Java sources

 #KT-12581 Fixed

(cherry picked from commit 7e38b93d80)
2016-06-14 14:59:21 +03:00
Alexander Udalov
e195ae2516 Rename packages in protobuf-java binaries and sources
#KT-12581 In Progress

(cherry picked from commit 952a85414b)
2016-06-14 14:37:17 +03:00
Mikhail Glukhikh
ac8c749af8 Surround with null check : applicable also for TYPE_MISMATCH
(cherry picked from commit b173492)
2016-06-13 20:52:48 +03:00
Mikhail Glukhikh
15b39f7427 Wrap with safe let call : minor refactoring
(cherry picked from commit 10935ba)
2016-06-13 20:52:32 +03:00
Mikhail Glukhikh
2e38fbd274 Surround with null check : apply for ITERATOR_ON_NULLABLE
(cherry picked from commit 954952a)
2016-06-13 20:52:12 +03:00
Mikhail Glukhikh
e923f2ed42 Surround with null check : minor refactoring
(cherry picked from commit 7f77107)
2016-06-13 20:51:55 +03:00
Mikhail Glukhikh
2ffad4b5fa KT-11104 extra : name validator introduced for wrap with safe let call
(cherry picked from commit 230f73a)
2016-06-13 20:51:39 +03:00
Mikhail Glukhikh
18d6427ff2 KT-11104 extra : "wrap with safe let call" is now applicable for argument type mismatches
(cherry picked from commit 3c49b5f)
2016-06-13 20:51:17 +03:00
Mikhail Glukhikh
9fa7e0bc96 Quick-fix "wrap with safe let call" introduced #KT-11104 Fixed
(cherry picked from commit 47c1106)
2016-06-13 20:51:00 +03:00
Mikhail Glukhikh
d4f28855d5 Correct "Show type" on an invoked expression #KT-12671 Fixed
(cherry picked from commit f8b6ed2)
2016-06-13 20:50:42 +03:00
Mikhail Glukhikh
c0f6cee914 KT-11104 : quick fix "surround with null check"
(cherry picked from commit 90342ea)
2016-06-13 20:50:19 +03:00
Mikhail Glukhikh
e2c2f8e684 If to when: more accurate comment handling #KT-12649 Fixed
(cherry picked from commit 9470308)
2016-06-13 13:44:39 +03:00
Stanislav Erokhin
6003dda5e5 KT-10717 Type inference for lambda with local return
#KT-10717 Fixed
(cherry picked from commit 585dcbf)
2016-06-10 21:38:18 +03:00
Stanislav Erokhin
d6894e07b1 Add assertion for variable as operator call.
(cherry picked from commit da01e4a)
2016-06-10 21:29:21 +03:00
Stanislav Erokhin
873795ff54 Minor. removed several tests with error calls.
(cherry picked from commit 0324141)
2016-06-10 21:29:15 +03:00
Nikolay Krasko
d035645a8c j2k: minor fixes in KtLightClassForAnonymousDeclaration 2016-06-10 14:07:37 +03:00
Nikolay Krasko
dfa286394b j2k: actual convert KtLightClassForAnonymousDeclaration 2016-06-10 14:07:36 +03:00
Nikolay Krasko
3c963b040e j2k: rename KtLightClassForAnonymousDeclaration 2016-06-10 14:07:34 +03:00
Nikolay Krasko
f36180c33d Minor: clean up and reformat 2016-06-10 14:07:33 +03:00
Alexander Udalov
1b226d1d7a Fix toString() and reflectLambda() for lambdas with generic types in signatures
#KT-10771 Fixed

(cherry picked from commit 59342000ae)
2016-06-10 12:39:41 +03:00
Denis Zharkov
66530e5e7a Refactor function descriptors copy mechanism
Pull up CopyBuilder to interface and inline some custom usages

(cherry picked from commit e316ab2ee6)
2016-06-10 12:37:47 +03:00
Alexander Udalov
96f704c348 Implement copy in FunctionDescriptorImpl, call doSubstitute only in CopyConfiguration#build
(cherry picked from commit dc2972d99e)
2016-06-09 17:32:56 +03:00
Alexander Udalov
06032d33d4 J2K JavaElementCollectionFromPsiArrayUtil
(cherry picked from commit ee8ca0b850)
2016-06-09 17:29:44 +03:00
Alexander Udalov
4eeea9b960 Minor, move the Lombok hack a bit higher
(cherry picked from commit db3e0798c8)
2016-06-09 16:40:05 +03:00
Alexander Udalov
dcf42e2e4a Minor, drop java_generic_services option from .proto files
There are no service definitions in our .proto files, so this option had no
effect

(cherry picked from commit 3477f6ee85)
2016-06-09 16:23:52 +03:00
Alexander Udalov
ce3e98c8bf Minor, cleanup GenerateProtoBuf.kt
(cherry picked from commit aba1cc3d83)
2016-06-09 16:17:57 +03:00
Alexander Udalov
17b8bac308 J2K serialization: fix compilation and prettify
(cherry picked from commit 0c0a451d20)
2016-06-09 16:17:50 +03:00
Alexander Udalov
86a836432a J2K serialization: invoke automatic J2K conversion 2016-06-09 16:13:56 +03:00
Alexander Udalov
bea86db6b5 J2K serialization: move .java -> .kt 2016-06-09 16:12:08 +03:00
Alexander Udalov
9eff617bea Minor, remove 'depends' from kotlin-build-common-test Ant task
Similarly to other targets in build.xml, this simplifies manual partial
compilation of artifacts

(cherry picked from commit 3469e980cb)
2016-06-09 16:10:58 +03:00
Stanislav Erokhin
822071aecf KT-11778 Exception in Lombok plugin: Rewrite at slice FUNCTION
#KT-11778 Fixed.
EA-64051 Fixed.
(cherry picked from commit 4f943dc)
2016-06-09 14:23:32 +03:00
Pavel V. Talanov
3731e170e4 Update changelog for 1.0.3 2016-06-08 19:26:23 +03:00
Mikhail Glukhikh
aab4d9e8e2 Type parameter is considered capable of taking any value for the purpose of cast possibility check #KT-6611 Fixed
(cherry picked from commit 4b6b35d)
2016-06-08 17:48:00 +03:00
Mikhail Glukhikh
85a89cb80b CastDiagnosticsUtil.kt: converted to Kotlin
(cherry picked from commit 99acbf1)
2016-06-08 17:47:55 +03:00
Mikhail Glukhikh
1164dec297 CastDiagnosticsUtil.java --> CastDiagnosticsUtil.kt
(cherry picked from commit f3f7bff)
2016-06-08 17:47:51 +03:00
Pavel V. Talanov
ff82155f93 plugin.xml: Add dependency on java module
This restricts usage of plugin to IDEA and Android Studio
2016-06-08 17:43:15 +03:00
Alexander Udalov
35bc25577a Use empty list instead of ThrowingList in callable reference resolution
Clients of the call resolution do not expect to see a throwing list in call's
arguments, and it's wrong to make each of them check against the special case
that is the resolution of callable references.

Fixes EA-69901

(cherry picked from commit d8db769823)

Note that the test was NOT cherry picked from master because it depends on the
new language feature which is absent in 1.0.3
2016-06-08 15:05:03 +03:00
Alexey Sedunov
30ba7689db Minor: Fix compilation 2016-06-08 14:21:36 +03:00
Alexey Sedunov
2319ef2d8d Rename: Do not rename ambiguous references in import directives
#KT-6363 Fixed
(cherry picked from commit fe01035)
2016-06-08 12:11:00 +03:00
Alexey Sedunov
4526678cb4 Rename: Show more detailed element descriptions in Rename dialog
#KT-8544 Fixed
(cherry picked from commit 8ba1aff)
2016-06-08 12:10:45 +03:00
Alexey Sedunov
f4538bc3a6 Rename: Copy default values if function to be renamed inherits default values from some base function which is excluded from rename
#KT-9446 Fixed
(cherry picked from commit 9692c21)
2016-06-08 12:10:29 +03:00
Alexey Sedunov
2475dc5151 Rename: Implement automatic renamer for test classes
#KT-8512 Fixed
(cherry picked from commit 1885310)
2016-06-08 12:10:17 +03:00
Alexey Sedunov
388dadcf6d Rename: Do not show 'Rename overloads' options if target function has no
overloads. Consider extensions and members overloads if they have the same
recever class
 #KT-8541 Fixed
 #KT-8786 Fixed
(cherry picked from commit 42b71ae)
2016-06-08 12:10:08 +03:00
Alexey Sedunov
33a1efc624 Minor: Drop obsolete code
(cherry picked from commit 9b3f40e)
2016-06-08 12:09:59 +03:00
Alexey Sedunov
28ada3bf30 Light Classes: Drop obsolete constraint which prevents generation of light methods for local class members
#KT-8892 Fixed
(cherry picked from commit cf8cf37)
2016-06-08 12:09:48 +03:00
Alexey Sedunov
0b1a2194cb Rename: Do not replace Java references to synthetic component functions when renaming constructor parameter
#KT-9241 Fixed
(cherry picked from commit d27f3c0)
2016-06-08 12:09:39 +03:00
Alexey Sedunov
b35dd6b026 Rename: Allow typing any identifier without backquotes in Rename dialog
#KT-9444 Fixed
(cherry picked from commit 958b402)
2016-06-08 12:09:31 +03:00
Alexey Sedunov
a9830b2d28 Rename: @JvmName support
#KT-8044 Fixed
 #KT-9432 Fixed
(cherry picked from commit 96132fa)
2016-06-08 12:09:18 +03:00
Alexey Sedunov
18913925d9 Rename: Allow renaming class by constructor delegation call referencing primary constructor
#KT-8860 Fixed
(cherry picked from commit ff4c16d)
2016-06-08 12:08:50 +03:00
Alexey Sedunov
dcdf0cc33e Rename: Respect naming conventions in automatic variable rename
#KT-7851 Fixed
(cherry picked from commit e89e809)
2016-06-08 12:08:36 +03:00
Alexey Sedunov
3af211275b Rename: Skip read-only declarations when renaming parameters
#KT-10713 Fixed
(cherry picked from commit 400d6b5)
2016-06-08 12:08:28 +03:00
Alexey Sedunov
de1ff80486 Rename: Fixed in-place rename of Kotlin expression referring Java declaration
#KT-9157 Fixed
(cherry picked from commit 566ed01)
2016-06-08 12:08:20 +03:00
Alexey Sedunov
3eb80015c7 Rename: Quote non-identifier names in Kotlin references
#KT-9156 Fixed
(cherry picked from commit 691de67)
2016-06-08 12:08:09 +03:00
Alexey Sedunov
2205227f47 Refactoring: Move quoteIfNeeded function to idea-core
(cherry picked from commit a743098)
2016-06-08 12:08:00 +03:00
Alexey Sedunov
4b77ee5feb Create Test Intention: Fix RuntimeException on attempt to convert generated test class to Kotlin
#KT-12285 Fixed
 #EA-82281 Fixed
(cherry picked from commit 79f31cd)
2016-06-08 12:07:14 +03:00
Yan Zhulanow
6d21c3d145 Fix EA-81689
(cherry picked from commit 99b6194)
2016-06-07 21:17:34 +03:00
Alexander Udalov
23b7bb8fba Inline PrintingMessageCollector#PLAIN_TEXT_TO_SYSTEM_ERR
Otherwise 'hasErrors' flags was not cleared between subsequent runs of tests
which were using this message collector

(cherry picked from commit e3164119c1)
2016-06-07 21:12:39 +03:00
Nikolay Krasko
f03816ef1b Support Idea 163 branch 2016-06-07 19:29:44 +03:00
Kirill Rakhman
cb696b31ce Formatter: handle spaces before value arguments list (KT-12634)
#KT-12634 Fixed
2016-06-07 19:29:44 +03:00
Alexey Tsvetkov
2ae4d2a2fb Minor fixes of android test project 2016-06-07 19:21:55 +03:00
Jake Wharton
470600c2ef Add support for the Android test plugin.
#KT-11767 fixed
2016-06-07 19:21:55 +03:00
Yan Zhulanow
cddcf025b5 Fix EA-80764. Do not try to get the resource manager for the disposed module
(cherry picked from commit c3bd243)
2016-06-07 18:38:59 +03:00
Yan Zhulanow
51015965f2 Fix EA-82394. PsiType.getClassName() can return null. Return "<anonymous type>" in that case.
(cherry picked from commit 8be1335)
2016-06-07 18:38:56 +03:00
Yan Zhulanow
37dc0aeeac Fix EA-82166. NPE. loadModel() can return null, and it's a bad idea to call methods on a null pointer.
(cherry picked from commit cf033d0)
2016-06-07 18:38:53 +03:00
Yan Zhulanow
2179ee82a9 Fix EA-82449. Do not run Lint diagnostics if the project is already disposed
(cherry picked from commit 98b2899)
2016-06-07 18:38:50 +03:00
Yan Zhulanow
696475e6bf KT-12387 Fix Performance problem with Lint in IDE
Call checkCanceled() before running Lint diagnostics (UastScanner)
(cherry picked from commit c6e328a)
2016-06-07 18:38:47 +03:00
Yan Zhulanow
dbc54e2c52 Fix #KT-12047 (Kotlin Lint: "Missing @JavascriptInterface on methods" does not report anything)
(cherry picked from commit 61e8e01)
2016-06-07 18:38:44 +03:00
Yan Zhulanow
5c78acc38c Fix #KT-12015 (Kotlin Lint False Positive for Bundle.getInt()).
Android firstly checks API version against the function call receiver type, so we should do the same to be consistent.
(cherry picked from commit c3d01ec)
2016-06-07 18:38:40 +03:00
Pavel V. Talanov
dd4c370c57 Changelog for 1.0.3: delete empty 1.1 section 2016-06-07 17:16:40 +03:00
Pavel V. Talanov
421ea3b0c5 Changelog, minor: merge duplicating JS sections 2016-06-07 17:15:23 +03:00
Pavel V. Talanov
f6ad3d92f5 Update changelog for 1.0.3 2016-06-07 17:06:11 +03:00
Dmitry Jemerov
5675b8b4f6 search for Kotlin convention usages of Java methods
#KT-5960 Fixed
(cherry picked from commit 060c285)
2016-06-07 14:54:35 +02:00
Dmitry Jemerov
87d07924da when finding usages of parameter of annotation class primary constructor, search also for light method generated from that parameter
#KT-9399 Fixed
(cherry picked from commit 7e2ce2d)
2016-06-07 14:54:28 +02:00
Alexey Andreev
e45e3dd652 JS/Inliner: fix build 2016-06-07 12:24:55 +03:00
Alexey Andreev
0f1e21cdf8 JS/Inlining: in RedundantStatementElimination remove unnecessary side effect check for binary expressions 2016-06-07 12:24:54 +03:00
Alexey Andreev
5ad50f837a JS/Inlining: rename IneffectiveStatementElimination to RedundantStatementElimination 2016-06-07 12:24:54 +03:00
Alexey Andreev
3cb1a71b75 JS/Inlining: minor improvements and clarifications after code review. Test whether expression without side effect does not prevent to relocate another expressions 2016-06-07 12:24:54 +03:00
Alexey Andreev
2166547123 JS/Inlining: change sideEffects metadata to take three values: producing side effect, dependding on side effect and purity 2016-06-07 12:24:53 +03:00
Alexey Andreev
0936839410 JS/Inlining: improve test for removal of binary expresions without side effect, add tests for removal of a reference to a function parameter 2016-06-07 12:24:53 +03:00
Alexey Andreev
c0d094b1e3 JS/Inlining: refactor TemporaryVariableElimination 2016-06-07 12:24:52 +03:00
Alexey Andreev
654700694a JS/Inlining: refactor IneffectiveStatementElimination 2016-06-07 12:24:52 +03:00
Alexey Andreev
e7b7628f6c JS/Inlining: clarify why it's necessary to remove expression statements like a[b] 2016-06-07 12:24:51 +03:00
Alexey Andreev
a304ffd0c9 JS/Inlining: in temporary variable elimination don't treat FQN without side effects as trivial, i.e. disable moving these vars freely across function body 2016-06-07 12:24:51 +03:00
Alexey Andreev
b983312d0a JS/Inlining: minor simplifications after code review 2016-06-07 12:24:51 +03:00
Alexey Andreev
53ce2d0446 JS/Inlining: refactor TemporaryAssignmentElimination, add more tests 2016-06-07 12:24:50 +03:00
Alexey Andreev
3e19c09d57 JS/Inlining: add test case for KT-10931 2016-06-07 12:24:50 +03:00
Alexey Andreev
2b6ddb1608 JS/Inlining: minor code style fixes 2016-06-07 12:24:49 +03:00
Alexey Andreev
54f59fdc3d JS/Inlining: in function call like fn() extract fn to a local variable, since fn can be access to property with side effects. Add tests to prove that evaluation order became proper in certain cases. Fix KT-11711, KT-7674, KT-7043 2016-06-07 12:24:49 +03:00
Alexey Andreev
2486da41d8 JS/Inlining: mark closure constructors as free from side effects 2016-06-07 12:24:48 +03:00
Alexey Andreev
2ab89ea65c JS/Inlining: in temporary variable elimination improve moving of some expressions which are provably pure 2016-06-07 12:24:48 +03:00
Alexey Andreev
dda6330be8 JS/Inlining: when generating expression for default property accessor, mark this expression as side effect free, so optimizer has opportunity to move it 2016-06-07 12:24:45 +03:00
Alexey Andreev
78f4f20080 JS/Inlining: fix broken evaluation order after applying temporary variable elimination 2016-06-07 12:24:09 +03:00
Alexey Andreev
00ce8b3fc1 JS/Inlining: in expression like f(g()), where *f* is inline, don't treat g() as a lambda constructor 2016-06-07 12:24:09 +03:00
Alexey Andreev
78d62b2985 JS/Inlining: introduce removal of expression statements without side effects 2016-06-07 12:24:08 +03:00
Alexey Andreev
909bc0161c JS/Inlining: introduce removal of unused variables 2016-06-07 12:24:08 +03:00
Alexey Andreev
34dfadd278 JS/Inlining: in temporary variable elimination introduce better recognition of FQNs without side effects 2016-06-07 12:24:08 +03:00
Alexey Andreev
e8a92150b4 JS/Inlining: always create temporary variables to alias expressions in following cases:
* when decomposing expression that contains inline calls, alias all subexpressions
* when substituting arguments to inline call
* for value returned from inline function.

Instead, rely on dedicated optimization pass. Improve lookup of function to inline, since the old one relied on immediate optimizations. Give more hints to optimizer.

This should make inlining more stable in different hard-to-reproduce corner cases with evaluation order.
2016-06-07 12:24:07 +03:00
Alexey Andreev
a72d63a8c9 JS/Inlining: fix bug in temporary assignment elimination which causes excess removal of assignment statement. When there is a set of temporary variables that receive same value in different execution branches, remove them carefully so that at least one (and, preferably, at most) remains in each branch. 2016-06-07 12:24:02 +03:00
Valentin Kipyatkov
72f6f9b5d7 KT-12260 ISE while replacing an operator with safe call
#KT-12260 Fixed
(cherry picked from commit 3f82cc9)
2016-06-06 15:11:27 +03:00
Alexander Udalov
2224702216 Minor, make CapturedParamInfo#skipInConstructor immutable
(cherry picked from commit 390b78b7f7)
2016-06-06 13:32:36 +03:00
Alexander Udalov
ac32cd83c1 Minor, delete CapturedParamOwner
(cherry picked from commit b370ac0b37)
2016-06-06 13:32:34 +03:00
Alexander Udalov
07ea37022a Cleanup inline codegen classes
Fix warnings, typos, formatting, break long lines, remove unused, add
nullability annotations, inline small methods used only once

(cherry picked from commit e148dcdee7)
2016-06-06 13:32:26 +03:00
Dmitry Jemerov
f74bd75dfa don't quote empty package name
(cherry picked from commit 6a1ffc8)
2016-06-03 16:28:48 +02:00
Dmitry Jemerov
a7074fe7a8 fix compilation 2016-06-03 15:11:25 +02:00
Dmitry Jemerov
cacbd4c553 change implementation of 'new file' action to support escaping the package name and creating directory/package hierarchy
#KT-8362 Fixed
 #KT-11328 Fixed
(cherry picked from commit 8b30e7e)
2016-06-03 14:19:54 +02:00
Dmitry Jemerov
a475da5256 de-i18n
(cherry picked from commit 5f89274)
2016-06-03 14:19:47 +02:00
Dmitry Jemerov
5d63e2346f NewKotlinFileAction: J2K
(cherry picked from commit 28100be)
2016-06-03 14:19:37 +02:00
Dmitry Jemerov
713fdcd409 NewKotlinFileAction: rename to .kt
(cherry picked from commit 2ee03a7)
2016-06-03 14:19:31 +02:00
Dmitry Jemerov
82a7fc6c29 show new icon for Kotlin annotations in structure view (KT-12516)
(cherry picked from commit 349376c)
2016-06-03 14:19:19 +02:00
Dmitry Jemerov
52a97a0b19 can't close contents in Kotlin Bytecode toolwindow (KT-9797)
(cherry picked from commit 987b48d)
2016-06-03 14:19:04 +02:00
Pavel V. Talanov
1938b436a1 Update changelog for 1.0.3 2016-06-02 19:19:41 +03:00
Mikhael Bogdanov
c70cfd28ca Don't generate unnecessary checkcast to java.lang.Number
(cherry picked from commit 092be8c)
2016-06-02 16:24:44 +03:00
Mikhael Bogdanov
67db7ab151 Fix for KT-12582: "VerifyError: Bad local variable type" caused by explicit loop variable type
#KT-12582 Fixed
(cherry picked from commit a6cf169)
2016-06-02 16:24:41 +03:00
Mikhael Bogdanov
7a76e4e38b Disabled several tests on android
(cherry picked from commit e7f9d34)
2016-06-02 16:24:38 +03:00
Mikhael Bogdanov
03040a71f3 Small refactoring in constant processing
(cherry picked from commit c7d97c6)
2016-06-02 16:24:36 +03:00
Mikhail Glukhikh
4c7e596897 Quick fix "add !!" for SMARTCAST_IMPOSSIBLE in certain situations
(cherry picked from commit 33b6780)
2016-06-02 16:13:17 +03:00
Mikhail Glukhikh
60fb5c7f29 Convert to expression body: take nested whens into account
(cherry picked from commit 9f819b1)
2016-06-02 16:12:57 +03:00
Mikhail Glukhikh
b9d630c7ac Convert to expression body is forbidden on single non-exhaustive when statement with Unit result #KT-12502 Fixed
(cherry picked from commit 2350caf)
2016-06-02 16:12:45 +03:00
Mikhail Glukhikh
0b6adb5c1e "Make abstract" is no longer applicable to object / enum entry members #KT-3797 Fixed
(cherry picked from commit 91ce8cc)
2016-06-02 16:12:32 +03:00
Nikolay Krasko
e57427a246 Remove forgotten import 2016-06-02 15:07:52 +03:00
Nikolay Krasko
d48294e8c7 NoSuchFieldError in Evaluate Expression on a property of a derived class (KT-12206)
#KT-12206 Fixed

Conflicts:
	compiler/backend/src/org/jetbrains/kotlin/codegen/JvmCodegenUtil.java
2016-06-02 14:50:23 +03:00
Kirill Rakhman
944a4446ff Formatter: handle spaces between class name and type parameters (#875)
Fixes #KT-12446
(cherry picked from commit c24960f)
2016-06-01 20:23:11 +02:00
Alexander Udalov
022ef6410d Drop isAbsoluteInRootPackage from stubs
(cherry picked from commit 7eafae1936)
2016-06-01 19:33:45 +03:00
Alexander Udalov
3951b6f719 Drop undocumented absolute name specification feature with 'package.'
(cherry picked from commit 1339286261)
2016-06-01 19:32:21 +03:00
Alexey Tsvetkov
96e2deab25 Minor: fix snapshot version in gradle test 2016-06-01 16:45:21 +03:00
Alexey Tsvetkov
5872aeb375 Shade in kotlin-build-common-test 2016-05-31 22:20:16 +03:00
Alexey Tsvetkov
74f7e9f955 Shade in kotlin-android-extensions 2016-05-31 22:20:16 +03:00
Alexey Tsvetkov
caf87fbab2 Shade in kotlin-compiler-embeddable
Now kotlin gradle plugin is compatible with android gradle plugin 2.2

     #KT-12478 fixed
     #KT-12431 fixed
     #KT-12406 fixed
2016-05-31 22:20:16 +03:00
Alexey Tsvetkov
782f4bffbf Set idea.io.use.nio2=true every build on windows
Otherwise (setting property once in static block) gradle daemon might clear system properties

     #KT-11770 fixed
2016-05-31 22:20:16 +03:00
Mikhael Bogdanov
a020870de3 Fix for KT-12200: initial property assignment ignored
#KT-12200 Fixed
(cherry picked from commit 0f1589f)
2016-05-31 15:29:03 +03:00
Alexey Andreev
bff1963f9e KT-11960: add test for case of instantiating inner class of a local class 2016-05-31 15:25:40 +03:00
Alexey Andreev
1bcc173e36 KT-11960 Fix case of instantiation of local class via its inner class or via nested lambda. Move tests to more appropriate location. Fix bug in blackbox codegen generator for JVM, which does not allow to suppress tests. 2016-05-31 15:25:40 +03:00
Alexey Andreev
9b59d0de7a KT-11960 Minor code style fixes 2016-05-31 15:25:40 +03:00
Alexey Andreev
1124fddb9e KT-11960 Fix for data classes 2016-05-31 15:25:39 +03:00
Alexey Andreev
55b158f7d5 KT-11960 Fix for case when class instantiates itself 2016-05-31 15:25:39 +03:00
Alexander Udalov
d6addc4ea5 Keep Native2AsciiCharsetProvider from being stripped by proguard
#KT-12549 Fixed

(cherry picked from commit a300dee61f)
2016-05-31 14:28:44 +03:00
Kirill Rakhman
743ee4f278 Formatter: handle spaces around 'is' keyword (#874)
Fixes #KT-12548
(cherry picked from commit 93ebb3d)
2016-05-30 19:36:53 +02:00
Alexander Udalov
e14efcebc0 Fix compilation of kotlin-maven-plugin
(cherry picked from commit ec8c8da142c4325100dba64da5aaf04a9f405177)
2016-05-30 15:46:04 +03:00
Alexey Sedunov
886de1d9bf Spring Support: Fixed rename of custom-named beans specified with Kotlin annotation
#KT-12096 Fixed
(cherry picked from commit ec0f21c)
2016-05-30 15:38:32 +03:00
Alexey Sedunov
cee494eaf9 Spring Support: Automatic configuration by @Import and @ComponentScan ("basePackages"/"basePackageClasses")
#KT-12135 Fixed
 #KT-12139 Fixed
(cherry picked from commit 076e31c)
2016-05-30 15:38:16 +03:00
Alexey Sedunov
560b7c5be3 Spring Support: Implement @ComponentScan inspection
#KT-12465 Fixed
(cherry picked from commit 781a1e0)
2016-05-30 15:37:58 +03:00
Alexey Sedunov
9717eb5172 Code Insight: Implement package references inside of string literals
#KT-12136 In Progress
(cherry picked from commit d69140b)
2016-05-30 15:37:17 +03:00
Alexey Sedunov
0d97f96b0e Light Classes: Consider FakeFileForLightClass instances equivalent if they correspond to the light classes with common KtFile
#KT-12117 Fixed
(cherry picked from commit d52e62b)
2016-05-30 15:37:06 +03:00
Mikhail Glukhikh
bfbde9042d Simplify for intention: apply name validator to prevent conflicts
(cherry picked from commit 7a24429)
2016-05-30 14:44:21 +03:00
Mikhail Glukhikh
d07b0fcb8d Simplify for intention: applicable of any numbers of properties used #KT-10779 Fixed
(cherry picked from commit 792b37b)
2016-05-30 14:43:49 +03:00
Alexander Udalov
452932b55c Minor, update ChangeLog with '-language-version'
(cherry picked from commit fbd671c158)
2016-05-30 13:52:27 +03:00
Mikhail Glukhikh
dd6da009d9 Attach "add remaining branches" and "add else branch" fixes to NON_EXHAUSTIVE_WHEN warning #KT-12503 Fixed
(cherry picked from commit c26d7e0)
2016-05-30 12:34:38 +03:00
Alexander Udalov
461fdad5df Minor, add comments on declarations used in Eclipse plugin
(cherry picked from commit 68c5e8e190)
2016-05-27 19:41:42 +03:00
Alexander Udalov
b2f428d5b6 Minor, make Services#get return type nullable
(cherry picked from commit a95568eedf)
2016-05-27 19:41:39 +03:00
Alexander Udalov
6c9cdd82d3 Fix project compilation after introduction of bound references
`java` in the package name inside an extension to KClass is now resolved to the
extension property `KClass#java`. So `java.X::class` is now equivalent to
`this.java.X::class`

(cherry picked from commit 57849c9dfd)
2016-05-27 19:40:05 +03:00
Alexander Udalov
37d76c4866 Minor, capitalize language feature names in tests
To simplify textual search across the codebase

(cherry picked from commit 7cb61b81ab)
2016-05-27 19:39:57 +03:00
Mikhail Glukhikh
6806b0813a Back-end JVM: more accurate handling of when expressions with Unit result #KT-12192 Fixed
(cherry picked from commit 8713190)
2016-05-27 18:12:33 +03:00
Pavel V. Talanov
56a8ea3492 Refactor LanguageFeatureSettings: Add LanguageVersion and LanguageFeature entities
(cherry picked from commit 76971eca70)
2016-05-27 14:32:41 +03:00
Alexander Udalov
195acce366 Minor, update javac2 annotation filter for kotlin-build-common-test
(cherry picked from commit 9bdf8f1082)
2016-05-27 14:28:13 +03:00
Alexander Udalov
b5ee06be1f Add tests on "-language-version" usage from Ant, Maven, Gradle
(cherry picked from commit 2c516f18a0)
2016-05-27 14:27:58 +03:00
Alexander Udalov
efbecc9fb2 Validate "-language-version" argument value, add tests
(cherry picked from commit bc5202a4d7)
2016-05-27 14:25:44 +03:00
Alexander Udalov
fa3a7f056a Support enabling/disabling language features in diagnostic tests (unsupported in 1.0.3)
(cherry picked from commit 98c3e030a1)
2016-05-27 14:21:30 +03:00
Alexander Udalov
833cf8267f Support "-language-version" CLI option for compatibility with older releases
Introduce LanguageFeatureSettings, instance of which should be injected by the
container and be accessible everywhere during the compilation (front-end and
back-end).

Parameters of LanguageFeatureSettings are unused in this commit, will be used
later

(cherry picked from commit e1ba4480d7)
2016-05-27 14:16:13 +03:00
Pavel V. Talanov
ad6f2de8a1 KtLightMethod: Wrap return type so it resolves to light method's type parameter as opposed to delegate's
Affects java type inference in IDEA

  #KT-12090 Fixed
  #KT-11095 Fixed
2016-05-27 13:15:42 +03:00
Alexey Andreev
97228e5ac4 KT-6942: in JS backed for value equalitity patterns in when generate structural equality check (i.e. Any.equals) instead of referential check (===). 2016-05-26 14:31:50 +03:00
Alexander Udalov
bf3ada0592 Prevent META-INF/INDEX.LIST from jsr166e.jar to be packed into compiler
INDEX.LIST contains a list of jars with the information about what packages
does each of those jars have (this feature is called JarIndex, see
http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html). In case of
ideaSDK/core/jsr166e.jar, it only has one entry -- jsr166e.jar itself. When the
compiler is started, the class loading mechanism reads this file and assumes
that there are no other jars nearby. But the compiler depends on other jars,
namely kotlin-runtime.jar and kotlin-reflect.jar, thus we get
ClassNotFoundException when trying to load almost any Kotlin bytecode from
kotlin-compiler.jar.

Note that, fortunately, release builds are not affected because:
1) proguard helpfully strips this file from the final kotlin-compiler.jar;
2) we use a custom class loader (Preloader) which ignores JarIndex.
This only affects local setup with proguard disabled, where one test
(CompilerDaemonTest) was failing because it was trying to invoke the compiler
directly via "java -jar ..."

To implement this, it was necessary to exclude this one file from the compiler
jar, however the "zipgroupfileset" Ant task does not support exclusion of one
file from a particular archive, so we pack all idea core libraries into one jar
beforehand and use "zipfileset" which supports exclusion of one file
(http://stackoverflow.com/a/2426245/288456).

(cherry picked from commit c3f1afee626502470dbe27a1343c777e5cade789)
(cherry picked from commit 9a762e0fa2)
2016-05-26 14:18:33 +03:00
Alexander Udalov
db2fa0fbdf Fix kotlin-maven-plugin compilation
(cherry picked from commit e5d64d316d)
2016-05-26 14:18:31 +03:00
Alexander Udalov
3db9871a13 Render different class kinds differently in bytecode listing test
(cherry picked from commit b208995d73)
2016-05-26 13:27:05 +03:00
Alexander Udalov
84b573d1ea J2K backend-common classes: convert
Also merge CodegenUtilKt into CodegenUtil

(cherry picked from commit c1c2651988)
2016-05-26 13:26:54 +03:00
Alexander Udalov
b043906395 J2K backend-common classes: rename .java -> .kt
(cherry picked from commit 27ed0dd25f)
2016-05-26 13:25:33 +03:00
Alexander Udalov
f59bf2d8ef Minor, comment out ignored test
(cherry picked from commit d89e907f00)
2016-05-26 13:24:48 +03:00
Alexander Udalov
0b44a90823 Move some configuration keys to JVM or to CommonConfigurationKeys
Move CONTENT_ROOTS and SCRIPT_DEFINITIONS_KEY to JVMConfigurationKeys because
they are only used on JVM, rename the latter to SCRIPT_DEFINITIONS.

Move MODULE_NAME to CommonConfigurationKeys to be combined with MODULE_ID in
JSConfigurationKeys in the future

(cherry picked from commit 05f8836f46)
2016-05-26 13:24:38 +03:00
Alexander Udalov
8233c5d458 Delete unused ParentLastURLClassLoader
(cherry picked from commit 5bf14c106a)
2016-05-26 13:20:50 +03:00
Alexander Udalov
89059bda04 Remove dangerous readKotlinHeader() in inlineUtil.kt
It was creating a phantom FileBasedKotlinClass which was not based on any file

(cherry picked from commit b9fb6c0d84)
2016-05-26 13:20:44 +03:00
Alexander Udalov
c19dbefe1b Move JVMConfigurationKeys to frontend.java
Similarly to K2JVMCompilerArguments, they will soon be needed in the IDE code.
Move COMPILER_JAR_LOCATOR to CLIConfigurationKeys because it's used both in JVM
and JS, and only in CLI. Other keys, non-relevant in the IDE, may be moved out
soon as well, such as incremental compilation components

(cherry picked from commit 6c0ff40197)
2016-05-26 13:19:45 +03:00
Alexander Udalov
c07350227e Minor, break the line in "kotlinc -help" if it's too long
To improve description of the "pluginOptions" flag

(cherry picked from commit dcb2d7b4f6)
2016-05-26 13:19:39 +03:00
Alexander Udalov
c2cf56b137 Rename compilerConfigurationForTests -> newConfiguration
(cherry picked from commit 6674412079)
2016-05-26 13:15:45 +03:00
Alexander Udalov
6e967b1e0b Rename Config -> JsConfig
(cherry picked from commit 116e4a5ced)
2016-05-26 13:11:11 +03:00
Alexander Udalov
e9fe329415 Get rid of unnecessary exceptions in JS translator
Before this commit, an internal error during JS translation resulted in the
actual exception wrapped in TranslationRuntimeException wrapped in
TranslationInternalException wrapped in RuntimeException being thrown. This
change gets rid of the two latter wrappings.

Also delete unthrown MainFunctionNotFoundException and related unused
constructors in TranslationException

(cherry picked from commit 2bd3211ba8)
2016-05-26 13:11:05 +03:00
Alexander Udalov
7131238c86 Add MessageCollector#hasErrors, get rid of MessageSeverityCollector
Also fix duplicated wrapping of a message collector into a message severity
collector (in CLICompiler and in the beginning of doExecute in
K2JVMCompiler/K2JSCompiler)

(cherry picked from commit 3c81bb4bfc)
2016-05-26 13:10:20 +03:00
Alexander Udalov
7ae2ab8437 Move TEST_MODULE_NAME to KotlinTestUtils and change value to "test-module"
This name is more generic and thus can be used everywhere, not only in Java
integration tests

(cherry picked from commit 69343549b7)
2016-05-26 13:06:21 +03:00
Alexander Udalov
4be84d8d4c Remove traces of old compiler plugin architecture
It was retired with the deprecation and subsequent removal of the old KDoc, and
is now unused

(cherry picked from commit 3ca77de924)
2016-05-26 13:03:51 +03:00
Alexander Udalov
caf0184e2f Introduce CompilerConfiguration#getNotNull and getBoolean
To reduce boilerplate at call sites

(cherry picked from commit 8c0f78db50)
2016-05-26 13:03:38 +03:00
Alexander Udalov
6e5dd83b67 Minor, fix warnings and improve style in KotlinToJVMBytecodeCompiler
(cherry picked from commit 81a0fa5f47)
2016-05-26 13:00:35 +03:00
Dmitry Jemerov
90be470172 cleanup after code review
(cherry picked from commit 495a3e9)
2016-05-25 21:09:43 +02:00
Dmitry Jemerov
6c5a3b7734 fix PsiCheckerTestGenerated according to removed "property with backing field" highlighting
(cherry picked from commit b37ac4f)
2016-05-25 21:09:32 +02:00
Dmitry Jemerov
f493a42d27 inherit Kotlin TYPE_PARAMETER from Java TYPE_PARAMETER
#KT-11465 Fixed
(cherry picked from commit 14559bf)
2016-05-25 21:09:26 +02:00
Dmitry Jemerov
95d022c38d specify base color for ANNOTATION and LABEL
#KT-9410 Fixed
(cherry picked from commit 76178c5)
2016-05-25 21:09:21 +02:00
Dmitry Jemerov
4ef75eb110 highlight infix function calls
#KT-6540 Fixed
(cherry picked from commit 49335fa)
2016-05-25 21:09:15 +02:00
Dmitry Jemerov
7f1674ee50 remove CLASS highlight on top of CONSTRUCTOR_CALL for constructor calls
#KT-2919 Fixed
(cherry picked from commit a448af5)
2016-05-25 21:09:10 +02:00
Dmitry Jemerov
a48d4dc9be TypeKindHighlightingVisitor: J2K
(cherry picked from commit e7cb256)
2016-05-25 21:09:04 +02:00
Dmitry Jemerov
ab23195d54 TypeKindHighlightingVisitor: rename to .kt
(cherry picked from commit e07e16a)
2016-05-25 21:08:58 +02:00
Dmitry Jemerov
407405f305 remove PARAMETER highlight on top of INSTANCE_PROPERTY for primary constructor parameters
(cherry picked from commit e9cefd9)
2016-05-25 21:08:52 +02:00
Dmitry Jemerov
abb7c4a13a remove LOCAL_VARIABLE highlight on top of BACKING_FIELD_VARIABLE
(cherry picked from commit b51637d)
2016-05-25 21:08:46 +02:00
Dmitry Jemerov
890ef8c952 VariablesHighlightingVisitor: cleanup after J2K
(cherry picked from commit 4261e4a)
2016-05-25 21:08:41 +02:00
Dmitry Jemerov
6dcdd7f8a3 VariablesHighlightingVisitor: J2K
(cherry picked from commit 77a48c1)
2016-05-25 21:08:34 +02:00
Dmitry Jemerov
6e19b7dc30 VariablesHighlightingVisitor: rename to .kt
(cherry picked from commit 4ddbe98)
2016-05-25 21:08:29 +02:00
Dmitry Jemerov
93b7e84ee8 PropertiesHighlightingVisitor: cleanup after J2K, remove "property has backing field" highlighting, don't layer other highlights
(cherry picked from commit c7cd86f)
2016-05-25 21:08:22 +02:00
Dmitry Jemerov
9542fd3e7c PropertiesHighlightingVisitor: j2K
(cherry picked from commit b76585e)
2016-05-25 21:08:14 +02:00
Dmitry Jemerov
44fbae0530 PropertiesHighlightingVisitor: rename to .kt
(cherry picked from commit 41cd55b)
2016-05-25 21:08:08 +02:00
Dmitry Jemerov
bc0d7cf64e FunctionsHighlightingVisitor: cleanup after J2K, remove overlaid highlighting of function calls
(cherry picked from commit 5512043)
2016-05-25 21:08:03 +02:00
Dmitry Jemerov
e26410a307 FunctionsHighlightingVisitor: J2K
(cherry picked from commit c515740)
2016-05-25 21:07:57 +02:00
Dmitry Jemerov
9da5de9271 FunctionsHighlightingVisitor: rename to .kt
(cherry picked from commit 83b5028)
2016-05-25 21:07:51 +02:00
Dmitry Jemerov
f3fad4ad07 Kotlin with Gradle: generate 'repositories' call, use kotlin_version property
#KT-11841 Fixed
(cherry picked from commit 855ddf9)
2016-05-25 15:44:25 +02:00
Dmitry Jemerov
2898fce39d call BuildManager.clearState(project) in apply() method of Kotlin Compiler Settings configurable
#KT-10255 Fixed
(cherry picked from commit ccbb3d0)
2016-05-25 15:44:03 +02:00
Dmitry Jemerov
522df6f1f8 add icon for Kotlin annotation classes
#KT-11814 Fixed
(cherry picked from commit 1865750)
2016-05-25 15:43:46 +02:00
Dmitry Jemerov
2aae0a1a7d always show current plugin version in update check dialog
#KT-12076 Fixed
(cherry picked from commit 22d3789)
2016-05-25 15:43:27 +02:00
Dmitry Jemerov
4e5e2ae08e "Configure Kotlin plugin updates" is a dumb-aware action
#KT-12075 Fixed
(cherry picked from commit b8eb1da)
2016-05-25 15:43:04 +02:00
Dmitry Jemerov
f86e01fca8 help ID for compiler configuration page
#KT-12110 Fixed
(cherry picked from commit 83798f5)
2016-05-25 15:42:57 +02:00
Dmitry Jemerov
709aa92bd8 remove unnecessary ? from 'serr' live template
#KT-12289 Fixed
(cherry picked from commit e920c35)
2016-05-25 15:42:33 +02:00
Pavel V. Talanov
76bf4a71e7 lightClassUtils: Fix CCE when trying to obtain KtLightTypeParameter
#KT-12259 Fixed
2016-05-25 15:56:53 +03:00
Pavel V. Talanov
4f771fdb55 'const val' are now considered constants by Java in IDEA
#KT-12026 Fixed
2016-05-25 15:56:51 +03:00
Pavel V. Talanov
3b4069c996 Implement getLanguageLevel for FakeFileForLightClass
#KT-12006 Fixed
2016-05-25 15:56:49 +03:00
Pavel V. Talanov
bd1d4034fd Replace usages of blocking lazy to LazyThreadSafetyMode.PUBLICATION in light classes to prevent potential deadlocks 2016-05-25 15:41:51 +03:00
Pavel V. Talanov
18636e6ae7 Fix deadlock: synchronized lazy in KtLightModifierListWithExplicitModifiers 2016-05-25 15:41:50 +03:00
Nikolay Krasko
4d6a69011e Update to idea 2016.1.2 2016-05-24 17:46:20 +03:00
Nikolay Krasko
b1d84bc89b More write action requirement remove
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock
2016-05-24 17:45:25 +03:00
Nikolay Krasko
40509366b8 Don't request write action for ChangeParameterTypeFix because it's based on refactoring
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock
2016-05-24 17:45:25 +03:00
Nikolay Krasko
4de95d5abf Don't request write action for RemoveUnusedFunctionParameterFix because it's based on refactoring (KT-12440)
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock

 #KT-12440 Fixed
2016-05-24 17:45:25 +03:00
Nikolay Krasko
e6fd73c500 Don't request write action for ReplaceExplicitFunctionLiteralParamWithItIntention because it's based on refactoring (KT-12436)
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock

 #KT-12436 Fixed
2016-05-24 17:45:25 +03:00
Mikhail Glukhikh
eccbb499fe Minor refactoring: convert to block body
(cherry picked from commit 9e487a6)
2016-05-24 17:41:45 +03:00
Mikhail Glukhikh
613e5b1968 Convert to block body: when expression with Unit result is now handled as "return needed" #KT-12193 Fixed
(cherry picked from commit fa5e284)
2016-05-24 17:41:42 +03:00
Mikhail Glukhikh
9e10893462 REDUNDANT_OPEN_FOR_INTERFACE warning: reported for open members without implementation #KT-12452 Fixed
(cherry picked from commit 9a69b8b)
2016-05-24 17:41:38 +03:00
Mikhail Glukhikh
dbe179ebde Default modality is abstract for interface. REDUNDANT_MODIFIER_FOR_TARGET applicability reduced #KT-12302 Fixed
(cherry picked from commit e66acd8)
2016-05-24 17:41:34 +03:00
Mikhail Glukhikh
0d129f9d10 KT-12302: ABSTRACT_MODIFIER_IN_INTERFACE warning is removed as obsolete
(cherry picked from commit 93defed)
2016-05-24 17:41:31 +03:00
Pavel V. Talanov
0745f2e4bf REPL UI: fix history pane not showing latest command after command execution 2016-05-24 17:34:34 +03:00
Pavel V. Talanov
81ef3c5684 ProjectRootsUtil: accept directories and jar roots if "includeClassFiles == true" 2016-05-24 15:32:42 +03:00
Pavel V. Talanov
daad2a529c Implement IdeReplCompletionTest to test completion of entities declared in already evaluated lines 2016-05-24 15:32:41 +03:00
Pavel V. Talanov
01717e8f8c Minor: prettify ReplState 2016-05-24 15:32:40 +03:00
Pavel V. Talanov
ff389f99a3 Use ReplState to implement completion in IDE REPL
Consider sucessfully evaluated lines as previous lines when analyzing console file
2016-05-24 15:32:40 +03:00
Pavel V. Talanov
89910692d0 Limit resolve scope when completing in module sources 2016-05-24 15:32:39 +03:00
Pavel V. Talanov
1bd0c54bd6 implicitReceiversUtils: Script descriptors are implicit receivers
This fixes completion in repl
2016-05-24 15:32:38 +03:00
Pavel V. Talanov
2a7c0db825 Move ReplState to frontend 2016-05-24 15:32:37 +03:00
Pavel V. Talanov
c0ca947cbb Minor: Rename KotlinReplTest 2016-05-24 15:32:37 +03:00
Pavel V. Talanov
ac8afae2e0 Fix import resolution in Repl
#KT-11428 Fixed

 Refactor ReplState to be a component
2016-05-24 15:32:36 +03:00
Pavel V. Talanov
e3aa5d183f Minor: ScopeUtils: avoid wrapping lexical scopes several times 2016-05-24 15:32:35 +03:00
Pavel V. Talanov
cc9adf15e1 Refactor: replace LastLineScopeProvider with ReplState, extract FileScopeFactory from FileScopeProviderImpl 2016-05-24 15:32:34 +03:00
Pavel V. Talanov
192a8edbee Refactor: extract resolve related code from ReplInterpreter to CliReplAnalyzerEngine 2016-05-24 15:32:33 +03:00
Mikhail Glukhikh
d40f851e52 Build fix (1.0.3 vs 1.1 difference) 2016-05-24 10:13:15 +03:00
Mikhail Glukhikh
2a9805f77c Only private constructors for sealed / enum classes #KT-12377 Fixed
Also #KT-8497 Fixed
(cherry picked from commit 1a8181b)
2016-05-23 17:50:35 +03:00
Mikhail Glukhikh
eaef198878 Annotation parameters now cannot be mutable #KT-12367 Fixed
(cherry picked from commit cffdce9)
2016-05-23 17:49:29 +03:00
Mikhail Glukhikh
d553327c7e Cleanup: simplify for
(cherry picked from commit ceb4aa7)
2016-05-23 12:27:19 +03:00
Mikhail Glukhikh
366be38453 Cleanup: val can be parameter
(cherry picked from commit ebd57fa)
2016-05-23 12:27:11 +03:00
Alexey Andreev
88cb987558 JS: improve performance of Hashtable-based collections 2016-05-23 12:24:29 +03:00
Alexey Andreev
1dad7f1625 KT-11086 Treat initializer of a companion object as a class initializer 2016-05-23 12:24:29 +03:00
Alexey Andreev
ffbd6b41a7 KT-7424: add test to show that inlining works for anonymous functions 2016-05-23 12:24:29 +03:00
Alexey Andreev
cf01144fa9 KT-8386: pass mutable list to JsInvocation from intrinsic generator, so that inliner had a chance to replace arguments 2016-05-23 12:24:28 +03:00
Pavel V. Talanov
97f2b0df3e Implement "Decompile Kotlin to Java" action
Add this action to "Attach sources" notification panel if present
 #KT-11657 Fixed
2016-05-23 12:04:42 +03:00
Pavel V. Talanov
4fc3c6b41f Minor: typo in changeLog 2016-05-23 11:52:57 +03:00
Alexander Udalov
fcf19b9db4 Remove SAFE_CALL_IN_QUALIFIER diagnostic which was never reported
See UNEXPECTED_SAFE_CALL which is reported instead
2016-05-20 22:40:55 +02:00
Alexander Udalov
38bcacd988 Do not produce trailing space when rendering root package header 2016-05-20 22:40:41 +02:00
Nikolay Krasko
a37e7a782b Restore packing plugin-api module output to plugin 2016-05-20 20:04:05 +03:00
Nikolay Krasko
413ab743cd Check there's no direct usages of asm (org.objectweb.asm) library in project
Such usages should be replaced with asm from idea (org.jetbrains.org.objectweb.asm)
2016-05-20 16:00:54 +03:00
Nikolay Krasko
92c3b1f570 Don't use reference to asm directly. Use asm from Idea instead. 2016-05-20 16:00:54 +03:00
Stanislav Erokhin
543ae45eec Fixed type checking recursive problem.
#KT-11995 Fixed
2016-05-20 09:28:59 +03:00
Pavel V. Talanov
69156f22fb Minor, missed '#' 2016-05-19 22:06:38 +03:00
Pavel V. Talanov
305fe89d30 Update ChangeLog for 1.0.3
Improve ticket number presentation for 1.0.3
2016-05-19 22:03:17 +03:00
Ilya Gorbunov
6be6726b5d Do not deploy anymore kotlin maven plugin tests and build common test utilities to maven central
(cherry picked from commit fda9797dc4)
2016-05-19 18:31:15 +03:00
Ilya Gorbunov
23ce84721c Sanitize escape sequences when verifying maven output
(cherry picked from commit bdf80ec747)
2016-05-19 18:31:15 +03:00
Ilya Gorbunov
5000772ddc Specify kotlin snapshot version in maven plugin integration tests only once.
(cherry picked from commit 7f5b586e3f)
2016-05-19 18:31:15 +03:00
Zalim Bashorov
f197ee5363 JS backend: use ResolvedCall when translate super expression and remove some heuristics when translate receivers; generate right receiver when reference to super of outer class;
(cherry picked from commit 7b1afd4)
2016-05-19 17:37:35 +03:00
Alexey Sedunov
695e20a48e Spring Support: Show autowiring candidates line markers for @Autowired-annotated constructors and constructor parameters
#KT-12120 Fixed
(cherry picked from commit 26be254)
2016-05-19 15:09:20 +03:00
Alexey Sedunov
0ad6a3802b Spring Support: Fixed bean references in factory method calls
#KT-12384 Fixed
(cherry picked from commit 2bd03fe)
2016-05-19 15:09:19 +03:00
Alexey Sedunov
bf1e2bd0dd Spring Support: Fixed "Spring Facet Code Configuration (Kotlin)" inspection description
#KT-12143 Fixed
(cherry picked from commit 417995b)
2016-05-19 15:09:18 +03:00
Alexey Sedunov
20a7f83915 Spring Support: Report object declarations in "Final Kotlin class or function with Spring annotation" inspection
#KT-12148 Fixed
(cherry picked from commit 53b08a1)
2016-05-19 15:09:17 +03:00
Alexey Sedunov
fa2e925ed7 Spring Support: Fixed "Autowired members defined in invalid Spring bean (Kotlin)" inspection description
#KT-12363 Fixed
(cherry picked from commit aaa42e8)
2016-05-19 15:09:16 +03:00
Alexey Sedunov
d262e462bb Spring Support: Implement Spring @Autowired inspection
#KT-12278 Fixed
 #KT-12147 Fixed
 #KT-12366 Fixed
 #KT-12122 Fixed
(cherry picked from commit 85d07e5)
2016-05-19 15:09:15 +03:00
Alexey Sedunov
02fa66fbaa Refactoring: Extract registerWithElementsUnwrapped() function
(cherry picked from commit 36f3d30)
2016-05-19 15:08:14 +03:00
Mikhail Glukhikh
c081d0b9a9 Simplify for: take into account two or more possible local variables for the same loop parameter property
(cherry picked from commit f81192d)
2016-05-19 14:38:48 +03:00
Mikhail Glukhikh
9085175fb3 Simplify for: take into account local property mutability
(cherry picked from commit 9108ab1)
2016-05-19 14:37:52 +03:00
Mikhail Glukhikh
d4b17dbdfa Simplify for: take into account loop parameter nullability
(cherry picked from commit d0fd3de)
2016-05-19 14:37:37 +03:00
Mikhail Glukhikh
bde4b943fe Simplify for now works even if no variables are declared inside loop #KT-12145 Fixed
(cherry picked from commit a56248a)
2016-05-19 14:35:35 +03:00
Mikhail Glukhikh
6b8a54b230 Import as alias with another name is now counted as usage itself #KT-11933 Fixed
(cherry picked from commit c95e11c)
2016-05-19 14:29:45 +03:00
Mikhail Glukhikh
15c09c483e Cleanup: simplify for
(cherry picked from commit 0cf61b1)
2016-05-19 14:29:31 +03:00
Mikhail Glukhikh
4ba9433187 Simplify for intention: now is not active if map / data class properties aren't used in a loop #KT-11716 Fixed
(cherry picked from commit d366da5)
2016-05-19 14:29:14 +03:00
Mikhail Glukhikh
b5d89c549c Can be parameter inspection: usage in secondary constructor is now handled as property use
(cherry picked from commit 3930184)
2016-05-19 14:28:57 +03:00
Mikhail Glukhikh
a796b66e05 Can be parameter inspection: minor test correction
(cherry picked from commit bc7fbdc)
2016-05-19 14:28:42 +03:00
Mikhail Glukhikh
64fa595716 Can be parameter inspection: handle usage in super call; again #KT-10819 Fixed
(cherry picked from commit b026969)
2016-05-19 14:28:27 +03:00
Alexey Andreev
ec78ab5ffa KT-12254 Prevent JsEmptyExpression from getting into initializer JS when compiling code like val x = throw Exception() 2016-05-19 11:42:32 +03:00
Alexey Andreev
b75677cccd KT-8005 Add test to prove the issue is no more reproducible 2016-05-19 11:38:13 +03:00
Alexey Andreev
fdf15407ea KT-8299 Make proper access to private fields in generated methods of data classes 2016-05-19 11:34:51 +03:00
Alexey Tsvetkov
827b74fc06 Minor: add repository path for android test 2016-05-18 15:41:18 +03:00
Alexey Tsvetkov
06c6234561 Keep order of parsed annotations 2016-05-18 15:41:10 +03:00
Alexey Tsvetkov
fdbf6f10e8 Minor: fix downloading sdk in test 2016-05-18 15:40:54 +03:00
Alexey Tsvetkov
38d7a357fc Avoid cache corruption on compile error
#KT-11874 fixed
2016-05-18 15:40:48 +03:00
Alexey Tsvetkov
2b6b7181e1 Fix Application leak in AbstractAnnotationProcessorBoxTest 2016-05-18 15:40:44 +03:00
Alexey Tsvetkov
5117bf1184 Refactoring: rename ClassBuilderMode entry LIGHT_CLASSES_WITH_METADATA->KAPT 2016-05-18 15:39:43 +03:00
Alexey Tsvetkov
e64649fb0a Fix collecting source retention annotations
#KT-12187 fixed
2016-05-18 15:39:38 +03:00
Alexey Tsvetkov
167dd1a927 Add class stubs dir to stub generation task classpath 2016-05-18 15:39:30 +03:00
Alexey Tsvetkov
f9722393dc Serialize error type to proto when generating stubs 2016-05-18 15:39:27 +03:00
Alexey Tsvetkov
bef65e4283 Refactoring: rename javaAptSourceDir->hackAnnotationDir 2016-05-18 15:39:23 +03:00
Alexey Tsvetkov
dcaf6dcef5 Refactoring: rename AnnotatedElementDescriptor->AnnotatedElement 2016-05-18 15:39:19 +03:00
Alexey Tsvetkov
0cc3f4be3d Exclude compiled files when compiling incrementally 2016-05-18 15:39:16 +03:00
Alexey Tsvetkov
5f8220c937 Report compiled classes when generating kapt stubs 2016-05-18 15:39:12 +03:00
Alexey Tsvetkov
385d335042 Include metadata in light classes for kapt 2016-05-18 15:39:09 +03:00
Alexey Tsvetkov
571f31c743 Fix incremental compilation with kapt generating stubs
Changes:
* map incremental property to compile kotlin after java task
* when generating stubs compile kotlin task should not remove or copy classfiles
2016-05-18 15:38:12 +03:00
Alexey Tsvetkov
626e6657d9 Add kapt incremental tests 2016-05-18 15:38:08 +03:00
Alexey Tsvetkov
fb5390a738 Update kapt annotations file incrementally 2016-05-18 15:38:03 +03:00
Alexey Tsvetkov
a4176b0cbb Serialize KotlinAnnotationProvider 2016-05-18 15:37:59 +03:00
Alexey Tsvetkov
d93d4dc38a Minor: extract constant 2016-05-18 15:37:55 +03:00
Alexey Tsvetkov
4f6317694e Refactoring: make AnnotatedElementDescriptor hierarchy sealed 2016-05-18 15:37:51 +03:00
Alexey Tsvetkov
4f6f3879c6 Pass reader as param 2016-05-18 15:37:47 +03:00
Alexey Tsvetkov
eb84b61b69 Make fun local since it's bound to outer function semantics 2016-05-18 15:37:43 +03:00
Alexey Tsvetkov
0e0dbb25b5 Read annotations during construction of KotlinAnnotationsProvider
The rationale is to access kotlinClassesInternal and annotatedKotlinElementsInternal
in any order
2016-05-18 15:37:38 +03:00
Alexey Tsvetkov
dd740b6e6b Minor: add const 2016-05-18 15:37:34 +03:00
Alexey Tsvetkov
7e359015d6 Pass reader in constructor to KotlinAnnotationProvider 2016-05-18 15:37:30 +03:00
Alexey Tsvetkov
1714b1c092 Make annotation collector tests more thorough 2016-05-18 15:37:27 +03:00
Alexey Tsvetkov
cc7f7103be Refactoring: move kapt tests to separate class 2016-05-18 15:37:23 +03:00
Alexey Tsvetkov
4fc118b20a Prevent compile tasks from running when nothing changes
#KT-10932 fixed
2016-05-18 15:37:13 +03:00
Alexey Tsvetkov
5427d81aa7 Minor: use more recent version of gradle in test 2016-05-18 15:33:21 +03:00
Alexey Tsvetkov
b151a5f6e8 Minor: do not print output in assertion message 2016-05-18 15:33:17 +03:00
Alexey Tsvetkov
73afad23b3 Refactoring: extract properties for gradle task's properties access in plugin 2016-05-18 15:33:13 +03:00
Mikhail Glukhikh
d4b27e2649 Unused symbol inspection refactoring: no use of bundled unused.*
(cherry picked from commit 20bff9f)
2016-05-18 14:51:59 +03:00
Mikhail Glukhikh
f1131da000 Overridden functions using default arguments in recursive call are no more considered tail recursive #KT-4285 Fixed
(cherry picked from commit a4ad995)
2016-05-18 14:51:48 +03:00
Mikhail Glukhikh
73a9c1568f Exhaustive when with 'Unit' result now also generates an exception in else branch #KT-12192 Fixed
(cherry picked from commit f35fd32)
2016-05-18 14:51:37 +03:00
Sergey Mashkov
529777fa0b KT-12074 Building Kotlin maven projects using a parent pom will silently fail
integration tests
2016-05-18 14:48:38 +03:00
Sergey Mashkov
79b1764554 Maven: add maven plugin multimodule test 2016-05-18 14:48:38 +03:00
Sergey Mashkov
b80115be88 KT-12074 Building Kotlin maven projects using a parent pom will silently fail
We should consider module's basedir if there is relative source directory specified for the execution
2016-05-18 14:48:38 +03:00
Nikolay Krasko
3d0d002bd6 Remove unused import 2016-05-18 14:18:52 +03:00
Ilya Gorbunov
f1c7b50814 Change memory growth assertions in testKotlinOnlyDaemonMemory: ensure that the maximum of the used memory established after several first builds doesn't raise significantly in the subsequent builds. Current constraint is 500K per 10 builds which gives 50K per build at average.
(cherry picked from commit 5ba8046b48)
2016-05-18 05:49:14 +03:00
Nikolay Krasko
4d35991a1c Remove unused method that causes compatibility problem in update AS plugin 2016-05-17 21:37:22 +03:00
Dmitry Jemerov
c23e8713a4 remove duplicate source root; update testdata according to the appearance of decompiler in dependencies
(cherry picked from commit fd78424)
2016-05-17 19:55:05 +02:00
Sergey Mashkov
518a030fe5 Maven: fix integration tests 2016-05-17 18:18:25 +03:00
Alexey Andreev
2255bde6e1 Minor style and formatting improvements of CallArgumentsTranslator 2016-05-17 10:34:03 +03:00
Alexey Andreev
2c7714e5d9 KT-12305 Fix passing single argument to native vararg function 2016-05-17 10:34:03 +03:00
Mikhail Glukhikh
6c4223ee44 Do not return primary constructor as an analyzable parent, probably #EA-73679 Fixed
(cherry picked from commit 79852e9)
2016-05-16 18:54:56 +03:00
Dmitry Jemerov
55c7c37da4 add "Decompile" button to Kotlin Bytecode toolwindow
(cherry picked from commit 1653f9f)
2016-05-16 16:05:56 +02:00
Alexey Sedunov
0ad6c8cefe Minor: Move META-INF to "resources" source root
(cherry picked from commit 60f23e9)
2016-05-16 14:16:27 +03:00
Alexey Sedunov
4e5e6c0b46 Code Insight: Suppress file reference completion on typing. Disable file references on string literals with escape sequences
(cherry picked from commit 29310b5)
2016-05-16 14:16:10 +03:00
Alexey Sedunov
51c49eba48 Spring Support: Replace light elements bound to line markers with their originals
#KT-12091 Fixed
(cherry picked from commit edb3fd8)
2016-05-16 14:16:00 +03:00
Mikhail Glukhikh
5113cb2935 'Long' type is now stored for 'Long' literal #KT-12267 Fixed
(cherry picked from commit 182ade1)
2016-05-16 11:21:14 +03:00
Mikhail Glukhikh
42ba9cf03f Code cleanup: protected is effectively private
(cherry picked from commit 9bd3be6)
2016-05-16 11:21:01 +03:00
Mikhail Glukhikh
28089434ad Code cleanup: redundant modality (minor)
(cherry picked from commit e31806e)
2016-05-16 11:20:48 +03:00
Mikhail Glukhikh
1726a31c6b Code cleanup: redundant visibility (minor)
(cherry picked from commit 1301d90)
2016-05-16 11:20:36 +03:00
Mikhail Glukhikh
b5523e32e2 Code cleanup: type parameters can have in / out variance
(cherry picked from commit 733f3e8)
2016-05-16 11:20:21 +03:00
Yaroslav Ulanovych
3e9da49c2f Fix KT-11839 maven goal to execute kotlin script 2016-05-15 16:12:43 +02:00
Natalia Ukhorskaya
aaae96bba6 Debugger: do not use forceResolveScope for codeFragments in completion and AutoImportFix.
#KT-12137 Fixed
2016-05-13 16:48:53 +03:00
Natalia Ukhorskaya
c452dd0491 Update icon for "New -> Kotlin Activity" Action
Assets were taken from DSGN-2829
2016-05-13 16:45:34 +03:00
Mikhail Glukhikh
93ed1705b9 Unused symbol: take into account possible JUnit static method annotations #KT-11320 Fixed
(cherry picked from commit 6da8ab7)
2016-05-13 16:42:05 +03:00
Mikhail Glukhikh
28c7244901 Unused symbol: secondary constructors are also under analysis #KT-10812 Fixed
(cherry picked from commit 8920e67)
2016-05-13 16:41:51 +03:00
Alexander Udalov
0f88682587 Add empty source jars to kotlin-build-common Maven artifacts
Maven Central requires all artifacts to have sources and javadocs
2016-05-12 23:47:27 +03:00
Valentin Kipyatkov
c5b1256960 KT-12080 Move parameter names higher up in code completion
#KT-12080 Fixed
(cherry picked from commit dd16eb1)
2016-05-12 22:24:41 +03:00
Ilya Gorbunov
c79731dbee Add tests for deserialization of collections persisted with kotlin 1.0
(cherry picked from commit 15dcd3d)
2016-05-12 21:35:06 +03:00
Ilya Gorbunov
4ffa2eaf39 Fix serialVersionUID for EmptyList after introducing RandomAccess interface. #KT-10794
(cherry picked from commit 6a07d5f)
2016-05-12 21:35:01 +03:00
Dmitry Jemerov
b3ccdbc626 specify github revision number in build parameters
(cherry picked from commit 11c0b30)
2016-05-12 17:00:23 +02:00
Nikolay Krasko
3200a17c51 Formatter: Don't enforce empty line between secondary constructors without body (KT-12175)
#KT-12175 Fixed
2016-05-12 17:35:50 +03:00
Nikolay Krasko
7be9805c3d Use left bound element types to tight empty delegation contructor call to declaration
CONSTRUCTOR_DELEGATION_CALL and CONSTRUCTOR_DELEGATION_REFERENCE types were modified.
2016-05-12 17:35:50 +03:00
Nikolay Krasko
d214e347ea Make code fragments files non-physical with event system disabled (KT-12232)
Fix "File copy should be non-physical and non-event-system-enabled! Language=Language:
kotlin; file=JetFile: fragment.kt of class org.jetbrains.kotlin.psi.KtExpressionCodeFragment" assert.

Inspired by Java fragment files

 #KT-12232 Fixed
2016-05-12 17:35:49 +03:00
Mikhael Bogdanov
395d359c7f Disabled dexInProcess and incremental compilation in test android module, explicitly set Xmx for dex process cause of teamcity memory allocation fails
(cherry picked from commit af2cf71)
2016-05-12 16:22:07 +03:00
Mikhael Bogdanov
046bb7348c Added support for 'JVM.INHERIT_MULTIFILE_PARTS' flag in android tests
(cherry picked from commit 1d2a83e)
2016-05-12 16:22:06 +03:00
Mikhael Bogdanov
3ee5272011 Added support for reflection tests on android
(cherry picked from commit ed60cf8)
2016-05-12 16:22:04 +03:00
Mikhael Bogdanov
e8e33b2636 Fix for KT-12125: Wrong increment/decrement on Byte/Char/Short.MAX_VALUE/MIN_VALUE
#KT-12125 Fixed
(cherry picked from commit d6a64af)
2016-05-12 16:22:01 +03:00
Mikhael Bogdanov
47bb721097 Support new tests on android, disabled not applicable ones
(cherry picked from commit ca31ce8)
2016-05-12 16:21:59 +03:00
Nikolay Krasko
ed7197e519 No more patched jflex 1.4.3 in idea repository. Download artifact from maven.
02c7c658e8
2016-05-12 13:53:50 +03:00
Nikolay Krasko
c3a9007ac3 Make downloading idea sources optional 2016-05-12 13:53:49 +03:00
Alexey Sedunov
343192c2ae Spring Support: Implement bean references in @Qualifier annotations
#KT-12092 Fixed
(cherry picked from commit df46a8c)
2016-05-12 13:09:47 +03:00
Alexey Sedunov
d2fc64ff56 Code Insight: Support file path references inside of Kotlin string literals
#KT-11704 Fixed
(cherry picked from commit 4a65b1c)
2016-05-12 13:09:45 +03:00
Alexey Sedunov
ee5b01be5c Spring Support: Support "Autowired members defined in invalid Spring bean" inspection on Kotlin declarations
#KT-12079 Fixed
(cherry picked from commit 44f565e)
2016-05-12 13:09:43 +03:00
Alexey Sedunov
d062b478bd Change Signature: Do not force substitution of error types
#EA-81021 Fixed
(cherry picked from commit d4aa179)
2016-05-12 13:09:42 +03:00
Valentin Kipyatkov
761d171de1 Added missing test data
(cherry picked from commit 0c367c6)
2016-05-11 20:16:38 +03:00
Valentin Kipyatkov
c3d4772e1e Do not use setting specifyFieldTypeByDefault for locals
(cherry picked from commit 9622231)
2016-05-11 20:16:31 +03:00
Valentin Kipyatkov
2245fdc9d5 Better code
(cherry picked from commit bf9e4a3)
2016-05-11 20:16:25 +03:00
Valentin Kipyatkov
2f7e4b0e2a Moved local method out
(cherry picked from commit 07c961d)
2016-05-11 20:16:19 +03:00
Valentin Kipyatkov
89a54a9982 KT-11952 J2K: Assertion failed in PropertyDetectionCache.get on conversion of access to Java constant of anonymous type
#KT-11952 Fixed
(cherry picked from commit bdd425c)
2016-05-11 20:16:12 +03:00
Valentin Kipyatkov
c88d6150e1 Fixed test data
(cherry picked from commit de02b56)
2016-05-11 20:16:06 +03:00
Valentin Kipyatkov
968d4ce680 Minor changes after code review
(cherry picked from commit 70a5540)
2016-05-11 20:15:59 +03:00
Valentin Kipyatkov
a35f80c6c1 KT-4727 J2K: Convert Java code copied from browser or other sources
#KT-4727 Fixed
(cherry picked from commit cca3237)
2016-05-11 20:15:53 +03:00
Valentin Kipyatkov
9932fcfdb8 Renamed class
(cherry picked from commit 4cbb098)
2016-05-11 20:15:46 +03:00
Valentin Kipyatkov
83edb851e3 Support of KT-11255 Support Move Element Left/Right actions for Kotlin (except for enum entries)
#KT-11255 Fixed
(cherry picked from commit 0720794)
2016-05-11 20:15:37 +03:00
Valentin Kipyatkov
9e10127828 Refactored AbstractCodeMoverTest
(cherry picked from commit 7e99a6b)
2016-05-11 20:15:29 +03:00
Valentin Kipyatkov
a0a6d1ee85 Restored lost tests
(cherry picked from commit 06db49b)
2016-05-11 20:15:23 +03:00
Valentin Kipyatkov
926634ab10 Converted to Kotlin
(cherry picked from commit b6301e8)
2016-05-11 20:15:15 +03:00
Valentin Kipyatkov
31d0e08515 KT-11974 Invert if-condition intention loses comments
#KT-11974 Fixed
(cherry picked from commit 8da5af3)
2016-05-11 20:15:05 +03:00
Mikhail Glukhikh
4437222d01 Unused symbol inspection: properties declared in primary constructor are now checked on 'Used' annotations #KT-11120 Fixed
(cherry picked from commit be2b37d)
2016-05-11 19:41:06 +03:00
Mikhail Glukhikh
0d1050d395 Do not try to make object's containing class abstract #KT-11466 Fixed
(cherry picked from commit a098977)
2016-05-11 19:40:55 +03:00
Alexander Udalov
031c1353b7 Update ChangeLog for 1.0.2 2016-05-11 12:20:27 +03:00
Alexey Sedunov
dc99fee4b4 Spring Support: Replace accessor name with property name when processing usages in Kotlin files
#KT-11880 Fixed
(cherry picked from commit 12987de)
2016-05-11 12:03:36 +03:00
Alexey Andreev
302ef0adac KT-11996 Fix issue with referencing outer class in case of inner class constructors and members/properties. Fix issue with referencing outer classes from secondary constructors. Remove unnecessary tests. 2016-05-10 17:56:43 +03:00
Alexey Andreev
37c14137e2 KT-11823 Generate proper argument for closure constructor for this as a free variable. Give some explanation for function that generates closure arguments as well as a clear name. Give explanation to some code in UsageTracker.isSingletonReceiver, augmented by a test case. 2016-05-10 17:55:57 +03:00
Nikolay Krasko
388a323105 Remove write action from refactoring start (KT-11486)
#KT-11486 Fixed
2016-05-10 16:13:35 +03:00
Nikolay Krasko
e9716ee88d Make KtLightModifierList behave like light element and check it in tests 2016-05-10 16:12:15 +03:00
Dmitry Jemerov
25734f92be move KDoc-related logic shared between IDEA and Dokka to ide-common module
(cherry picked from commit 42ba143)
2016-05-10 15:03:03 +02:00
Valentin Kipyatkov
32ca38de8c Fixed dialog with suggestion to process external code shown even when there is nothing to process
(cherry picked from commit 7b1bf4c)
2016-05-10 15:02:15 +03:00
Mikhail Glukhikh
832497773b Can be parameter inspection: usages in all functions are now handled as property usage
(cherry picked from commit 48ba63f)
2016-05-10 13:43:36 +03:00
Ilya Gorbunov
c1153eda3a Document functions which return set or map preserving the order of elements/entries.
#KT-11632 Fixed

(cherry picked from commit d646afabb2)
2016-05-08 03:28:56 +03:00
Dmitry Jemerov
7c3e8ae54a generate correct HTML for code blocks
(cherry picked from commit b5e5c6f)
2016-05-06 22:19:49 +02:00
Dmitry Jemerov
0b93ac51b5 support @receiver KDoc tag; somewhat more precise tag name completion
(cherry picked from commit 94c2414)
2016-05-06 22:18:43 +02:00
Dmitry Jemerov
5fd5be6e1b KDocKnownTag: J2K
(cherry picked from commit 3b57b78)
2016-05-06 22:18:34 +02:00
Dmitry Jemerov
a4ea7d3b2e KDocKnownTag: rename to .kt
(cherry picked from commit 6935cfe)
2016-05-06 22:18:26 +02:00
Dmitry Jemerov
2ba6808559 don't trim whitespace when converting whitespace to HTML
#KT-10998 Fixed
(cherry picked from commit 992817e)
2016-05-06 22:18:09 +02:00
Dmitry Jemerov
156ca8227b preserve leading indentation in KDoc code blocks
#KT-9933 Fixed
(cherry picked from commit d7b1526)
2016-05-06 22:17:36 +02:00
Dmitry Jemerov
077ec0289d integrate Ingo Kegel's Dokka fix for rendering standalone * and _ characters
(cherry picked from commit 721629f)
2016-05-06 22:17:24 +02:00
Dmitry Jemerov
b6b924d4e1 render markdown inside link texts
#KT-11791 Fixed
(cherry picked from commit 6cbf1de)
2016-05-06 22:16:59 +02:00
Dmitry Jemerov
16c391f9bd resolve references from @param to type parameters of functions
#KT-12001 Fixed
(cherry picked from commit c967cc8)
2016-05-06 22:13:33 +02:00
Kirill Rakhman
70e567a09d Add quickfix for UNUSED_LAMBDA_EXPRESSION (#867)
Fixes #KT-9757
(cherry picked from commit 97c3c63)
2016-05-06 17:51:28 +02:00
Kirill
294f5cf98d Don't mark magic Serializable methods as unused
Fixes #KT-10635
(cherry picked from commit 5b6a8dc)
2016-05-06 16:23:55 +02:00
Ilya Chernikov
3e9f302cf6 minor: fix after review 2016-05-06 12:58:51 +02:00
Ilya Chernikov
a450fbb18a minor: Make term "canceled" uniformly spelled in identifiers and strings in the daemon 2016-05-06 12:58:50 +02:00
Ilya Chernikov
e634881f96 Implement graceful connection failure behavior on daemon connect and cancellation check
Should fix (or actually - behave gracefully on) #EA-74003, #EA-74493, #EA-76032, #EA-76529, #EA-81295
Tests added
2016-05-06 12:58:49 +02:00
Ilya Chernikov
ad71747116 minor: Switch to simpler descending sort, reduce dependency 2016-05-06 12:58:48 +02:00
Nikolay Chashnikov
1f0b71abac run configuration: use default logic of creating new run configurations to avoid sharing RunConfigurationModule instances between different run configurations (KT-12204) (#869)
(cherry picked from commit 551aa70)
2016-05-06 11:02:58 +02:00
Valentin Kipyatkov
3a1e15f5c2 KT-12040 "Replace when with if" produce invalid code for first entry which has comment
#KT-12040 Fixed
(cherry picked from commit c45bee5)
2016-05-05 19:02:31 +03:00
Valentin Kipyatkov
44596b3723 KT-12138 Do not show "::error" in smart completion when any function type accepting one argument is expected
(actually made them lowest priority)

 #KT-12138 Fixed
(cherry picked from commit 16c38a2)
2016-05-05 19:02:31 +03:00
Valentin Kipyatkov
4e30143f51 Minor
(cherry picked from commit 81e4114)
2016-05-05 19:02:30 +03:00
Valentin Kipyatkov
db5a0fe4dc KT-12150 Smart completion suggests to compare non-nullable with null
#KT-12150 Fixed
(cherry picked from commit 941b415)
2016-05-05 19:02:30 +03:00
Valentin Kipyatkov
1b1306d372 No explicit runWriteAction required
(cherry picked from commit 40900b0)
2016-05-05 19:02:30 +03:00
Valentin Kipyatkov
ac2ab49e8f KT-12103 Smart completion for nested SAM-adapter produces short unresolved name
#KT-12103 Fixed
(cherry picked from commit 0769c54)
2016-05-05 19:02:29 +03:00
Valentin Kipyatkov
5c61b5dd17 Minor changes on code review
(cherry picked from commit 74b41cf)
2016-05-05 19:02:29 +03:00
Valentin Kipyatkov
5941f40444 KT-12045 J2K: creating Object() instance could be converted to Any()
#KT-12045 Fixed
(cherry picked from commit 92af610)
2016-05-05 19:02:28 +03:00
Valentin Kipyatkov
bca15e24ce KT-12054 J2K generates obj is Type<Any> instead of obj is Type<*>
#KT-12054 Fixed
(cherry picked from commit 76e067c)
2016-05-05 19:02:28 +03:00
Valentin Kipyatkov
81a15d9327 KT-12039 Convert Java to Kotlin -- static imports are imported as Class.CONST (missing .Companion)
#KT-12039 Fixed
(cherry picked from commit a8eef5e)
2016-05-05 19:02:28 +03:00
Valentin Kipyatkov
b01fe77ba2 Minor simplification
(cherry picked from commit a80d36e)
2016-05-05 19:02:27 +03:00
Valentin Kipyatkov
f99e01018e Moved import conversion out of "ast" package
(cherry picked from commit 569483a)
2016-05-05 19:02:27 +03:00
Valentin Kipyatkov
393befe4fa Do not duplicate list of default imports
(cherry picked from commit 83442db)
2016-05-05 19:02:27 +03:00
Valentin Kipyatkov
4d9d11cbfb Extracted methods
(cherry picked from commit 08a37b3)
2016-05-05 19:02:26 +03:00
Valentin Kipyatkov
c8356fb261 KT-12046 Java to Kotlin dangerous conversion (recursive property set)
#KT-12046 Fixed
(cherry picked from commit a9eadcb)
2016-05-05 19:02:26 +03:00
Valentin Kipyatkov
2938092be6 Minor
(cherry picked from commit 9c0e120)
2016-05-05 19:02:26 +03:00
Valentin Kipyatkov
ed099857c0 KT-10770 IDEA cannot keep import if a type is only referenced by kdoc.
#KT-10770 Fixed
(cherry picked from commit e1d8c72)
2016-05-05 19:02:25 +03:00
Valentin Kipyatkov
e5b4eb5c19 KT-12069 Specify language for all Kotlin code inspections
#KT-12069 Fixed
(cherry picked from commit cd2161b)
2016-05-05 19:02:25 +03:00
Valentin Kipyatkov
3239c191fb Highlighting of redundant semicolons
#KT-5010 Fixed
(cherry picked from commit 306edef)
2016-05-05 19:02:25 +03:00
Valentin Kipyatkov
6a6bff90e8 ConvertPropertyInitializerToGetterIntention to not be available inside lambda initializer
(cherry picked from commit 77033f5)
2016-05-05 19:02:24 +03:00
Valentin Kipyatkov
0a410dbbf2 Minor change on code review
(cherry picked from commit a51fe9a)
2016-05-05 19:02:24 +03:00
Valentin Kipyatkov
ea6ddd7aa6 Dropped redundant code which was required for lambda signature completion when the syntax was different
#KT-12033 Fixed
(cherry picked from commit 45d460a)
2016-05-05 19:02:23 +03:00
Valentin Kipyatkov
23cfb1d9f9 KT-12068 Special completion item for "[]" get-operator access
#KT-12068 Fixed
(cherry picked from commit 40022e8)
2016-05-05 19:02:23 +03:00
Valentin Kipyatkov
9295c87845 Completion to complete non-imported classes on the first invocation
#KT-8527 Fixed
(cherry picked from commit deb75b3)
2016-05-05 19:02:23 +03:00
Valentin Kipyatkov
cd3a11c9e2 KT-11680 Code completion of label for existing return with value inserts redundant whitespace
#KT-11680 Fixed
 #KT-9993 Fixed
(cherry picked from commit f0dd70d)
2016-05-05 19:02:22 +03:00
Nikolay Krasko
99f31b66c3 Description for AddJvmOverloadsIntention 2016-05-05 17:32:36 +03:00
Nikolay Krasko
d9c3ef655e Enable JDK 8 level in some tests for correct convert for method references 2016-05-05 17:32:29 +03:00
Alexey Andreev
a9220dd4d8 JS/RTTI: minor refactoring of expandInCalls 2016-05-05 17:29:16 +03:00
Alexey Andreev
6e75886a3d JS/RTTI: if it's known that T <: X & Y, where T is non-reified type variable, for each a is T check that a is X && a is Y 2016-05-05 17:29:15 +03:00
Alexey Andreev
fbab016ba7 JS/RTTI: in expressions like a as T when inferred type for a is S, where S <: T, don't generate type checking 2016-05-05 17:29:14 +03:00
Alexey Andreev
d6d2189344 JS/RTTI. Fix runtime checking against kotlin.CharSequence 2016-05-05 17:29:13 +03:00
Alexey Andreev
c6e18ef0d5 JS/RTTI: fix withInlineTurnedOff test 2016-05-05 17:29:12 +03:00
Alexey Andreev
ab3fca5b64 JS/RTTI: fix compiler crashing when translating expressions like (continue as T) 2016-05-05 17:29:11 +03:00
Zalim Bashorov
aedd3f2d53 JS/RTTI. Fix build and tests 2016-05-05 17:29:10 +03:00
Alexey Tsvetkov
01a32f6318 JS/RTTI. Fix run-time type checking against Comparable 2016-05-05 17:29:09 +03:00
Alexey Tsvetkov
09c5214181 JS/RTTI. Fix RegExpMatch 2016-05-05 17:29:09 +03:00
Alexey Tsvetkov
c243a99947 JS/RTTI: removed Kotlin.orNull(Kotlin.isAny) optimization 2016-05-05 17:29:08 +03:00
Alexey Tsvetkov
88ab4724e4 JS/RTTI: added another cast to reified test 2016-05-05 17:29:07 +03:00
Alexey Tsvetkov
e975106995 JS/RTTI: Added cast to Array test 2016-05-05 17:29:05 +03:00
Alexey Tsvetkov
f44891c367 JS/RTTI: simplify cast to Any test 2016-05-05 17:29:04 +03:00
Alexey Tsvetkov
e940963dd2 JS/RTTI: fixed cast to generic type parameter with upper bound different than Any 2016-05-05 17:29:03 +03:00
Alexey Tsvetkov
eed4b1f2df JS/RTTI: (minor) fixed typo 2016-05-05 17:29:03 +03:00
Alexey Tsvetkov
b8179d9548 JS/RTTI: (minor) escape code fragments in comments 2016-05-05 17:29:02 +03:00
Alexey Tsvetkov
a7b06aabaf JS/RTTI: fix nullability check 2016-05-05 17:29:01 +03:00
Alexey Tsvetkov
0677294afa JS/RTTI: use Array.isArray to check array instance 2016-05-05 17:29:01 +03:00
Alexey Tsvetkov
aaf18f7b7c JS/RTTI: use typeof f === 'function' to check function instance 2016-05-05 17:29:00 +03:00
Alexey Tsvetkov
42baad25fd JS/RTTI: cast to generic type parameter as to Any 2016-05-05 17:28:59 +03:00
Alexey Tsvetkov
2122a30d41 JS/RTTI: fix cast to Any 2016-05-05 17:28:58 +03:00
Alexey Tsvetkov
ad6638da29 JS/RTTI: support safe casts 2016-05-05 17:28:58 +03:00
Alexey Tsvetkov
2aad39e41c JS/RTTI: support unsafe casts
#KT-2670 fixed
2016-05-05 17:28:57 +03:00
Alexey Tsvetkov
5af22ecd3b JS/RTTI: made cast test generated 2016-05-05 17:28:56 +03:00
Alexey Tsvetkov
d7625532be JS/RTTI: test that reified is-check works when inline turned off 2016-05-05 17:28:56 +03:00
Alexey Tsvetkov
73e53d8cf0 JS/RTTI: fixed double testing for null for reified 2016-05-05 17:28:55 +03:00
Alexey Tsvetkov
56191cf988 JS/RTTI: avoid possible side-effect for is-check on nullable type
#KT-7038 fixed
2016-05-05 17:28:54 +03:00
Alexey Tsvetkov
fff9783879 JS/RTTI: use generation for rtti test 2016-05-05 17:28:53 +03:00
Alexey Tsvetkov
e06eb6976e JS/RTTI: fixed is-check on nullable reified parameters
#KT-7016 fixed
    #KT-8012 fixed
2016-05-05 17:28:53 +03:00
Alexander Udalov
e8a89c1060 Revert "Minor, move SpecialNames.isSafeIdentifier check a little earlier"
This reverts commit 6858ec13de.

It turns out, this re-introduces an AssertionError at ClassId.<init> ("Class
name must not be root") when LazyJavaPackageScope#getContributedClassifier is
called during SAM constructor resolution below in
LazyJavaPackageScope#computeNonDeclaredFunctions, which was overlooked at the
time the commit was pushed
2016-05-04 17:45:18 +03:00
Mikhael Bogdanov
780fef14bf 'bytecodeText' test for synthetic accessor generic signature converted to 'writeSignature' test
(cherry picked from commit cd6b709)
2016-05-04 17:19:22 +03:00
Mikhael Bogdanov
a9bcde41d1 Fix for KT-12127: Undeclared type variable on delegated property backing field
#KT-12127 Fixed
(cherry picked from commit ee7bbbf)
2016-05-04 17:19:20 +03:00
Mikhael Bogdanov
f54ce18402 Update android test dependency to android 4.4.2 cause of missed test result problem on 4.1.2
(cherry picked from commit 09509b6)
2016-05-03 09:20:14 +03:00
Michael Bogdanov
d3baf847bf Support test with self imports, kotlin multifile tests
(cherry picked from commit e2ae2f3)
2016-05-03 09:20:12 +03:00
Michael Bogdanov
1f24f8ef75 Fix for "adb: Syntax error: ")" unexpected"
(cherry picked from commit 0f110b0)
2016-05-03 09:20:03 +03:00
Michael Bogdanov
3fbee04549 Ability to run tests via adb
(cherry picked from commit adda3ef)
2016-05-03 09:20:01 +03:00
Michael Bogdanov
5203f0f852 Android tests exclusion
(cherry picked from commit d4a7e36)
2016-05-03 09:20:00 +03:00
Michael Bogdanov
99d3ae396d Switch to gradle from gradle wrapper, use https instead of http to download files
(cherry picked from commit 896429a)
2016-05-03 09:19:58 +03:00
Michael Bogdanov
a62fac14a9 Code clean
(cherry picked from commit 309348c)
2016-05-03 09:19:56 +03:00
Michael Bogdanov
5fb178426c Wait some time before emulator stop, diabled emulator log redirection (otherise result reports would be inconsistent)
~emulator
(cherry picked from commit 7d77f91)
2016-05-03 09:19:54 +03:00
Michael Bogdanov
3093d958b3 More logging on adb server start
(cherry picked from commit be1cb40)
2016-05-03 09:19:52 +03:00
Michael Bogdanov
a3f7e0c769 Support WITH_REFLECT and 'Class.forName' android tests
(cherry picked from commit db6c72d)
2016-05-03 09:19:49 +03:00
Michael Bogdanov
f3b9ba2f06 Wait until emulator booted
(cherry picked from commit ed3d874)
2016-05-03 09:19:33 +03:00
Michael Bogdanov
e15b36e141 Use gradle build instead of ant one for android test module
(cherry picked from commit 2992e23)
2016-05-03 09:19:31 +03:00
Michael Bogdanov
efb6bbde69 Ecluded test from compilation: android report bad class file cause of missed generic parameter definition
(cherry picked from commit 3ad8b5b)
2016-05-03 09:19:29 +03:00
Michael Bogdanov
65ddf8a2c9 Temporary disable lint checks cause of problem with implicit 'stream' import
(cherry picked from commit 0abdc75)
2016-05-03 09:19:27 +03:00
Michael Bogdanov
eab688f5c1 Added support for tests with 'JvmName' annotation
(cherry picked from commit 3cebb7c)
2016-05-03 09:19:25 +03:00
Michael Bogdanov
bf77b1dc40 Call 'invokeBox' with proper class instance (not try to find it via reflection)
(cherry picked from commit 11e42c6)
2016-05-03 09:19:24 +03:00
Michael Bogdanov
7d7aa9ff05 Added gradle android test project
(cherry picked from commit 1eb3d2e)
2016-05-03 09:19:22 +03:00
Michael Bogdanov
21a21c55b7 Writing android sdk to local.properties
(cherry picked from commit 1f84ff7)
2016-05-03 09:19:20 +03:00
Ilya Gorbunov
5f4d716f5e Handle special cases of drop, take, takeLast when it is known in advance that the result is a single-item list. #KT-9990
(cherry picked from commit 249d08a66e)
2016-04-30 05:33:21 +03:00
Ilya Gorbunov
64f7009480 Change evaluation test data not to encounter special implementation of single element list.
(cherry picked from commit d70b46fd37)
2016-04-30 05:33:16 +03:00
Ilya Gorbunov
2a7814b2bb Optimize operations to return special collection implementations when result is empty or has single element.
#KT-9990

(cherry picked from commit a665b2183c)
2016-04-30 05:33:09 +03:00
Ilya Gorbunov
40e901f46e Remove runtime specialization in inline last and lastOrNull to prevent double inlining of predicate body.
(cherry picked from commit 2d12ed68c8)
2016-04-30 05:33:03 +03:00
Ilya Gorbunov
3b187abbe1 Do not use indexed access for lists not supporting RandomAccess
Add RandomAccess specialization.

(cherry picked from commit 09c1ff1233)
2016-04-30 05:32:57 +03:00
Ilya Gorbunov
3b9dcc11b2 Use list iterators instead of indexed access in operations on lists taking a lambda.
Related to #KT-9607

(cherry picked from commit f4f82656f7)
2016-04-30 05:32:51 +03:00
Nikolay Krasko
3b29421f6f Do not request write action for MoveDeclarationToSeparateFileIntention (EA-81511)
There's nothing but delegation to move refactoring. This started to fail in br146 because of this commit:
334772b7a8
2016-04-29 21:50:35 +03:00
Nikolay Krasko
9c9b64efea Revert another class of ComparisonFailure
Idea throws this class but not org.junit.ComparisonFailure
2016-04-29 21:50:34 +03:00
Nikolay Krasko
51de23f66f Fix path replacement in reference tests
The commit fixes ReferenceResolveInJavaTestGenerated$BinaryAndSource.testFileFacade.
2016-04-29 21:50:33 +03:00
Zalim Bashorov
97c1fedf38 Fix NoSuchMethodError when try to access in test to internal member from production for gradle projects imported into IDEA 16 or higher
#KT-11993 Fixed
(cherry picked from commit ed0fa2c)
2016-04-29 18:27:06 +03:00
Alexander Udalov
6e7388737a Do not locate running build in override.version
A build was finding itself with such request every time which made the version
override pointless
2016-04-29 17:21:06 +03:00
Alexander Udalov
2c77a23943 Update ChangeLog for 1.0.2 2016-04-29 15:44:41 +03:00
Alexander Udalov
6858ec13de Minor, move SpecialNames.isSafeIdentifier check a little earlier 2016-04-29 15:32:31 +03:00
Alexander Udalov
c6194d925c Minor optimization of lookup tracker records 2016-04-29 15:32:29 +03:00
Alexander Udalov
853200aa98 Combine Java package scope and Kotlin scopes in JvmPackageScope
Use it in LazyJavaPackageFragment#scope instead of a weird lazy chained scope.
Also move lookup tracker records to it, to prevent them from being written in
each package scope individually (this was hurting performance)
2016-04-29 15:32:27 +03:00
Alexander Udalov
9f63317900 Optimize class lookups in DeserializedPackageMemberScope
Do not try to load classes (and litter in ClassDeserializer#classes cache with
unsuccessful requests) which the deserialized scope knows nothing about. This
is possible because deserialized scopes have the full list of their class names
2016-04-29 15:32:24 +03:00
Kirill Rakhman
ce84e168d1 Implement Intention to add @JvmOverloads
Fixes #KT-11523
(cherry picked from commit 8e5481b)
2016-04-29 13:39:16 +02:00
Kirill Rakhman
d506346db3 Add quickfix to make referenced primary constructor parameter a property
Fixes #KT-12089
(cherry picked from commit f309920)
2016-04-29 12:16:09 +02:00
Kirill Rakhman
17cfee37b9 Quick fix for SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE
Fixes #KT-11876
(cherry picked from commit 1c5322b)
2016-04-29 11:54:12 +02:00
Mikhail Glukhikh
3cd9bb9f86 IDEA: unnecessary 'val's removed from constructors
(cherry picked from commit 84a3f72)
2016-04-29 09:19:02 +03:00
Mikhail Glukhikh
0ff15c38a3 Core & compiler: unnecessary 'val's removed from constructors
(cherry picked from commit 5a66ef2)
2016-04-29 09:18:51 +03:00
Mikhail Glukhikh
831469f4d9 Android: unnecessary 'val's removed from constructors
(cherry picked from commit ee46c34)
2016-04-29 09:18:42 +03:00
Mikhail Glukhikh
f7b212b449 UAST: unnecessary 'val' removed from constructor
(cherry picked from commit 5c9d6fd)
2016-04-29 09:18:33 +03:00
Mikhail Glukhikh
3d3b061c31 JS: unnecessary 'val' removed from constructor
(cherry picked from commit a4be89e)
2016-04-29 09:10:38 +03:00
Kirill Rakhman
6f874e6dbc Add intrinsic for KCallable.name property Fixes #KT-11531 2016-04-28 23:04:06 +03:00
Ilya Gorbunov
f60cc2a2f7 reified assertFailsWith available in kotlin-test for JS
#KT-11346

(cherry picked from commit 4b533b297e)
2016-04-28 21:11:04 +03:00
Ilya Gorbunov
f9bc1b8c3b Make stdlib functions dependent on reified is checks available in JS.
#KT-11346 Fixed

(cherry picked from commit 409094f0f7)
2016-04-28 21:11:03 +03:00
Ilya Gorbunov
73be96e304 JS: Make AbstractList.size pure abstract.
#KT-7228 Fixed

(cherry picked from commit a5fd95c7d9)
2016-04-28 21:11:02 +03:00
Nikolay Krasko
42ec16c32f Check that injection with annotation on parameter doesn't trigger not-stubbed psi 2016-04-28 16:22:38 +03:00
Nikolay Krasko
247e435752 Don't analyze function body if only parameter analyze is requested 2016-04-28 16:22:38 +03:00
Nikolay Krasko
fd21f5ee80 Missing new line in error message (KT-12070)
#KT-12070 Fixed
2016-04-28 16:22:37 +03:00
Nikolay Krasko
0644a54883 Use partial resolve for annotation search 2016-04-28 16:22:36 +03:00
Nikolay Krasko
6117b822ab Use kotlin specific methods for pattern creation 2016-04-28 16:22:35 +03:00
Nikolay Krasko
6270ed81bf Refactoring: use language injection in ResolveElementCache.kt 2016-04-28 16:22:35 +03:00
Nikolay Krasko
249180f9f0 Refactoring: return injection tests to single test-class 2016-04-28 16:22:34 +03:00
Nikolay Krasko
93f8c711af Enable bootstrapping against 1.0.3 in 1.0.3 branch
This also should enable version auto-increment.
2016-04-28 13:41:14 +03:00
Kirill Rakhman
1f5a861402 Add quickfix to add 'toString' (#866)
Fixes #KT-12121
(cherry picked from commit 2629d23)
2016-04-28 11:31:29 +02:00
Nikolay Krasko
1a2c67cb4b Test data modification: Don't compute compiled bytecode for same expression twice
Result of dc9fa6d9ac commit.
Previously computation were saved into the map that were invalidated by the computation. Now map is recreated after computation and result is saved into it.
2016-04-28 00:14:02 +03:00
Sergey Mashkov
45daf1f42b Maven: rebase to master 2016-04-27 22:10:51 +03:00
Sergey Mashkov
65985b184f Maven: review 2016-04-27 22:10:50 +03:00
Sergey Mashkov
ec113ac691 Maven: convert to Kotlin 2016-04-27 22:10:50 +03:00
Sergey Mashkov
31a57190e0 Maven: reorganize code: move classes across packages 2016-04-27 22:10:49 +03:00
Sergey Mashkov
adad2ef5fe Maven: inspection maven plugin and ide plugin should have the same version 2016-04-27 22:10:49 +03:00
Sergey Mashkov
5e8f91bd2a Maven: versions inspection: kotlin plugin and library should have the same version 2016-04-27 22:10:49 +03:00
Sergey Mashkov
b49693f30f Maven: kotlin-maven-plugin configuration source dirs completion 2016-04-27 22:10:48 +03:00
Sergey Mashkov
5f826b7ff4 KT-11743 Intention to replace kotlin-test with kotlin-test-junit 2016-04-27 22:10:48 +03:00
Sergey Mashkov
c50c111fdf Maven: never generate JUnit (but keep code so we will be able to introduce checkbox in configurator to optionally add junit and chose version) 2016-04-27 22:10:47 +03:00
Sergey Mashkov
b20aa6e5bd KT-11731 Default maven integration doesn't include documentation
trigger sources download for stdlib/runtime/test at project import
2016-04-27 22:10:47 +03:00
Sergey Mashkov
4927d6cce2 Maven: extract maven support to the separate module 2016-04-27 22:10:47 +03:00
Sergey Mashkov
693ea83924 KT-11556 "Kotlin not configured" in Kotlin/JS project 2016-04-27 22:10:46 +03:00
Sergey Mashkov
4ed3befa71 KT-11701 Add Maven Dependency quick fix could be supported in Kotlin sources
~ initial draft
2016-04-27 22:10:46 +03:00
Sergey Mashkov
82b26e009a KT-11436 "Choose Configurator" control opens dialogs with inconsistent modality (linux) 2016-04-27 22:10:45 +03:00
Sergey Mashkov
5814197257 KT-11643 Inspections and intentions to fix misconfigured Maven pom
make misconfigured maven project configurable
2016-04-27 22:10:45 +03:00
Sergey Mashkov
4e4f7438f1 KT-11643 Inspections and intentions to fix misconfigured Maven pom 2016-04-27 22:10:45 +03:00
Sergey Mashkov
faf758ffdd KT-9492 Configuring multiple Maven Modules
- kotlin mavne configurator shouldn't configure child modules but parents as children inherit everything
2016-04-27 22:10:44 +03:00
Sergey Mashkov
cd5c533351 KT-11642 Kotlin Maven configurator tags order 2016-04-27 22:10:44 +03:00
Mikhail Glukhikh
1ad77837cf Correct handling of empty super type list while adding an entry #KT-12011 Fixed
(cherry picked from commit 918f843)
2016-04-27 18:48:49 +03:00
Mikhail Glukhikh
82c331d03d Can be parameter inspection: use inside object literals is now handled as "property use"
(cherry picked from commit 1744897)
2016-04-27 18:48:34 +03:00
Mikhail Glukhikh
97330a72cd Can be parameter inspection: use in selector position is now always handled as "property use"
(cherry picked from commit 64ae9af)
2016-04-27 18:48:23 +03:00
Mikhail Glukhikh
c04153910f Can be parameter inspection: use inside function literals is now handled as "property use" #KT-11949 Fixed
(cherry picked from commit 795b924)
2016-04-27 18:48:11 +03:00
Alexey Sedunov
6ae2d28cf5 Change Signature: Do not use local declaration as a context for a type code fragment
(cherry picked from commit e6ab2f1)
2016-04-27 18:27:45 +03:00
Mikhail Glukhikh
e104817ed1 Regular checkType() is now called during condition analysis, TYPE_MISMATCH_IN_CONDITION removed #KT-11998 Fixed
(cherry picked from commit 6b945ba)
2016-04-27 18:20:31 +03:00
Alexander Udalov
e402b82f00 Consider non-running as well as running builds in version override 2016-04-27 14:13:44 +03:00
Alexander Udalov
88ad4bb956 Perform version override earlier and only on teamcity 2016-04-27 10:56:06 +03:00
Mikhail Zarechenskiy
e9b1476112 Move part of code that related to 'Optimize imports' action to ide-common module 2016-04-26 21:34:20 +03:00
Mikhail Zarechenskiy
4ea9332892 Get rid of guava's collections and dependency on Idea's settings from util function
This commit prepares 'prepareOptimizedImports' function to
move to the ide-common module to reuse it in the Eclipse plugin
2016-04-26 21:34:12 +03:00
Nikolay Krasko
a19fc430cd Do no analyze for annotation search if no annotation entries present 2016-04-26 20:46:53 +03:00
Nikolay Krasko
c914583a7a Add note about fixing deadlock in debugger (KT-12067) 2016-04-26 20:46:52 +03:00
Nikolay Krasko
fcfa0b0297 Enable injection in injection tests 2016-04-26 20:46:51 +03:00
Nikolay Krasko
9fde765e22 Make parameter injection work for Java methods 2016-04-26 20:46:51 +03:00
Nikolay Krasko
437e5e98cc First version of injection with annotation on parameter 2016-04-26 20:46:50 +03:00
Nikolay Krasko
2aeea4ef0e Implement withAnnotation() pattern for parameter pattern 2016-04-26 20:46:49 +03:00
Nikolay Krasko
d0304a251e Refactoring replace trimMargin() with trimIndent(). This is preparation for injection bootstrapping in tests. 2016-04-26 20:46:48 +03:00
Nikolay Krasko
7d2698473d Add write action for shorten references in finish template after building call (KT-12056)
Write action was removed in idea 146

#KT-12056 Fixed
2016-04-26 20:46:47 +03:00
Nikolay Krasko
51ab247bc5 Add write action for shortening references in templates (KT-11418)
Write action was removed in idea 146.

#KT-11418 Fixed
2016-04-26 20:46:46 +03:00
Nikolay Krasko
ff83391e97 Revert write actions in utility code (EA-81892)
Revert commits:
ab0fe0a900
97a97614b5
2016-04-26 20:46:46 +03:00
Nikolay Krasko
3c97ae4c5c Auto-test running intention isApplicable() from pooled thread 2016-04-26 20:46:45 +03:00
Alexey Sedunov
917a8f09db Change Signature: Fix context element for type code fragments to avoid bogus "Type can not be resolved" warnings
#KT-11862 Fixed
(cherry picked from commit 9858b17)
2016-04-26 20:17:20 +03:00
Zalim Bashorov
a523fd3742 Minor: fix tests
(cherry picked from commit 3048c29)
2016-04-26 19:13:28 +03:00
Alexey Andreev
fe2b7d6060 KT-11100 Fix generation of name of FakeCallableDescriptorForObject that is presumably used to express invoke operator on (companion) objects 2016-04-26 17:08:09 +03:00
Kirill
ce5e02bd20 Format spaces in infix call (KT-12018)
#KT-12018 Fixed
2016-04-26 15:44:23 +03:00
Kirill
212bb21e7c Format spaces in cast expression (KT-12035)
#KT-12035 Fixed
2016-04-26 15:44:14 +03:00
Alexey Sedunov
ea22c0f891 Move: Optimize imports after applying "Move declaration to separate file" intention
#KT-10174 Fixed
(cherry picked from commit a00c524)
2016-04-26 14:08:50 +03:00
Alexey Sedunov
a0e2193383 Move: Keep original file package name when moving top-level declarations to separate file (provided it's not ambiguous)
#KT-10950 Fixed
(cherry picked from commit 676000c)
2016-04-26 14:08:42 +03:00
Alexey Sedunov
711ae62ed2 Move: Allow choosing source root in "Move file to directory" intention
#KT-11512 Fixed
(cherry picked from commit 332fe29)
2016-04-26 14:08:34 +03:00
Alexey Sedunov
f5df3b7d7e Move: Convert implicit receiver to this when moving class member to companion object
#KT-11483 Fixed
(cherry picked from commit aaa873f)
2016-04-26 14:08:21 +03:00
Alexey Sedunov
77a0fb4e01 Move: Add missing write action
#KT-11482 Fixed
(cherry picked from commit 6faedc1)
2016-04-26 14:08:11 +03:00
Denis Zharkov
cd8305b07a Use different version numbers for 1.0.3 2016-04-25 18:57:01 +03:00
Zalim Bashorov
cfaa68317a Add Unit to compiled part of Kotlin JS stdlib and don't show "Kotlin not configured" for Kotlin JS projects
#KT-11556 Fixed

(cherry picked from commit 658eac2)
2016-04-25 18:04:38 +03:00
23322 changed files with 225071 additions and 659309 deletions

21
.gitignore vendored
View File

@@ -7,18 +7,17 @@
/gh-pages
/ideaSDK
/android-studio/sdk
/out
/tmp
out
tmp
workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*
/jps-plugin/testData/kannotator
/ultimate/dependencies
/ultimate/ideaSDK
/ultimate/out
/ultimate/tmp
/js/js.translator/testData/**/out/
.gradle/
build/
!**/src/**/build
ultimate/.DS_Store
ultimate/.idea/shelf
ultimate/dependencies
ultimate/ideaSDK
ultimate/out
ultimate/tmp
ultimate/workspace.xml
ultimate/*.versionsBackup

2
.idea/ant.xml generated
View File

@@ -3,7 +3,7 @@
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/compiler/frontend/buildLexer.xml" />
<buildFile url="file://$PROJECT_DIR$/build.xml">
<antCommandLine value="-J-ea" />
<antCommandLine value="-J-XX:MaxPermSize=100m -J-ea" />
<maximumHeapSize value="1024" />
</buildFile>
<buildFile url="file://$PROJECT_DIR$/update_dependencies.xml" />

View File

@@ -11,6 +11,7 @@
<element id="directory" name="META-INF">
<element id="dir-copy" path="$PROJECT_DIR$/jps-plugin/src/META-INF" />
</element>
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/cli-parser-1.1.2.jar" path-in-jar="/" />
<element id="module-output" name="cli-common" />
<element id="module-output" name="idea-jps-common" />
<element id="module-output" name="jps-plugin" />
@@ -22,7 +23,6 @@
<element id="module-output" name="daemon-common" />
<element id="module-output" name="deserialization" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/native-platform-uberjar.jar" path-in-jar="/" />
<element id="module-output" name="android-extensions-jps" />
<element id="module-output" name="build-common" />
<element id="module-output" name="compiler-runner" />
</root>

View File

@@ -10,7 +10,6 @@
<root id="root">
<element id="directory" name="lib">
<element id="archive" name="kotlin-plugin.jar">
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/cli-parser-1.1.2.jar" path-in-jar="/" />
<element id="module-output" name="backend" />
<element id="module-output" name="frontend" />
<element id="module-output" name="descriptors" />
@@ -25,12 +24,11 @@
<element id="module-output" name="js.parser" />
<element id="module-output" name="cli-common" />
<element id="module-output" name="idea-jps-common" />
<element id="module-output" name="build-common" />
<element id="module-output" name="preloader" />
<element id="module-output" name="deserialization" />
<element id="module-output" name="backend-common" />
<element id="library" level="project" name="builtins" />
<element id="module-output" name="js.ast" />
<element id="module-output" name="js.dart-ast" />
<element id="directory" name="kotlin">
<element id="dir-copy" path="$PROJECT_DIR$/core/builtins/native/kotlin" />
<element id="dir-copy" path="$PROJECT_DIR$/core/builtins/src/kotlin" />
@@ -55,32 +53,25 @@
<element id="module-output" name="formatter" />
<element id="module-output" name="idea-maven" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/protobuf-2.6.1.jar" path-in-jar="/" />
<element id="module-output" name="backend.common" />
<element id="module-output" name="ir.tree" />
<element id="module-output" name="backend.jvm" />
<element id="module-output" name="ir.psi2ir" />
<element id="module-output" name="annotation-based-compiler-plugins-ide-support" />
<element id="module-output" name="frontend.script" />
</element>
<element id="library" level="project" name="javax.inject" />
<element id="directory" name="jps">
<element id="artifact" artifact-name="KotlinJpsPlugin" />
</element>
<element id="library" level="project" name="markdown" />
<element id="archive" name="android-extensions-ide.jar">
<element id="archive" name="kotlin-android-extensions-plugin.jar">
<element id="module-output" name="android-extensions-idea" />
</element>
<element id="archive" name="android-extensions-compiler.jar">
<element id="archive" name="kotlin-android-extensions-compiler-plugin.jar">
<element id="module-output" name="android-extensions-compiler" />
<element id="module-output" name="android-extensions-runtime" />
</element>
<element id="archive" name="android-lint.jar">
<element id="module-output" name="uast-kotlin" />
<element id="module-output" name="lint-idea" />
<element id="module-output" name="lint-checks" />
<element id="module-output" name="lint-api" />
<element id="module-output" name="uast-kotlin-idea" />
</element>
<element id="library" level="project" name="uast-java" />
<element id="archive" name="allopen-ide-plugin.jar">
<element id="module-output" name="allopen-ide" />
</element>
@@ -93,20 +84,10 @@
<element id="archive" name="noarg-ide-plugin.jar">
<element id="module-output" name="noarg-ide" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/dependencies/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-script-runtime.jar" />
<element id="archive" name="sam-with-receiver-compiler-plugin.jar">
<element id="module-output" name="sam-with-receiver-cli" />
<element id="archive" name="uast-kotlin.jar">
<element id="module-output" name="uast-kotlin-idea" />
<element id="module-output" name="uast-kotlin" />
</element>
<element id="archive" name="sam-with-receiver-ide-plugin.jar">
<element id="module-output" name="sam-with-receiver-ide" />
</element>
<element id="archive" name="kotlin-gradle-tooling.jar">
<element id="module-output" name="kotlin-gradle-tooling" />
</element>
<element id="library" level="project" name="uast-java" />
<element id="library" level="project" name="kotlinx-coroutines-core" />
<element id="library" level="project" name="javaslang" />
<element id="library" level="project" name="kotlinx-coroutines-jdk8" />
</element>
<element id="directory" name="kotlinc">
<element id="dir-copy" path="$PROJECT_DIR$/dist/kotlinc" />

View File

@@ -60,9 +60,6 @@
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
@@ -145,6 +142,10 @@
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>

8
.idea/compiler.xml generated
View File

@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<option name="BUILD_PROCESS_HEAP_SIZE" value="2000" />
<excludeFromCompile>
<directory url="file://$PROJECT_DIR$/core/reflection.jvm" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/core/runtime.jvm" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/core/builtins" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/core/script.runtime" includeSubdirectories="true" />
</excludeFromCompile>
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
@@ -18,6 +19,11 @@
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="android-studio" target="1.8" />
<module name="idea" target="1.8" />

View File

@@ -1,7 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="4u7">
<words>
<w>foldable</w>
</words>
</dictionary>
</component>

View File

@@ -2,9 +2,7 @@
<dictionary name="dzharkov">
<words>
<w>checkcast</w>
<w>coroutine</w>
<w>insn</w>
<w>liveness</w>
</words>
</dictionary>
</component>

View File

@@ -1,6 +1,7 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<profile version="1.0" is_locked="false">
<option name="myName" value="idea.default" />
<option name="myLocal" value="false" />
<inspection_tool class="AbstractMethodCallInConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ArchaicSystemPropertyAccess" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AssignmentToForLoopParameter" enabled="true" level="WARNING" enabled_by_default="true">
@@ -235,7 +236,6 @@
<scope name="idea openapi" level="WARNING" enabled="true" />
<scope name="runtime.classes" level="ERROR" enabled="true" />
</inspection_tool>
<inspection_tool class="LoopToCallChain" enabled="false" level="INFO" enabled_by_default="false" />
<inspection_tool class="MethodMayBeStatic" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_onlyPrivateOrFinal" value="false" />
<option name="m_ignoreEmptyMethods" value="true" />
@@ -342,12 +342,11 @@
<constraint name="__context__" script="&quot;&quot;" within="" contains="" />
</searchConfiguration>
</inspection_tool>
<inspection_tool class="SameParameterValue" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="SetReplaceableByEnumSet" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SetupCallsSuperSetup" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SetupIsPublicVoidNoArg" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SimplifiableIfStatement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="Since15" enabled="false" level="ERROR" enabled_by_default="false">
<inspection_tool class="Since15" enabled="true" level="ERROR" enabled_by_default="true">
<scope name="IDEA Test Sources" level="ERROR" enabled="false" />
</inspection_tool>
<inspection_tool class="SocketResource" enabled="true" level="WARNING" enabled_by_default="true">
@@ -412,7 +411,6 @@
<inspection_tool class="UnnecessaryUnboxing" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UseOfPropertiesAsHashtable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="VolatileLongOrDoubleField" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="WaitNotInLoop" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="WaitNotInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="WaitWhileHoldingTwoLocks" enabled="true" level="WARNING" enabled_by_default="true" />

5
.idea/kotlinc.xml generated
View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinCommonCompilerArguments">
<option name="languageVersion" value="1.1" />
<option name="apiVersion" value="1.1" />
<component name="Kotlin2JsCompilerArguments">
<option name="moduleKind" value="plain" />
</component>
<component name="KotlinCompilerSettings">
<option name="additionalArguments" value="-version -Xallow-kotlin-package -Xskip-metadata-version-check" />

14
.idea/libraries/Rhino.xml generated Normal file
View File

@@ -0,0 +1,14 @@
<component name="libraryTable">
<library name="Rhino">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/rhino-1.7.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/rhino-1.7.6-sources.jar!/rhino1.7.6/src" />
</SOURCES>
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="android-layoutlib">
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/android/lib/layoutlib.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -6,6 +6,7 @@
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib" />
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib/jps" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/android-common.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>

View File

@@ -8,7 +8,7 @@
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/asm-src.zip!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
</SOURCES>
</library>
</component>

11
.idea/libraries/cli_parser.xml generated Normal file
View File

@@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="cli-parser">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/cli-parser-1.1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/cli-parser-1.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -3,6 +3,7 @@
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/coverage/lib/coverage.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/coverage/lib/jacocoant.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/coverage/lib/coverage-agent.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>

View File

@@ -4,11 +4,11 @@
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/guava-19.0.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/guava-17.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/guava-19.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -9,9 +9,9 @@
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/guava-19.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm-src.zip!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/lib" recursive="false" />
</library>

View File

@@ -5,27 +5,14 @@
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/core/annotations.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/asm-all.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/guava-19.0.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/intellij-core.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/jdom.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/jna.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/log4j.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/picocontainer.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/snappy-in-java-0.5.1.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/trove4j.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/util.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/xpp3-1.1.4-min.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/xstream-1.4.8.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/jsr305.jar!/" />
<root url="file://$PROJECT_DIR$/ideaSDK/core" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/guava-19.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm-src.zip!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/jsr305.jar!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/core" recursive="false" />
</library>
</component>

View File

@@ -0,0 +1,17 @@
<component name="libraryTable">
<library name="intellij-core-analysis">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/core-analysis/intellij-core-analysis.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="javaslang">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/javaslang-2.0.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/javaslang-2.0.6-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -9,6 +9,17 @@
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/antLayout/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-builders/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-builders/testSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-launcher/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-api/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-impl/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-impl/testSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-serialization/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-serialization/testSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/plugin-system/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/standalone-builder/src" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/jps" recursive="false" />
</library>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="json-org">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/json-org.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -4,9 +4,6 @@
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/core/reflection.jvm/src" />
<root url="file://$PROJECT_DIR$/core/descriptors.runtime/src" />
</SOURCES>
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="kotlin-script-runtime">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-script-runtime.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="kotlin-test">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test.jar!/"/>
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/shared/src/main/kotlin" />
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/shared/src/main/kotlin.jvm" />
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/junit/src/main/kotlin" />
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/common/src/main/kotlin" />
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/jvm/src/main/kotlin" />
</SOURCES>
</library>
</component>

View File

@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="kotlinx-coroutines-core">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/kotlinx-coroutines-core.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/kotlinx-coroutines-core-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="kotlinx-coroutines-jdk8">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/kotlinx-coroutines-jdk8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/kotlinx-coroutines-jdk8-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -5,7 +5,6 @@
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/properties/lib/properties.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/properties/lib/resources_en.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>

View File

@@ -7,6 +7,11 @@
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/trove4j.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/src/trove4j_src.jar!/core/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/src/trove4j_src.jar!/generated/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/src/trove4j_src.jar!/test/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/src/trove4j_src.jar!/util/src" />
</SOURCES>
</library>
</component>

View File

@@ -3,13 +3,11 @@
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/uast-common.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/uast-java.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/uast-tests.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/uast-common-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/uast-java-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/uast-tests-sources.jar!/" />
</SOURCES>
</library>
</component>

3
.idea/misc.xml generated
View File

@@ -6,6 +6,7 @@
</properties>
</component>
<component name="EntryPointsManager">
<entry_points version="2.0" />
<list size="1">
<item index="0" class="java.lang.String" itemvalue="javax.inject.Inject" />
</list>
@@ -48,7 +49,7 @@
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SuppressABINotification">

28
.idea/modules.xml generated
View File

@@ -8,17 +8,14 @@
<module fileurl="file://$PROJECT_DIR$/plugins/lint/android-annotations/android-annotations.iml" filepath="$PROJECT_DIR$/plugins/lint/android-annotations/android-annotations.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/android-extensions-compiler.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/android-extensions-compiler.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-idea/android-extensions-idea.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-idea/android-extensions-idea.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-jps/android-extensions-jps.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-jps/android-extensions-jps.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-runtime/android-extensions-runtime.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-runtime/android-extensions-runtime.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/android-studio/android-studio.iml" filepath="$PROJECT_DIR$/android-studio/android-studio.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/android-tests/android-tests.iml" filepath="$PROJECT_DIR$/compiler/android-tests/android-tests.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-based-compiler-plugins-ide-support/annotation-based-compiler-plugins-ide-support.iml" filepath="$PROJECT_DIR$/plugins/annotation-based-compiler-plugins-ide-support/annotation-based-compiler-plugins-ide-support.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-collector/annotation-collector.iml" filepath="$PROJECT_DIR$/plugins/annotation-collector/annotation-collector.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-processing/annotation-processing.iml" filepath="$PROJECT_DIR$/plugins/annotation-processing/annotation-processing.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/ant/ant.iml" filepath="$PROJECT_DIR$/ant/ant.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/backend/backend.iml" filepath="$PROJECT_DIR$/compiler/backend/backend.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/compiler/backend-common/backend-common.iml" filepath="$PROJECT_DIR$/compiler/backend-common/backend-common.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/backend.common/backend.common.iml" filepath="$PROJECT_DIR$/compiler/ir/backend.common/backend.common.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/backend.jvm/backend.jvm.iml" filepath="$PROJECT_DIR$/compiler/ir/backend.jvm/backend.jvm.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/build-common/build-common.iml" filepath="$PROJECT_DIR$/build-common/build-common.iml" />
<module fileurl="file://$PROJECT_DIR$/core/builtins/builtins.iml" filepath="$PROJECT_DIR$/core/builtins/builtins.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/compiler/builtins-serializer/builtins-serializer.iml" filepath="$PROJECT_DIR$/compiler/builtins-serializer/builtins-serializer.iml" group="compiler/cli" />
@@ -41,7 +38,6 @@
<module fileurl="file://$PROJECT_DIR$/idea/formatter/formatter.iml" filepath="$PROJECT_DIR$/idea/formatter/formatter.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend/frontend.iml" filepath="$PROJECT_DIR$/compiler/frontend/frontend.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" filepath="$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend.script/frontend.script.iml" filepath="$PROJECT_DIR$/compiler/frontend.script/frontend.script.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/generators/generators.iml" filepath="$PROJECT_DIR$/generators/generators.iml" group="infrastructure" />
<module fileurl="file://$PROJECT_DIR$/grammar/grammar.iml" filepath="$PROJECT_DIR$/grammar/grammar.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/idea/ide-common/ide-common.iml" filepath="$PROJECT_DIR$/idea/ide-common/ide-common.iml" group="ide" />
@@ -59,15 +55,11 @@
<module fileurl="file://$PROJECT_DIR$/idea/idea-test-framework/idea-test-framework.iml" filepath="$PROJECT_DIR$/idea/idea-test-framework/idea-test-framework.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/incremental-compilation-impl/incremental-compilation-impl.iml" filepath="$PROJECT_DIR$/compiler/incremental-compilation-impl/incremental-compilation-impl.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/preloader/instrumentation/instrumentation.iml" filepath="$PROJECT_DIR$/compiler/preloader/instrumentation/instrumentation.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/ir.ir2cfg/ir.ir2cfg.iml" filepath="$PROJECT_DIR$/compiler/ir/ir.ir2cfg/ir.ir2cfg.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/ir.psi2ir/ir.psi2ir.iml" filepath="$PROJECT_DIR$/compiler/ir/ir.psi2ir/ir.psi2ir.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/ir.tree/ir.tree.iml" filepath="$PROJECT_DIR$/compiler/ir/ir.tree/ir.tree.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/j2k/j2k.iml" filepath="$PROJECT_DIR$/j2k/j2k.iml" group="j2k" />
<module fileurl="file://$PROJECT_DIR$/compiler/javac-wrapper/javac-wrapper.iml" filepath="$PROJECT_DIR$/compiler/javac-wrapper/javac-wrapper.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/java-model-wrappers/java-model-wrappers.iml" filepath="$PROJECT_DIR$/plugins/java-model-wrappers/java-model-wrappers.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/jps-plugin.iml" filepath="$PROJECT_DIR$/jps-plugin/jps-plugin.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/jps-tests/jps-tests.iml" filepath="$PROJECT_DIR$/jps-plugin/jps-tests/jps-tests.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/js/js.ast/js.ast.iml" filepath="$PROJECT_DIR$/js/js.ast/js.ast.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.dce/js.dce.iml" filepath="$PROJECT_DIR$/js/js.dce/js.dce.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.dart-ast/js.dart-ast.iml" filepath="$PROJECT_DIR$/js/js.dart-ast/js.dart-ast.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.frontend/js.frontend.iml" filepath="$PROJECT_DIR$/js/js.frontend/js.frontend.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.inliner/js.inliner.iml" filepath="$PROJECT_DIR$/js/js.inliner/js.inliner.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.parser/js.parser.iml" filepath="$PROJECT_DIR$/js/js.parser/js.parser.iml" group="compiler/js" />
@@ -75,14 +67,13 @@
<module fileurl="file://$PROJECT_DIR$/js/js.tests/js.tests.iml" filepath="$PROJECT_DIR$/js/js.tests/js.tests.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.translator/js.translator.iml" filepath="$PROJECT_DIR$/js/js.translator/js.translator.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/kannotator-jps-plugin-test/kannotator-jps-plugin-test.iml" filepath="$PROJECT_DIR$/jps-plugin/kannotator-jps-plugin-test/kannotator-jps-plugin-test.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/plugins/kapt3/kapt3.iml" filepath="$PROJECT_DIR$/plugins/kapt3/kapt3.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/idea/kotlin-gradle-tooling/kotlin-gradle-tooling.iml" filepath="$PROJECT_DIR$/idea/kotlin-gradle-tooling/kotlin-gradle-tooling.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/kapt3/kapt3.iml" filepath="$PROJECT_DIR$/plugins/kapt3/kapt3.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/light-classes/light-classes.iml" filepath="$PROJECT_DIR$/compiler/light-classes/light-classes.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/lint-api/lint-api.iml" filepath="$PROJECT_DIR$/plugins/lint/lint-api/lint-api.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/lint-checks/lint-checks.iml" filepath="$PROJECT_DIR$/plugins/lint/lint-checks/lint-checks.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/lint-idea/lint-idea.iml" filepath="$PROJECT_DIR$/plugins/lint/lint-idea/lint-idea.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/noarg/noarg-cli/noarg-cli.iml" filepath="$PROJECT_DIR$/plugins/noarg/noarg-cli/noarg-cli.iml" group="plugins/noarg" />
<module fileurl="file://$PROJECT_DIR$/plugins/noarg/noarg-ide/noarg-ide.iml" filepath="$PROJECT_DIR$/plugins/noarg/noarg-ide/noarg-ide.iml" group="plugins/noarg" />
<module fileurl="file://$PROJECT_DIR$/plugins/noarg/noarg-cli/noarg-cli.iml" filepath="$PROJECT_DIR$/plugins/noarg/noarg-cli/noarg-cli.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/noarg/noarg-ide/noarg-ide.iml" filepath="$PROJECT_DIR$/plugins/noarg/noarg-ide/noarg-ide.iml" />
<module fileurl="file://$PROJECT_DIR$/non-compiler-tests/non-compiler-tests.iml" filepath="$PROJECT_DIR$/non-compiler-tests/non-compiler-tests.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/plugin-api/plugin-api.iml" filepath="$PROJECT_DIR$/compiler/plugin-api/plugin-api.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/plugins-tests/plugins-tests.iml" filepath="$PROJECT_DIR$/plugins/plugins-tests/plugins-tests.iml" group="plugins" />
@@ -90,14 +81,9 @@
<module fileurl="file://$PROJECT_DIR$/core/reflection.jvm/reflection.jvm.iml" filepath="$PROJECT_DIR$/core/reflection.jvm/reflection.jvm.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/compiler/resolution/resolution.iml" filepath="$PROJECT_DIR$/compiler/resolution/resolution.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/core/runtime.jvm/runtime.jvm.iml" filepath="$PROJECT_DIR$/core/runtime.jvm/runtime.jvm.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-cli/sam-with-receiver-cli.iml" filepath="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-cli/sam-with-receiver-cli.iml" group="plugins/sam-with-receiver" />
<module fileurl="file://$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-ide/sam-with-receiver-ide.iml" filepath="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-ide/sam-with-receiver-ide.iml" group="plugins/sam-with-receiver" />
<module fileurl="file://$PROJECT_DIR$/core/script.runtime/script.runtime.iml" filepath="$PROJECT_DIR$/core/script.runtime/script.runtime.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/compiler/serialization/serialization.iml" filepath="$PROJECT_DIR$/compiler/serialization/serialization.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/source-sections/source-sections-compiler/source-sections-compiler.iml" filepath="$PROJECT_DIR$/plugins/source-sections/source-sections-compiler/source-sections-compiler.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests-common/tests-common.iml" filepath="$PROJECT_DIR$/compiler/tests-common/tests-common.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests-ir-jvm/tests-ir-jvm.iml" filepath="$PROJECT_DIR$/compiler/tests-ir-jvm/tests-ir-jvm.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-kotlin/uast-kotlin.iml" filepath="$PROJECT_DIR$/plugins/uast-kotlin/uast-kotlin.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-kotlin/uast-kotlin.iml" filepath="$PROJECT_DIR$/plugins/uast-kotlin/uast-kotlin.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-kotlin-idea/uast-kotlin-idea.iml" filepath="$PROJECT_DIR$/plugins/uast-kotlin-idea/uast-kotlin-idea.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/util/util.iml" filepath="$PROJECT_DIR$/compiler/util/util.iml" />
<module fileurl="file://$PROJECT_DIR$/core/util.runtime/util.runtime.iml" filepath="$PROJECT_DIR$/core/util.runtime/util.runtime.iml" group="core" />

View File

@@ -13,7 +13,7 @@
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -13,7 +13,7 @@
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -13,7 +13,7 @@
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Dkotlin.colors.enabled=false" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1100m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -8,7 +8,7 @@
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=128m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Djna.nosys=true" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -3,7 +3,7 @@
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="android-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="ALTERNATIVE_JRE_PATH" value="1.6" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.android.tests" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.android.tests.AndroidRunner" />
<option name="METHOD_NAME" value="" />

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 1.6 on JDK 1.6" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.6 -Dkotlin.test.box.in.separate.process.port=5100 -Dkotlin.test.java.compilation.target=1.6 -ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 1.6 on JDK 9" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="9-ea" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.6 -ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true --add-opens java.desktop/javax.swing=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 1.8 on JDK 1.8" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.8 -ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 1.8 on JDK 9" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="9-ea" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.8 -ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true --add-opens java.desktop/javax.swing=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 9 on JDK 9 " type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="9-ea" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.8 -Dkotlin.test.substitute.bytecode.1.8.to.1.9=true -ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true --add-opens java.desktop/javax.swing=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -13,7 +13,7 @@
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Dkotlin.colors.enabled=false" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx700m -XX:MaxPermSize=300m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -1,9 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA" type="Application" factoryName="Application" singleton="true">
<log_file path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" checked="true" skipped="true" show_all="false" alias="idea.log" />
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=128m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />

View File

@@ -1,9 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="Application" factoryName="Application" singleton="true">
<log_file path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" checked="true" skipped="true" show_all="false" alias="idea.log" />
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=128m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Didea.ProcessCanceledException=disabled -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Didea.ProcessCanceledException=disabled -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />

View File

@@ -13,7 +13,7 @@
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Dkotlin.colors.enabled=false" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Java 8 Tests on JDK 9" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests-java8" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="9-ea" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.desktop/javax.swing=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -8,7 +8,7 @@
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -Djna.nosys=true -Dkotlin.js.skipMinificationTest=false" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

File diff suppressed because it is too large Load Diff

View File

@@ -14,73 +14,37 @@
<excludeFolder url="file://$MODULE_DIR$/ideaSDK/system" />
<excludeFolder url="file://$MODULE_DIR$/ideaSDK/system-idea" />
<excludeFolder url="file://$MODULE_DIR$/libraries/.idea" />
<excludeFolder url="file://$MODULE_DIR$/libraries/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/annotation-processor-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/browser-example-with-library/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/docs/apidoc/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/docs/website/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/browser-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/js-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/kotlin-gradle-subplugin-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/kotlin-java-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/kotlin-js-library-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/kotlin-jsr223-daemon-local-eval-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/kotlin-jsr223-local-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/common/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/js/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/js/it/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/js/it/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/junit/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/jvm/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/common/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/jre7/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/jre8/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/js/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/js/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin-jdbc/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin-swing/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kunit/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/validator/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/.idea" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/binary-compatibility-validator/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/gradle-tools/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/idl2k/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-allopen/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-allopen/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-android-extensions/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-annotation-processing-maven/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-annotation-processing/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-build-common-test/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-compiler-client-embeddable-test/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-compiler-client-embeddable/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-compiler-embeddable/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-compiler-runner/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kdoc-maven-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kdoc/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-compiler/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-daemon-client/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-api/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-api/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-integration-tests/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-integration-tests/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-core/local-repo" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-core/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-test/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin/local-repo" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-allopen/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-noarg/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-js-library/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-js-tests-junit/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-js-tests/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-plugin-test/local-repo" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-plugin-test/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-plugin/local-repo" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-noarg/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-noarg/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-osgi-bundle/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-reflect/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-sam-with-receiver-compiler-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-script-util/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-source-sections-compiler-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-stdlib-gen/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/maven-archetypes/kotlin-archetype-js/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/maven-archetypes/kotlin-archetype-jvm/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/native-platform/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/protobuf-lite/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/runtime/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/script-runtime/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-reflect/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-stdlib-gen/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/runtime/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
</module>

149
ReadMe.md
View File

@@ -1,93 +1,96 @@
<a href="http://slack.kotlinlang.org/"><img src="http://slack.kotlinlang.org/badge.svg" height="20"></a>
<a href="http://kotlinslackin.herokuapp.com"><img src="https://kotlinslackin.herokuapp.com/badge.svg" height="20"></a>
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/bt345.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=bt345&branch_Kotlin=%3Cdefault%3E&tab=buildTypeStatusDiv)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
# Kotlin Programming Language
Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
Welcome to [Kotlin](http://kotlinlang.org/)! Some handy links:
* [Kotlin Site](https://kotlinlang.org/)
* [Getting Started Guide](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Try Kotlin](https://try.kotlinlang.org/)
* [Kotlin Standard Library](https://kotlinlang.org/api/latest/jvm/stdlib/index.html)
* [Issue Tracker](https://youtrack.jetbrains.com/issues/KT)
* [Forum](https://discuss.kotlinlang.org/)
* [Kotlin Blog](https://blog.jetbrains.com/kotlin/)
* [Kotlin Site](http://kotlinlang.org/)
* [Getting Started Guide](http://kotlinlang.org/docs/tutorials/getting-started.html)
* [Try Kotlin](http://try.kotlinlang.org/)
* [Kotlin Standard Library](http://kotlinlang.org/api/latest/jvm/stdlib/index.html)
* [Issue Tracker](http://youtrack.jetbrains.com/issues/KT)
* [Forum](http://devnet.jetbrains.net/community/kotlin?view=discussions)
* [Kotlin Blog](http://blog.jetbrains.com/kotlin/)
* [Follow Kotlin on Twitter](https://twitter.com/kotlin)
* [Public Slack channel](http://slack.kotlinlang.org/)
* [Public Slack channel](http://kotlinslackin.herokuapp.com/)
* [TeamCity CI build](https://teamcity.jetbrains.com/project.html?tab=projectOverview&projectId=Kotlin)
## Editing Kotlin
* [Kotlin IntelliJ IDEA Plugin](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Kotlin Eclipse Plugin](https://kotlinlang.org/docs/tutorials/getting-started-eclipse.html)
* [Kotlin Eclipse Plugin](http://kotlinlang.org/docs/tutorials/getting-started-eclipse.html)
* [Kotlin TextMate Bundle](https://github.com/vkostyukov/kotlin-sublime-package)
## Build environment requirements
In order to build Kotlin distribution you need to have:
- Apache Ant 1.9.4 and higher
- JDK 1.6, 1.7 and 1.8
- Setup environment variables as following:
JAVA_HOME="path to JDK 1.8"
JDK_16="path to JDK 1.6"
JDK_17="path to JDK 1.7"
JDK_18="path to JDK 1.8"
## Building
To build this project, first time you try to build you need to run this:
To build this project, first time you try to build you need to run this (requires Apache **Ant 1.8** or higher and **JDK 1.6**):
ant -f update_dependencies.xml
which will setup the dependencies on
* `intellij-core` is a part of command line compiler and contains only necessary APIs.
* `idea-full` is a full blown IntelliJ IDEA Community Edition to be used in the plugin module.
* intellij-core: is a part of command line compiler and contains only necessary APIs.
* idea-full: is a full blown IntelliJ IDEA Community Edition to be used in former plugin module.
Then, you need to run
ant -f build.xml
which will build the binaries of the compiler and put them into the `dist` directory. You may need to increase the **heap size** for Ant using
[ANT_OPTS](https://web.liferay.com/community/wiki/-/wiki/Main/Ant+opts).
which will build the binaries of the compiler and put them into the 'dist' directory. You may need to increase the **heap size** for Ant using
[ANT_OPTS](http://www.liferay.com/community/wiki/-/wiki/Main/Ant+opts).
**OPTIONAL:** Maven artifact distribution is built separately, go into `libraries` directory after building the compiler and run:
**OPTIONAL:** Maven distribution is built separately, run
./gradlew build install
mvn install
mvn package
> Note: on Windows type `gradlew` without the leading `./`
Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
from 'libraries' directory after building the compiler. Refer to `libraries/ReadMe.md` for details.
## Working with the project in IntelliJ IDEA
The [root kotlin project](https://github.com/JetBrains/kotlin) already has an IntelliJ IDEA project, you can just open it in IntelliJ IDEA.
You may need to set the Project SDK (`File -> Project Structure -> Project`).
You may also need to add `tools.jar` to your SDK:
File -> Project Structure -> SDKs -> <Your JDK> -> Classpath
You may need to set the Project SDK (File -> Project Structure -> Project).
You may also need to add `tools.jar` to your SDK: File -> Project Structure -> SDKs -> <Your JDK> -> Classpath,
then choose the `tools.jar` in the JDK's `lib` directory.
If you are not dealing with Android, you may need to disable the Android Plugin in order to compile the project.
### <a name="installing-plugin"></a> Installing the latest Kotlin plugin
Since Kotlin project contains code written in Kotlin itself, you will also need a Kotlin plugin to build the project in IntelliJ IDEA.
To keep the plugin version in sync with the rest of the team and our [Continuous Integration server](https://teamcity.jetbrains.com/project.html?projectId=Kotlin&tab=projectOverview)
you should install the according to the [instructions below](#plugin-for-contributors).
You probably want to have locally the same version of plugin that build server is using for building.
If you want to have an IntelliJ IDEA installation without the Kotlin plugin which is separate to your default IntelliJ IDEA installation which has the Kotlin
plugin [see this document](http://devnet.jetbrains.net/docs/DOC-181) which describes how to have multiple IntelliJ IDEA installations using different configurations and plugin directories.
From this root project there are Run/Debug Configurations for running IDEA or the Compiler Tests for example; so if you want to try out the latest and greatest IDEA plugin
* VCS -> Git -> Pull
* Run IntelliJ IDEA
* a child IntelliJ IDEA with the Kotlin plugin will then startup
* you can now open the [kotlin libraries project](https://github.com/JetBrains/kotlin/tree/master/libraries) to then work with the various kotlin libraries etc.
### <a name="pre-built-plugin"></a>Using a pre-built Kotlin IntelliJ IDEA plugin
There are several options for getting Kotlin plugin. A stable version can be obtained as any other plugin for IntelliJ IDEA:
Preferences -> Plugins -> Install JetBrains plugin... -> Search with "Kotlin" string
The most recent version of the plugin can be downloaded from the
[IDEA Plugin and Tests CI build](https://teamcity.jetbrains.com/project.html?projectId=project67&tab=projectOverview). When downloading is
finished you can install it with "Install plugin from disk...":
Preferences -> Plugins -> Install plugin from disk...
You can now open any Kotlin based projects.
<a name="plugin-for-contributors"></a>
**Note for contributors**: If you are planning to contribute to Kotlin project you probably want to have locally the same version of plugin that build server is using for building.
As this version is constantly moving, the best way to always be updated is to let IntelliJ IDEA notify you when it is time to renew your plugin.
To keep the plugin version in sync with the rest of the team and our [Continuous Integration server](https://teamcity.jetbrains.com/project.html?projectId=Kotlin&tab=projectOverview)
you should setup IDEA to update the plugin directly from the build server.
Open:
Open
Preferences -> Plugins -> Browse Repositories -> Manage Repositories...
@@ -97,36 +100,24 @@ and add the following URL to your repositories:
Then update the list of plugins in "Browse Repositories", you'll see two versions of Kotlin there, install the one with the higher version number.
If you want to keep an IntelliJ IDEA installation with that bleeding edge Kotlin plugin for working Kotlin project sources only separate to your default IntelliJ IDEA installation with the stable Kotlin
plugin [see this document](https://intellij-support.jetbrains.com/hc/en-us/articles/207240985-Changing-IDE-default-directories-used-for-config-plugins-and-caches-storage), which describes how to have multiple IntelliJ IDEA installations using different configurations and plugin directories.
### Compiling and running
From this root project there are Run/Debug Configurations for running IDEA or the Compiler Tests for example; so if you want to try out the latest and greatest IDEA plugin
* VCS -> Git -> Pull
* Run IntelliJ IDEA
* a child IntelliJ IDEA with the Kotlin plugin will then startup
* you can now open the [kotlin libraries project](https://github.com/JetBrains/kotlin/tree/master/libraries) to then work with the various kotlin libraries etc.
# Contributing
We love contributions! There's [lots to do on Kotlin](https://youtrack.jetbrains.com/issues/KT) and on the
[standard library](https://youtrack.jetbrains.com/issues/KT?q=%23Kotlin%20%23Unresolved%20and%20(links:%20KT-2554,%20KT-4089%20or%20%23Libraries)) so why not chat with us
We love contributions! There's [lots to do on Kotlin](http://youtrack.jetbrains.com/issues/KT) and on the
[standard library](https://youtrack.jetbrains.com/issues/KT?q=Subtask+of%3A+KT-2554+%23Unresolved) so why not chat with us
about what you're interested in doing? Please join the #kontributors channel in [our Slack chat](http://kotlinslackin.herokuapp.com/)
and let us know about your plans.
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues/KT?q=tag:%20%7BUp%20For%20Grabs%7D%20%23Unresolved) which should find all Kotlin issues that marked as "up-for-grabs".
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues?q=tag%3A+%7BUp+For+Grabs%7D+%23Unresolved) which should find all issues that marked as "up-for-grabs".
Currently only committers can assign issues to themselves so just add a comment if you're starting work on it.
A nice gentle way to contribute would be to review the [standard library docs](https://kotlinlang.org/api/latest/jvm/stdlib/index.html)
A nice gentle way to contribute would be to review the [standard library docs](http://kotlinlang.org/api/latest/jvm/stdlib/index.html)
and find classes or functions which are not documented very well and submit a patch.
In particular it'd be great if all functions included a nice example of how to use it such as for the
[`hashMapOf()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/hash-map-of.html) function.
This is implemented using the [`@sample`](https://github.com/JetBrains/kotlin/blob/1.1.0/libraries/stdlib/src/kotlin/collections/Maps.kt#L91)
macro to include code from a test function. The benefits of this approach are twofold; First, the API's documentation is improved via beneficial examples that help new users and second, the code coverage is increased.
<a href="http://kotlinlang.org/api/latest/jvm/stdlib/kotlin/hash-map-of.html">hashMapOf()</a> function.
This is implemented using the <a href=https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/src/kotlin/collections/Maps.kt#L53">@sample</a>
macro to include code from a test function. This serves as a double win; the API gets better documented with nice examples to help new users and the code gets more test coverage.
Also the [JavaScript translation](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) could really use your help. See the [JavaScript contribution section](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) for more details.
@@ -135,8 +126,8 @@ Also the [JavaScript translation](https://github.com/JetBrains/kotlin/blob/maste
The Kotlin compiler is written in Java and Kotlin (we gradually migrate more and more of it to pure Kotlin). So the easiest way to work on the compiler or IntelliJ IDEA plugin is
* download a recent [IntelliJ IDEA](https://www.jetbrains.com/idea/?fromMenu#chooseYourEdition), Community edition is enough
* [install the Kotlin plugin](#installing-plugin)
* download a clean [IDEA 15 EAP build](https://confluence.jetbrains.com/display/IDEADEV/IDEA+15+EAP)
* [install the Kotlin plugin](#pre-built-plugin)
* open the [root kotlin project](https://github.com/JetBrains/kotlin) in IDEA (opening the kotlin directory)
You can now run the various Run/Debug Configurations such as
@@ -148,35 +139,29 @@ You can now run the various Run/Debug Configurations such as
## If you want to work on the Kotlin libraries
* download a recent [IntelliJ IDEA](https://www.jetbrains.com/idea/?fromMenu#chooseYourEdition), Community edition is enough
* [install the Kotlin plugin](#installing-plugin)
* download a clean [IDEA 15 EAP build](https://confluence.jetbrains.com/display/IDEADEV/IDEA+15+EAP)
* [install the Kotlin plugin](#pre-built-plugin)
* open the [kotlin libraries project](https://github.com/JetBrains/kotlin/tree/master/libraries)
Then build via
cd libraries
./gradlew build install
mvn install
> Note: on Windows type `gradlew` without the leading `./`
Some of the code in the standard library is created by generating code from templates. See the [README](libraries/stdlib/ReadMe.md) in the stdlib section for how run the code generator. The existing templates can be used as examples for creating new ones.
Some of the code in the standard library is created by generating code from templates. See the [README](https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/ReadMe.md) in the stdlib section for how run the code generator. The existing templates can be used as examples for creating new ones.
## Submitting patches
The best way to submit a patch is to [fork the project on github](https://help.github.com/articles/fork-a-repo/) then send us a
[pull request](https://help.github.com/articles/creating-a-pull-request/) via [github](https://github.com).
The best way to submit a patch is to [fork the project on github](http://help.github.com/fork-a-repo/) then send us a
[pull request](http://help.github.com/send-pull-requests/) via [github](http://github.com).
If you create your own fork, it might help to enable rebase by default
when you pull by executing
``` bash
git config --global pull.rebase true
```
This will avoid your local repo having too many merge commits
when you pull by executing `git config --global pull.rebase
true`. This will avoid your local repo having too many merge commits
which will help keep your pull request simple and easy to apply.
## Commit comments
If you include in your comment this text (where KT-1234 is the Issue ID in the [Issue Tracker](https://youtrack.jetbrains.com/issues/KT)), the issue will get automatically marked as fixed.
If you include in your comment this text (where KT-1234 is the Issue ID in the [Issue Tracker](http://youtrack.jetbrains.com/issues/KT), the issue will get automatically marked as fixed.
#KT-1234 Fixed

View File

@@ -16,8 +16,6 @@
<property name="compiler.version.java" value="core/util.runtime/src/org/jetbrains/kotlin/config/KotlinCompilerVersion.java"/>
<property name="compiler.version.java.bk" value="${version_substitute_dir}/KotlinCompilerVersion.java.bk"/>
<property name="compiler.version.java.versioned" value="${compiler.version.java}.versioned"/>
<property name="compiler.version.number" value="${build.number}"/>
<property name="compiler.ant.fork.jvmargs" value="-Xmx1024m"/>
<property name="plugin.zip" value="${artifact.output.path}/kotlin-plugin-${build.number}.zip"/>
@@ -81,8 +79,7 @@
target.file="${compiler.version.java}"
target.file.bk="${compiler.version.java.bk}"
target.file.versioned="${compiler.version.java.versioned}"
test.string="public static final String VERSION = &quot;@snapshot@&quot;;"
version="${compiler.version.number}"/>
test.string="public static final String VERSION = &quot;@snapshot@&quot;;"/>
</target>
<target name="writePluginVersionToTemplateFile">
@@ -146,13 +143,13 @@
</macrodef>
<target name="printStatistics">
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-stdlib.jar"/>
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-runtime.jar"/>
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-reflect.jar"/>
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-stdlib-js.jar"/>
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-jslib.jar"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="kotlin.js"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="kotlin-test.js"/>
<print-file-size-statistic path="${basedir}/libraries/stdlib/js/build/classes/main" file-name="kotlin.meta.js"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="${compiled.stdlib.meta.js}"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="${compiled.stdlib.js}"/>
</target>
<target name="post_build" depends="zipArtifacts, revertTemplateFiles, printStatistics, remove_internal_artifacts, dont_remove_internal_artifacts"/>

View File

@@ -22,7 +22,7 @@ import java.io.File
class Kotlin2JsTask : KotlinCompilerBaseTask() {
override val compilerFqName = "org.jetbrains.kotlin.cli.js.K2JSCompiler"
var libraries: Path? = null
var library: Path? = null
var outputPrefix: File? = null
var outputPostfix: File? = null
var sourceMap: Boolean = false
@@ -35,9 +35,15 @@ class Kotlin2JsTask : KotlinCompilerBaseTask() {
*/
var main: String? = null
fun createLibraries(): Path {
val libraryPaths = libraries ?: return Path(getProject()).also { libraries = it }
return libraryPaths.createPath()
fun createLibrary(): Path {
val libraryPath = library
if (libraryPath == null) {
val t = Path(getProject())
library = t
return t
}
return libraryPath.createPath()
}
override fun fillSpecificArguments() {
@@ -45,9 +51,9 @@ class Kotlin2JsTask : KotlinCompilerBaseTask() {
args.add(output!!.canonicalPath)
// TODO: write test
libraries?.let {
args.add("-libraries")
args.add(it.list().joinToString(File.pathSeparator) { File(it).canonicalPath })
library?.let {
args.add("-library-files")
args.add(it.list().joinToString(separator = ",") { File(it).canonicalPath })
}
outputPrefix?.let {

View File

@@ -29,8 +29,8 @@ internal object KotlinAntTaskUtil {
private val libPath: File by lazy {
// Find path of kotlin-ant.jar in the filesystem and find kotlin-compiler.jar in the same directory
val resourcePath = "/" + this::class.java.name.replace('.', '/') + ".class"
val jarConnection = this::class.java.getResource(resourcePath).openConnection() as? JarURLConnection
val resourcePath = "/" + javaClass.name.replace('.', '/') + ".class"
val jarConnection = javaClass.getResource(resourcePath).openConnection() as? JarURLConnection
?: throw UnsupportedOperationException("Kotlin compiler Ant task should be loaded from the JAR file")
val antTaskJarPath = File(jarConnection.jarFileURL.toURI())
@@ -54,7 +54,7 @@ internal object KotlinAntTaskUtil {
val cached = classLoaderRef.get()
if (cached != null) return cached
val myLoader = this::class.java.classLoader
val myLoader = javaClass.classLoader
if (myLoader !is AntClassLoader) return myLoader
val classLoader = ClassPreloadingUtils.preloadClasses(listOf(compilerJar), Preloader.DEFAULT_CLASS_NUMBER_ESTIMATE, myLoader, null)

View File

@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.ant
import org.apache.tools.ant.BuildException
import org.apache.tools.ant.MagicNames
import org.apache.tools.ant.Project.MSG_ERR
import org.apache.tools.ant.Project.MSG_WARN
import org.apache.tools.ant.taskdefs.compilers.Javac13
import org.apache.tools.ant.taskdefs.condition.AntVersion
@@ -45,11 +44,6 @@ class KotlinCompilerAdapter : Javac13() {
@Throws(BuildException::class)
override fun execute(): Boolean {
if (javac.isForkedJavac) {
javac.log("<withKotlin> task does not yet support the fork mode", MSG_ERR)
return false
}
val javac = javac
checkAntVersion()

View File

@@ -87,7 +87,7 @@ abstract class KotlinCompilerBaseTask : Task() {
val compiler = compilerClass.newInstance()
val exec = compilerClass.getMethod("execFullPathsInMessages", PrintStream::class.java, Array<String>::class.java)
log("Compiling ${src!!.list().toList()} => [${output!!.canonicalPath}]")
log("Compiling ${src!!.list().toList()} => [${output!!.canonicalPath}]");
val result = exec(compiler, System.err, args.toTypedArray())
exitCode = (result as Enum<*>).ordinal

View File

@@ -14,6 +14,5 @@
<orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="tests-common" scope="TEST" />
<orderEntry type="library" scope="TEST" name="idea-full" level="project" />
<orderEntry type="library" name="kotlin-reflect" level="project" />
</component>
</module>

View File

@@ -1,75 +0,0 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.config.ApiVersion
import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.config.LanguageVersion
import org.jetbrains.kotlin.load.java.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
/**
* If you want to add a new field, check its type is supported by [serializeToPlainText], [deserializeFromPlainText]
*/
data class JvmBuildMetaInfo(
val isEAP: Boolean,
val compilerBuildVersion: String,
val languageVersionString: String,
val apiVersionString: String,
val coroutinesEnable: Boolean,
val coroutinesWarn: Boolean,
val coroutinesError: Boolean,
val multiplatformEnable: Boolean,
val metadataVersionMajor: Int,
val metadataVersionMinor: Int,
val metadataVersionPatch: Int,
val bytecodeVersionMajor: Int,
val bytecodeVersionMinor: Int,
val bytecodeVersionPatch: Int,
val ownVersion: Int = JvmBuildMetaInfo.OWN_VERSION,
val coroutinesVersion: Int = JvmBuildMetaInfo.COROUTINES_VERSION,
val multiplatformVersion: Int = JvmBuildMetaInfo.MULTIPLATFORM_VERSION
) {
companion object {
const val OWN_VERSION: Int = 0
const val COROUTINES_VERSION: Int = 0
const val MULTIPLATFORM_VERSION: Int = 0
fun serializeToString(info: JvmBuildMetaInfo): String =
serializeToPlainText(info)
fun deserializeFromString(str: String): JvmBuildMetaInfo? =
deserializeFromPlainText(str)
}
}
fun JvmBuildMetaInfo(args: CommonCompilerArguments): JvmBuildMetaInfo =
JvmBuildMetaInfo(isEAP = KotlinCompilerVersion.isPreRelease(),
compilerBuildVersion = KotlinCompilerVersion.VERSION,
languageVersionString = args.languageVersion ?: LanguageVersion.LATEST_STABLE.versionString,
apiVersionString = args.apiVersion ?: ApiVersion.LATEST_STABLE.versionString,
coroutinesEnable = args.coroutinesState == CommonCompilerArguments.ENABLE,
coroutinesWarn = args.coroutinesState == CommonCompilerArguments.WARN,
coroutinesError = args.coroutinesState == CommonCompilerArguments.ERROR,
multiplatformEnable = args.multiPlatform,
metadataVersionMajor = JvmMetadataVersion.INSTANCE.major,
metadataVersionMinor = JvmMetadataVersion.INSTANCE.minor,
metadataVersionPatch = JvmMetadataVersion.INSTANCE.patch,
bytecodeVersionMajor = JvmBytecodeBinaryVersion.INSTANCE.major,
bytecodeVersionMinor = JvmBytecodeBinaryVersion.INSTANCE.minor,
bytecodeVersionPatch = JvmBytecodeBinaryVersion.INSTANCE.patch)

View File

@@ -1,71 +0,0 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.build
import kotlin.reflect.KClass
import kotlin.reflect.full.memberProperties
import kotlin.reflect.full.primaryConstructor
inline fun <reified T : Any> serializeToPlainText(instance: T): String = serializeToPlainText(instance, T::class)
fun <T : Any> serializeToPlainText(instance: T, klass: KClass<T>): String {
val lines = ArrayList<String>()
for (property in klass.memberProperties) {
val value = property.get(instance)
if (value != null) {
lines.add("${property.name}=$value")
}
}
return lines.joinToString("\n")
}
inline fun <reified T : Any> deserializeFromPlainText(str: String): T? = deserializeFromPlainText(str, T::class)
fun <T : Any> deserializeFromPlainText(str: String, klass: KClass<T>): T? {
val args = ArrayList<Any?>()
val properties = str
.split("\n")
.filter(String::isNotBlank)
.associate { it.substringBefore("=") to it.substringAfter("=") }
val primaryConstructor = klass.primaryConstructor
?: throw IllegalStateException("${klass.java} does not have primary constructor")
for (param in primaryConstructor.parameters.sortedBy { it.index }) {
val argumentString = properties[param.name]
if (argumentString == null) {
if (param.type.isMarkedNullable) {
args.add(null)
continue
}
else {
return null
}
}
val argument: Any? = when (param.type.classifier) {
Int::class -> argumentString.toInt()
Boolean::class -> argumentString.toBoolean()
String::class -> argumentString
else -> throw IllegalStateException("Unexpected property type: ${param.type}")
}
args.add(argument)
}
return primaryConstructor.call(*args.toTypedArray())
}

View File

@@ -16,33 +16,32 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Function;
import com.intellij.util.containers.ComparatorUtil;
import com.sampullara.cli.Argument;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments;
import org.jetbrains.kotlin.cli.common.arguments.ParseCommandLineArgumentsKt;
import org.jetbrains.kotlin.utils.StringsKt;
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
public class ArgumentUtils {
private ArgumentUtils() {}
@NotNull
public static List<String> convertArgumentsToStringList(@NotNull CommonToolArguments arguments)
public static List<String> convertArgumentsToStringList(@NotNull CommonCompilerArguments arguments)
throws InstantiationException, IllegalAccessException {
List<String> result = new ArrayList<>();
List<String> result = new ArrayList<String>();
convertArgumentsToStringList(arguments, arguments.getClass().newInstance(), arguments.getClass(), result);
result.addAll(arguments.freeArgs);
return result;
}
private static void convertArgumentsToStringList(
@NotNull CommonToolArguments arguments,
@NotNull CommonToolArguments defaultArguments,
@NotNull CommonCompilerArguments arguments,
@NotNull CommonCompilerArguments defaultArguments,
@NotNull Class<?> clazz,
@NotNull List<String> result
) throws IllegalAccessException, InstantiationException {
@@ -61,26 +60,27 @@ public class ArgumentUtils {
continue;
}
if (value == null || Objects.equals(value, defaultValue)) continue;
if (ComparatorUtil.equalsNullable(value, defaultValue)) continue;
String name = getAlias(argument);
if (name == null) {
name = getName(argument, field);
}
Class<?> fieldType = field.getType();
if (fieldType.isArray()) {
Object[] values = (Object[]) value;
if (values.length == 0) continue;
value = StringsKt.join(Arrays.asList(values), ",");
//noinspection unchecked
value = StringUtil.join(values, Function.TO_STRING, argument.delimiter());
}
result.add(argument.value());
result.add(argument.prefix() + name);
if (fieldType == boolean.class || fieldType == Boolean.class) continue;
if (ParseCommandLineArgumentsKt.isAdvanced(argument)) {
result.set(result.size() - 1, argument.value() + "=" + value.toString());
}
else {
result.add(value.toString());
}
result.add(value.toString());
}
Class<?> superClazz = clazz.getSuperclass();
@@ -88,4 +88,14 @@ public class ArgumentUtils {
convertArgumentsToStringList(arguments, defaultArguments, superClazz, result);
}
}
private static String getAlias(Argument argument) {
String alias = argument.alias();
return alias.isEmpty() ? null : alias;
}
private static String getName(Argument argument, Field field) {
String name = argument.value();
return name.isEmpty() ? field.getName() : name;
}
}

View File

@@ -21,11 +21,10 @@ import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.load.java.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
import java.io.File
import java.io.IOException
private val NORMAL_VERSION = 8
private val EXPERIMENTAL_VERSION = 4
private val DATA_CONTAINER_VERSION = 2
private val DATA_CONTAINER_VERSION = 1
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
private val EXPERIMENTAL_VERSION_FILE_NAME = "experimental-format-version.txt"
@@ -41,16 +40,8 @@ class CacheVersion(
) {
private val isEnabled by lazy(isEnabled)
private val actualVersion: Int?
get() = try {
versionFile.readText().toInt()
}
catch (e: NumberFormatException) {
null
}
catch (e: IOException) {
null
}
private val actualVersion: Int
get() = versionFile.readText().toInt()
private val expectedVersion: Int
get() {

View File

@@ -27,7 +27,7 @@ interface ICReporter {
fun reportCompileIteration(sourceFiles: Collection<File>, exitCode: ExitCode) {}
fun pathsAsString(files: Iterable<File>): String =
files.joinToString { it.canonicalPath }
files.map { it.canonicalPath }.joinToString()
fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())

View File

@@ -43,6 +43,7 @@ import org.jetbrains.kotlin.serialization.deserialization.TypeTable
import org.jetbrains.kotlin.serialization.deserialization.supertypes
import org.jetbrains.kotlin.serialization.jvm.BitEncoding
import org.jetbrains.kotlin.serialization.jvm.JvmProtoBufUtil
import org.jetbrains.kotlin.utils.singletonOrEmptyList
import org.jetbrains.org.objectweb.asm.*
import java.io.File
import java.security.MessageDigest
@@ -271,7 +272,7 @@ open class IncrementalCacheImpl<Target>(
ProtoBuf.Class::getPropertyList
) + classData.classProto.enumEntryList.map { classData.nameResolver.getString(it.name) }
val companionObjectChanged = createChangeInfo(classFqName.parent(), listOfNotNull(classFqName.shortName().asString()))
val companionObjectChanged = createChangeInfo(classFqName.parent(), classFqName.shortName().asString().singletonOrEmptyList())
val companionObjectMembersChanged = createChangeInfo(classFqName, memberNames)
listOf(companionObjectMembersChanged, companionObjectChanged)
@@ -779,7 +780,7 @@ sealed class ChangeInfo(val fqName: FqName) {
protected open fun toStringProperties(): String = "fqName = $fqName"
override fun toString(): String {
return this::class.java.simpleName + "(${toStringProperties()})"
return this.javaClass.simpleName + "(${toStringProperties()})"
}
}

View File

@@ -26,17 +26,16 @@ class LocalFileKotlinClass private constructor(
private val file: File,
private val fileContents: ByteArray,
className: ClassId,
classVersion: Int,
classHeader: KotlinClassHeader,
innerClasses: InnerClassesInfo
) : FileBasedKotlinClass(className, classVersion, classHeader, innerClasses) {
innerClasses: FileBasedKotlinClass.InnerClassesInfo
) : FileBasedKotlinClass(className, classHeader, innerClasses) {
companion object {
fun create(file: File): LocalFileKotlinClass? {
val fileContents = file.readBytes()
return FileBasedKotlinClass.create(fileContents) {
className, classVersion, classHeader, innerClasses ->
LocalFileKotlinClass(file, fileContents, className, classVersion, classHeader, innerClasses)
className, classHeader, innerClasses ->
LocalFileKotlinClass(file, fileContents, className, classHeader, innerClasses)
}
}
}
@@ -50,5 +49,5 @@ class LocalFileKotlinClass private constructor(
override fun hashCode(): Int = file.hashCode()
override fun equals(other: Any?): Boolean = other is LocalFileKotlinClass && file == other.file
override fun toString(): String = "${this::class.java}: $file"
override fun toString(): String = "$javaClass: $file"
}

View File

@@ -197,7 +197,7 @@ open class LookupStorage(private val targetDataDir: File) : BasicMapsOwner() {
}
class LookupTrackerImpl(private val delegate: LookupTracker) : LookupTracker {
val lookups = MultiMap.createSet<LookupSymbol, String>()
val lookups = MultiMap<LookupSymbol, String>()
val pathInterner = StringInterner()
private val interner = StringInterner()

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,8 +39,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsPackageProperty(old, new)) return false
if (!checkEqualsPackageTypeAlias(old, new)) return false
if (old.hasTypeTable() != new.hasTypeTable()) return false
if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) return false
@@ -56,22 +54,14 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkStringEquals(old.getExtension(JvmProtoBuf.packageModuleName), new.getExtension(JvmProtoBuf.packageModuleName))) return false
}
if (old.getExtensionCount(JvmProtoBuf.packageLocalVariable) != new.getExtensionCount(JvmProtoBuf.packageLocalVariable)) return false
for(i in 0..old.getExtensionCount(JvmProtoBuf.packageLocalVariable) - 1) {
if (!checkEquals(old.getExtension(JvmProtoBuf.packageLocalVariable, i), new.getExtension(JvmProtoBuf.packageLocalVariable, i))) return false
}
return true
}
enum class ProtoBufPackageKind {
FUNCTION_LIST,
PROPERTY_LIST,
TYPE_ALIAS_LIST,
TYPE_TABLE,
SINCE_KOTLIN_INFO_TABLE,
PACKAGE_MODULE_NAME,
PACKAGE_LOCAL_VARIABLE_LIST
PACKAGE_MODULE_NAME
}
fun difference(old: ProtoBuf.Package, new: ProtoBuf.Package): EnumSet<ProtoBufPackageKind> {
@@ -81,8 +71,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsPackageProperty(old, new)) result.add(ProtoBufPackageKind.PROPERTY_LIST)
if (!checkEqualsPackageTypeAlias(old, new)) result.add(ProtoBufPackageKind.TYPE_ALIAS_LIST)
if (old.hasTypeTable() != new.hasTypeTable()) result.add(ProtoBufPackageKind.TYPE_TABLE)
if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufPackageKind.TYPE_TABLE)
@@ -98,12 +86,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkStringEquals(old.getExtension(JvmProtoBuf.packageModuleName), new.getExtension(JvmProtoBuf.packageModuleName))) result.add(ProtoBufPackageKind.PACKAGE_MODULE_NAME)
}
if (old.getExtensionCount(JvmProtoBuf.packageLocalVariable) != new.getExtensionCount(JvmProtoBuf.packageLocalVariable)) result.add(ProtoBufPackageKind.PACKAGE_LOCAL_VARIABLE_LIST)
for(i in 0..old.getExtensionCount(JvmProtoBuf.packageLocalVariable) - 1) {
if (!checkEquals(old.getExtension(JvmProtoBuf.packageLocalVariable, i), new.getExtension(JvmProtoBuf.packageLocalVariable, i))) result.add(ProtoBufPackageKind.PACKAGE_LOCAL_VARIABLE_LIST)
}
return result
}
@@ -134,12 +116,8 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsClassProperty(old, new)) return false
if (!checkEqualsClassTypeAlias(old, new)) return false
if (!checkEqualsClassEnumEntry(old, new)) return false
if (!checkEqualsClassSealedSubclassFqName(old, new)) return false
if (old.hasTypeTable() != new.hasTypeTable()) return false
if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) return false
@@ -160,12 +138,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkStringEquals(old.getExtension(JvmProtoBuf.classModuleName), new.getExtension(JvmProtoBuf.classModuleName))) return false
}
if (old.getExtensionCount(JvmProtoBuf.classLocalVariable) != new.getExtensionCount(JvmProtoBuf.classLocalVariable)) return false
for(i in 0..old.getExtensionCount(JvmProtoBuf.classLocalVariable) - 1) {
if (!checkEquals(old.getExtension(JvmProtoBuf.classLocalVariable, i), new.getExtension(JvmProtoBuf.classLocalVariable, i))) return false
}
return true
}
enum class ProtoBufClassKind {
@@ -179,14 +151,11 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
CONSTRUCTOR_LIST,
FUNCTION_LIST,
PROPERTY_LIST,
TYPE_ALIAS_LIST,
ENUM_ENTRY_LIST,
SEALED_SUBCLASS_FQ_NAME_LIST,
TYPE_TABLE,
SINCE_KOTLIN_INFO,
SINCE_KOTLIN_INFO_TABLE,
CLASS_MODULE_NAME,
CLASS_LOCAL_VARIABLE_LIST
CLASS_MODULE_NAME
}
fun difference(old: ProtoBuf.Class, new: ProtoBuf.Class): EnumSet<ProtoBufClassKind> {
@@ -218,12 +187,8 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsClassProperty(old, new)) result.add(ProtoBufClassKind.PROPERTY_LIST)
if (!checkEqualsClassTypeAlias(old, new)) result.add(ProtoBufClassKind.TYPE_ALIAS_LIST)
if (!checkEqualsClassEnumEntry(old, new)) result.add(ProtoBufClassKind.ENUM_ENTRY_LIST)
if (!checkEqualsClassSealedSubclassFqName(old, new)) result.add(ProtoBufClassKind.SEALED_SUBCLASS_FQ_NAME_LIST)
if (old.hasTypeTable() != new.hasTypeTable()) result.add(ProtoBufClassKind.TYPE_TABLE)
if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufClassKind.TYPE_TABLE)
@@ -244,12 +209,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkStringEquals(old.getExtension(JvmProtoBuf.classModuleName), new.getExtension(JvmProtoBuf.classModuleName))) result.add(ProtoBufClassKind.CLASS_MODULE_NAME)
}
if (old.getExtensionCount(JvmProtoBuf.classLocalVariable) != new.getExtensionCount(JvmProtoBuf.classLocalVariable)) result.add(ProtoBufClassKind.CLASS_LOCAL_VARIABLE_LIST)
for(i in 0..old.getExtensionCount(JvmProtoBuf.classLocalVariable) - 1) {
if (!checkEquals(old.getExtension(JvmProtoBuf.classLocalVariable, i), new.getExtension(JvmProtoBuf.classLocalVariable, i))) result.add(ProtoBufClassKind.CLASS_LOCAL_VARIABLE_LIST)
}
return result
}
@@ -371,46 +330,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEquals(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.hasFlags() != new.hasFlags()) return false
if (old.hasFlags()) {
if (old.flags != new.flags) return false
}
if (!checkStringEquals(old.name, new.name)) return false
if (!checkEqualsTypeAliasTypeParameter(old, new)) return false
if (old.hasUnderlyingType() != new.hasUnderlyingType()) return false
if (old.hasUnderlyingType()) {
if (!checkEquals(old.underlyingType, new.underlyingType)) return false
}
if (old.hasUnderlyingTypeId() != new.hasUnderlyingTypeId()) return false
if (old.hasUnderlyingTypeId()) {
if (old.underlyingTypeId != new.underlyingTypeId) return false
}
if (old.hasExpandedType() != new.hasExpandedType()) return false
if (old.hasExpandedType()) {
if (!checkEquals(old.expandedType, new.expandedType)) return false
}
if (old.hasExpandedTypeId() != new.hasExpandedTypeId()) return false
if (old.hasExpandedTypeId()) {
if (old.expandedTypeId != new.expandedTypeId) return false
}
if (!checkEqualsTypeAliasAnnotation(old, new)) return false
if (old.hasSinceKotlinInfo() != new.hasSinceKotlinInfo()) return false
if (old.hasSinceKotlinInfo()) {
if (old.sinceKotlinInfo != new.sinceKotlinInfo) return false
}
return true
}
open fun checkEquals(old: ProtoBuf.TypeTable, new: ProtoBuf.TypeTable): Boolean {
if (!checkEqualsTypeTableType(old, new)) return false
@@ -494,11 +413,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkStringEquals(old.typeParameterName, new.typeParameterName)) return false
}
if (old.hasTypeAliasName() != new.hasTypeAliasName()) return false
if (old.hasTypeAliasName()) {
if (!checkClassIdEquals(old.typeAliasName, new.typeAliasName)) return false
}
if (old.hasOuterType() != new.hasOuterType()) return false
if (old.hasOuterType()) {
if (!checkEquals(old.outerType, new.outerType)) return false
@@ -509,21 +423,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (old.outerTypeId != new.outerTypeId) return false
}
if (old.hasAbbreviatedType() != new.hasAbbreviatedType()) return false
if (old.hasAbbreviatedType()) {
if (!checkEquals(old.abbreviatedType, new.abbreviatedType)) return false
}
if (old.hasAbbreviatedTypeId() != new.hasAbbreviatedTypeId()) return false
if (old.hasAbbreviatedTypeId()) {
if (old.abbreviatedTypeId != new.abbreviatedTypeId) return false
}
if (old.hasFlags() != new.hasFlags()) return false
if (old.hasFlags()) {
if (old.flags != new.flags) return false
}
if (old.getExtensionCount(JvmProtoBuf.typeAnnotation) != new.getExtensionCount(JvmProtoBuf.typeAnnotation)) return false
for(i in 0..old.getExtensionCount(JvmProtoBuf.typeAnnotation) - 1) {
@@ -637,14 +536,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEquals(old: ProtoBuf.Annotation, new: ProtoBuf.Annotation): Boolean {
if (!checkClassIdEquals(old.id, new.id)) return false
if (!checkEqualsAnnotationArgument(old, new)) return false
return true
}
open fun checkEquals(old: ProtoBuf.SinceKotlinInfo, new: ProtoBuf.SinceKotlinInfo): Boolean {
if (old.hasVersion() != new.hasVersion()) return false
if (old.hasVersion()) {
@@ -674,6 +565,14 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEquals(old: ProtoBuf.Annotation, new: ProtoBuf.Annotation): Boolean {
if (!checkClassIdEquals(old.id, new.id)) return false
if (!checkEqualsAnnotationArgument(old, new)) return false
return true
}
open fun checkEquals(old: ProtoBuf.Type.Argument, new: ProtoBuf.Type.Argument): Boolean {
if (old.hasProjection() != new.hasProjection()) return false
if (old.hasProjection()) {
@@ -781,16 +680,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsPackageTypeAlias(old: ProtoBuf.Package, new: ProtoBuf.Package): Boolean {
if (old.typeAliasCount != new.typeAliasCount) return false
for(i in 0..old.typeAliasCount - 1) {
if (!checkEquals(old.getTypeAlias(i), new.getTypeAlias(i))) return false
}
return true
}
open fun checkEqualsClassTypeParameter(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -861,16 +750,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsClassTypeAlias(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.typeAliasCount != new.typeAliasCount) return false
for(i in 0..old.typeAliasCount - 1) {
if (!checkEquals(old.getTypeAlias(i), new.getTypeAlias(i))) return false
}
return true
}
open fun checkEqualsClassEnumEntry(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.enumEntryCount != new.enumEntryCount) return false
@@ -881,16 +760,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsClassSealedSubclassFqName(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.sealedSubclassFqNameCount != new.sealedSubclassFqNameCount) return false
for(i in 0..old.sealedSubclassFqNameCount - 1) {
if (!checkClassIdEquals(old.getSealedSubclassFqName(i), new.getSealedSubclassFqName(i))) return false
}
return true
}
open fun checkEqualsFunctionTypeParameter(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -921,26 +790,6 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsTypeAliasTypeParameter(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
for(i in 0..old.typeParameterCount - 1) {
if (!checkEquals(old.getTypeParameter(i), new.getTypeParameter(i))) return false
}
return true
}
open fun checkEqualsTypeAliasAnnotation(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.annotationCount != new.annotationCount) return false
for(i in 0..old.annotationCount - 1) {
if (!checkEquals(old.getAnnotation(i), new.getAnnotation(i))) return false
}
return true
}
open fun checkEqualsTypeTableType(old: ProtoBuf.TypeTable, new: ProtoBuf.TypeTable): Boolean {
if (old.typeCount != new.typeCount) return false
@@ -1063,10 +912,6 @@ fun ProtoBuf.Package.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + getProperty(i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..typeAliasCount - 1) {
hashCode = 31 * hashCode + getTypeAlias(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasTypeTable()) {
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
@@ -1079,10 +924,6 @@ fun ProtoBuf.Package.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + stringIndexes(getExtension(JvmProtoBuf.packageModuleName))
}
for(i in 0..getExtensionCount(JvmProtoBuf.packageLocalVariable) - 1) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.packageLocalVariable, i).hashCode(stringIndexes, fqNameIndexes)
}
return hashCode
}
@@ -1127,18 +968,10 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + getProperty(i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..typeAliasCount - 1) {
hashCode = 31 * hashCode + getTypeAlias(i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..enumEntryCount - 1) {
hashCode = 31 * hashCode + getEnumEntry(i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..sealedSubclassFqNameCount - 1) {
hashCode = 31 * hashCode + fqNameIndexes(getSealedSubclassFqName(i))
}
if (hasTypeTable()) {
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
@@ -1155,10 +988,6 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + stringIndexes(getExtension(JvmProtoBuf.classModuleName))
}
for(i in 0..getExtensionCount(JvmProtoBuf.classLocalVariable) - 1) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.classLocalVariable, i).hashCode(stringIndexes, fqNameIndexes)
}
return hashCode
}
@@ -1270,46 +1099,6 @@ fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
return hashCode
}
fun ProtoBuf.TypeAlias.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasFlags()) {
hashCode = 31 * hashCode + flags
}
hashCode = 31 * hashCode + stringIndexes(name)
for(i in 0..typeParameterCount - 1) {
hashCode = 31 * hashCode + getTypeParameter(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasUnderlyingType()) {
hashCode = 31 * hashCode + underlyingType.hashCode(stringIndexes, fqNameIndexes)
}
if (hasUnderlyingTypeId()) {
hashCode = 31 * hashCode + underlyingTypeId
}
if (hasExpandedType()) {
hashCode = 31 * hashCode + expandedType.hashCode(stringIndexes, fqNameIndexes)
}
if (hasExpandedTypeId()) {
hashCode = 31 * hashCode + expandedTypeId
}
for(i in 0..annotationCount - 1) {
hashCode = 31 * hashCode + getAnnotation(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasSinceKotlinInfo()) {
hashCode = 31 * hashCode + sinceKotlinInfo
}
return hashCode
}
fun ProtoBuf.TypeTable.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
@@ -1399,10 +1188,6 @@ fun ProtoBuf.Type.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + stringIndexes(typeParameterName)
}
if (hasTypeAliasName()) {
hashCode = 31 * hashCode + fqNameIndexes(typeAliasName)
}
if (hasOuterType()) {
hashCode = 31 * hashCode + outerType.hashCode(stringIndexes, fqNameIndexes)
}
@@ -1411,18 +1196,6 @@ fun ProtoBuf.Type.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + outerTypeId
}
if (hasAbbreviatedType()) {
hashCode = 31 * hashCode + abbreviatedType.hashCode(stringIndexes, fqNameIndexes)
}
if (hasAbbreviatedTypeId()) {
hashCode = 31 * hashCode + abbreviatedTypeId
}
if (hasFlags()) {
hashCode = 31 * hashCode + flags
}
for(i in 0..getExtensionCount(JvmProtoBuf.typeAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.typeAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1530,18 +1303,6 @@ fun JvmProtoBuf.JvmPropertySignature.hashCode(stringIndexes: (Int) -> Int, fqNam
return hashCode
}
fun ProtoBuf.Annotation.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
hashCode = 31 * hashCode + fqNameIndexes(id)
for(i in 0..argumentCount - 1) {
hashCode = 31 * hashCode + getArgument(i).hashCode(stringIndexes, fqNameIndexes)
}
return hashCode
}
fun ProtoBuf.SinceKotlinInfo.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
@@ -1568,6 +1329,18 @@ fun ProtoBuf.SinceKotlinInfo.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes
return hashCode
}
fun ProtoBuf.Annotation.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
hashCode = 31 * hashCode + fqNameIndexes(id)
for(i in 0..argumentCount - 1) {
hashCode = 31 * hashCode + getArgument(i).hashCode(stringIndexes, fqNameIndexes)
}
return hashCode
}
fun ProtoBuf.Type.Argument.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1

View File

@@ -19,6 +19,7 @@
package org.jetbrains.kotlin.incremental
import com.intellij.ide.highlighter.JavaFileType
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.build.GeneratedFile
@@ -41,7 +42,9 @@ import java.util.*
fun Iterable<File>.javaSourceRoots(roots: Iterable<File>): Iterable<File> =
filter(File::isJavaFile).mapNotNull { findSrcDirRoot(it, roots) }
filter { it.isJavaFile() }
.map { findSrcDirRoot(it, roots) }
.filterNotNull()
fun makeModuleFile(name: String, isTest: Boolean, outputDir: File, sourcesToCompile: Iterable<File>, javaSourceRoots: Iterable<File>, classpath: Iterable<File>, friendDirs: Iterable<File>): File {
val builder = KotlinModuleXmlBuilder()
@@ -51,7 +54,6 @@ fun makeModuleFile(name: String, isTest: Boolean, outputDir: File, sourcesToComp
sourcesToCompile,
javaSourceRoots.map { JvmSourceRoot(it) },
classpath,
null,
"java-production",
isTest,
// this excludes the output directories from the class path, to be removed for true incremental compilation
@@ -143,7 +145,7 @@ fun LookupStorage.update(
filesToCompile: Iterable<File>,
removedFiles: Iterable<File>
) {
if (lookupTracker !is LookupTrackerImpl) throw AssertionError("Lookup tracker is expected to be LookupTrackerImpl, got ${lookupTracker::class.java}")
if (lookupTracker !is LookupTrackerImpl) throw AssertionError("Lookup tracker is expected to be LookupTrackerImpl, got ${lookupTracker.javaClass}")
removeLookupsFrom(filesToCompile.asSequence() + removedFiles.asSequence())
@@ -164,13 +166,12 @@ fun<Target> OutputItemsCollectorImpl.generatedFiles(
return outputs.map { outputItem ->
val target =
outputItem.sourceFiles.firstOrNull()?.let { sourceToTarget[it] } ?:
targets.singleOrNull { getOutputDir(it)?.let { outputItem.outputFile.startsWith(it) } ?: false } ?:
targets.filter { getOutputDir(it)?.let { outputItem.outputFile.startsWith(it) } ?: false }.singleOrNull() ?:
representativeTarget
when (outputItem.outputFile.extension) {
"class" -> GeneratedJvmClass(target, outputItem.sourceFiles, outputItem.outputFile)
else -> GeneratedFile(target, outputItem.sourceFiles, outputItem.outputFile)
}
if (outputItem.outputFile.name.endsWith(".class"))
GeneratedJvmClass(target, outputItem.sourceFiles, outputItem.outputFile)
else
GeneratedFile(target, outputItem.sourceFiles, outputItem.outputFile)
}
}

View File

@@ -56,7 +56,6 @@ internal val MessageLite.isPrivate: Boolean
is ProtoBuf.Constructor -> Flags.VISIBILITY.get(flags)
is ProtoBuf.Function -> Flags.VISIBILITY.get(flags)
is ProtoBuf.Property -> Flags.VISIBILITY.get(flags)
is ProtoBuf.TypeAlias -> Flags.VISIBILITY.get(flags)
else -> error("Unknown message: $this")
}))
@@ -65,7 +64,6 @@ private fun MessageLite.name(nameResolver: NameResolver): String {
is ProtoBuf.Constructor -> "<init>"
is ProtoBuf.Function -> nameResolver.getString(name)
is ProtoBuf.Property -> nameResolver.getString(name)
is ProtoBuf.TypeAlias -> nameResolver.getString(name)
else -> error("Unknown message: $this")
}
}
@@ -142,7 +140,6 @@ private abstract class DifferenceCalculator() {
is ProtoBuf.Constructor -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Function -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Property -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.TypeAlias -> hashCode(stringIndexes, fqNameIndexes)
else -> error("Unknown message: $this")
}
}
@@ -152,7 +149,6 @@ private abstract class DifferenceCalculator() {
old is ProtoBuf.Constructor && new is ProtoBuf.Constructor -> checkEquals(old, new)
old is ProtoBuf.Function && new is ProtoBuf.Function -> checkEquals(old, new)
old is ProtoBuf.Property && new is ProtoBuf.Property -> checkEquals(old, new)
old is ProtoBuf.TypeAlias && new is ProtoBuf.TypeAlias -> checkEquals(old, new)
else -> error("Unknown message: $this")
}
}
@@ -186,8 +182,7 @@ private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: Prot
}
for (kind in diff) {
@Suppress("UNUSED_VARIABLE") // To make this 'when' exhaustive
val unused: Any = when (kind!!) {
when (kind!!) {
ProtoBufClassKind.COMPANION_OBJECT_NAME -> {
if (oldProto.hasCompanionObjectName()) oldProto.companionObjectName.oldToNames()
if (newProto.hasCompanionObjectName()) newProto.companionObjectName.newToNames()
@@ -204,27 +199,21 @@ private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: Prot
}
ProtoBufClassKind.CONSTRUCTOR_LIST -> {
val differentNonPrivateConstructors = calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getConstructorList)
isClassAffected = isClassAffected || differentNonPrivateConstructors.isNotEmpty()
if (differentNonPrivateConstructors.isNotEmpty()) {
isClassAffected = true
}
}
ProtoBufClassKind.FUNCTION_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getFunctionList))
ProtoBufClassKind.PROPERTY_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getPropertyList))
ProtoBufClassKind.TYPE_ALIAS_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getTypeAliasList))
ProtoBufClassKind.ENUM_ENTRY_LIST -> {
isClassAffected = true
}
ProtoBufClassKind.SEALED_SUBCLASS_FQ_NAME_LIST -> {
// TODO
}
ProtoBufClassKind.TYPE_TABLE -> {
// TODO
}
ProtoCompareGenerated.ProtoBufClassKind.SINCE_KOTLIN_INFO,
ProtoCompareGenerated.ProtoBufClassKind.SINCE_KOTLIN_INFO_TABLE -> {
// TODO
}
ProtoBufClassKind.FLAGS,
ProtoBufClassKind.FQ_NAME,
ProtoBufClassKind.TYPE_PARAMETER_LIST,
@@ -236,9 +225,6 @@ private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: Prot
ProtoBufClassKind.CLASS_MODULE_NAME -> {
// TODO
}
ProtoBufClassKind.CLASS_LOCAL_VARIABLE_LIST -> {
// Not affected, local variables are not accessible outside of a file
}
}
}
@@ -268,22 +254,17 @@ private class DifferenceCalculatorForPackageFacade(oldData: ProtoMapValue, newDa
}
for (kind in diff) {
@Suppress("UNUSED_VARIABLE") // To make this 'when' exhaustive
val unused: Any = when (kind!!) {
when (kind!!) {
ProtoBufPackageKind.FUNCTION_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getFunctionList))
ProtoBufPackageKind.PROPERTY_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getPropertyList))
ProtoBufPackageKind.TYPE_ALIAS_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getTypeAliasList))
ProtoBufPackageKind.TYPE_TABLE,
ProtoBufPackageKind.SINCE_KOTLIN_INFO_TABLE,
ProtoBufPackageKind.PACKAGE_MODULE_NAME -> {
// TODO
}
ProtoBufPackageKind.PACKAGE_LOCAL_VARIABLE_LIST -> {
// Not affected, local variables are not accessible outside of a file
}
else -> throw IllegalArgumentException("Unsupported kind: $kind")
}
}

View File

@@ -46,7 +46,7 @@ abstract class BasicMap<K : Comparable<K>, V>(
fun dump(): String {
return with(StringBuilder()) {
with(Printer(this)) {
println(this@BasicMap::class.java.simpleName)
println(this@BasicMap.javaClass.simpleName)
pushIndent()
for (key in storage.keys.sorted()) {

View File

@@ -42,5 +42,5 @@ open class BasicMapsOwner {
maps.forEach { it.flush(memoryCachesOnly) }
}
@TestOnly fun dump(): String = maps.joinToString("\n\n") { it.dump() }
@TestOnly fun dump(): String = maps.map { it.dump() }.joinToString("\n\n")
}

View File

@@ -131,7 +131,7 @@ object ConstantsMapExternalizer : DataExternalizer<Map<String, Any>> {
output.writeByte(Kind.STRING.ordinal)
IOUtil.writeString(value, output)
}
else -> throw IllegalStateException("Unexpected constant class: ${value::class.java}")
else -> throw IllegalStateException("Unexpected constant class: ${value.javaClass}")
}
}
}

View File

@@ -39,7 +39,6 @@ class KotlinModuleXmlBuilder {
sourceFiles: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpathRoots: Iterable<File>,
modularJdkRoot: File?,
targetTypeId: String,
isTests: Boolean,
directoriesToFilterOut: Set<File>,
@@ -65,10 +64,6 @@ class KotlinModuleXmlBuilder {
processJavaSourceRoots(javaSourceRoots)
processClasspath(classpathRoots, directoriesToFilterOut)
if (modularJdkRoot != null) {
p.println("<", MODULAR_JDK_ROOT, " ", PATH, "=\"", getEscapedPath(modularJdkRoot), "\"/>")
}
closeTag(p, MODULE)
return this
}

View File

@@ -1,75 +0,0 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.build
import junit.framework.TestCase
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.junit.Assert.assertNotEquals
import org.junit.Test
class JvmBuildMetaInfoTest : TestCase() {
@Test
fun testSerialization() {
val args = K2JVMCompilerArguments()
val info = JvmBuildMetaInfo(args)
val actual = JvmBuildMetaInfo.serializeToString(info)
val expectedKeys = listOf(
"apiVersionString",
"bytecodeVersionMajor",
"bytecodeVersionMinor",
"bytecodeVersionPatch",
"compilerBuildVersion",
"coroutinesEnable",
"coroutinesError",
"coroutinesVersion",
"coroutinesWarn",
"isEAP",
"languageVersionString",
"metadataVersionMajor",
"metadataVersionMinor",
"metadataVersionPatch",
"multiplatformEnable",
"multiplatformVersion",
"ownVersion"
)
assertEquals(expectedKeys, actual.split("\r\n", "\n").map { line -> line.split("=").first() })
}
@Test
fun testSerializationDeserialization() {
val args = K2JVMCompilerArguments()
val info = JvmBuildMetaInfo(args)
val serialized = JvmBuildMetaInfo.serializeToString(info)
val deserialized = JvmBuildMetaInfo.deserializeFromString(serialized)
assertEquals(info, deserialized)
}
@Test
fun testEquals() {
val args1 = K2JVMCompilerArguments()
args1.coroutinesState = CommonCompilerArguments.ENABLE
val info1 = JvmBuildMetaInfo(args1)
val args2 = K2JVMCompilerArguments()
args2.coroutinesState = CommonCompilerArguments.WARN
val info2 = JvmBuildMetaInfo(args2)
assertNotEquals(info1, info2)
assertEquals(info1, info2.copy(coroutinesEnable = true, coroutinesWarn = false))
}
}

View File

@@ -1,55 +0,0 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.build
import junit.framework.TestCase
import org.junit.Test
class SerializationUtilsTest : TestCase() {
data class TestPropertyTypes(
val intNull: Int?,
val int: Int,
val stringNull: String?,
val string: String,
val boolNull: Boolean?,
val bool: Boolean
)
@Test
fun testPropertyTypes() {
val instance1 = TestPropertyTypes(null, 1, null, "abc", null, false)
val deserialized1 = deserializeFromPlainText<TestPropertyTypes>(serializeToPlainText(instance1))
assertEquals(instance1, deserialized1)
val instance2 = TestPropertyTypes(1, 2, "abc", "xyz", true, false)
val deserialized2 = deserializeFromPlainText<TestPropertyTypes>(serializeToPlainText(instance2))
assertEquals(instance2, deserialized2)
}
data class TestAddedField1(val x: Int)
data class TestAddedField2(val x: Int, val y: Int?)
@Test
fun testAddedField() {
val testAddedField1 = TestAddedField1(1)
val serialized = serializeToPlainText(testAddedField1)
val deserialized = deserializeFromPlainText<TestAddedField2>(serialized)
assertEquals(TestAddedField2(1, null), deserialized)
}
}

View File

@@ -144,7 +144,7 @@ private fun classFileToString(classFile: File): String {
out.write("\n------ string table types proto -----\n${DebugJvmProtoBuf.StringTableTypes.parseDelimitedFrom(input)}")
if (!classHeader.metadataVersion.isCompatible()) {
if (!classHeader!!.metadataVersion.isCompatible()) {
error("Incompatible class ($classHeader): $classFile")
}

View File

@@ -81,8 +81,8 @@ fun getModificationsToPerform(
val rules = mapOf<String, (String, File) -> Modification>(
newSuffix to { path, file -> ModifyContent(path, file) },
touchSuffix to { path, _ -> TouchFile(path, touchPolicy) },
deleteSuffix to { path, _ -> DeleteFile(path) }
touchSuffix to { path, file -> TouchFile(path, touchPolicy) },
deleteSuffix to { path, file -> DeleteFile(path) }
)
val modifications = ArrayList<Modification>()
@@ -130,7 +130,7 @@ fun getModificationsToPerform(
abstract class Modification(val path: String) {
abstract fun perform(workDir: File, mapping: MutableMap<File, File>)
override fun toString(): String = "${this::class.java.simpleName} $path"
override fun toString(): String = "${javaClass.simpleName} $path"
}
class ModifyContent(path: String, val dataFile: File) : Modification(path) {

View File

@@ -14,9 +14,7 @@ public final class DebugJvmProtoBuf {
registry.add(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.isRaw);
registry.add(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.typeParameterAnnotation);
registry.add(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.classModuleName);
registry.add(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.classLocalVariable);
registry.add(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.packageModuleName);
registry.add(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.packageLocalVariable);
}
public interface StringTableTypesOrBuilder extends
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.jvm.StringTableTypes)
@@ -4588,17 +4586,6 @@ public final class DebugJvmProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int CLASS_LOCAL_VARIABLE_FIELD_NUMBER = 102;
/**
* <code>extend .org.jetbrains.kotlin.serialization.Class { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.serialization.DebugProtoBuf.Class,
java.util.List<org.jetbrains.kotlin.serialization.DebugProtoBuf.Property>> classLocalVariable = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.serialization.DebugProtoBuf.Property.class,
org.jetbrains.kotlin.serialization.DebugProtoBuf.Property.getDefaultInstance());
public static final int PACKAGE_MODULE_NAME_FIELD_NUMBER = 101;
/**
* <code>extend .org.jetbrains.kotlin.serialization.Package { ... }</code>
@@ -4610,17 +4597,6 @@ public final class DebugJvmProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int PACKAGE_LOCAL_VARIABLE_FIELD_NUMBER = 102;
/**
* <code>extend .org.jetbrains.kotlin.serialization.Package { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.serialization.DebugProtoBuf.Package,
java.util.List<org.jetbrains.kotlin.serialization.DebugProtoBuf.Property>> packageLocalVariable = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.serialization.DebugProtoBuf.Property.class,
org.jetbrains.kotlin.serialization.DebugProtoBuf.Property.getDefaultInstance());
private static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_descriptor;
private static
@@ -4702,15 +4678,9 @@ public final class DebugJvmProtoBuf {
"g.jetbrains.kotlin.serialization.Annotat" +
"ion:J\n\021class_module_name\022).org.jetbrains" +
".kotlin.serialization.Class\030e \001(\005B\004\230\265\030\001:" +
"u\n\024class_local_variable\022).org.jetbrains." +
"kotlin.serialization.Class\030f \003(\0132,.org.j" +
"etbrains.kotlin.serialization.Property:N",
"\n\023package_module_name\022+.org.jetbrains.ko" +
"tlin.serialization.Package\030e \001(\005B\004\230\265\030\001:y" +
"\n\026package_local_variable\022+.org.jetbrains" +
".kotlin.serialization.Package\030f \003(\0132,.or" +
"g.jetbrains.kotlin.serialization.Propert" +
"yB\022B\020DebugJvmProtoBuf"
"N\n\023package_module_name\022+.org.jetbrains.k" +
"otlin.serialization.Package\030e \001(\005B\004\230\265\030\001B" +
"\022B\020DebugJvmProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4763,9 +4733,7 @@ public final class DebugJvmProtoBuf {
isRaw.internalInit(descriptor.getExtensions().get(4));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(5));
classModuleName.internalInit(descriptor.getExtensions().get(6));
classLocalVariable.internalInit(descriptor.getExtensions().get(7));
packageModuleName.internalInit(descriptor.getExtensions().get(8));
packageLocalVariable.internalInit(descriptor.getExtensions().get(9));
packageModuleName.internalInit(descriptor.getExtensions().get(7));
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry =
org.jetbrains.kotlin.protobuf.ExtensionRegistry.newInstance();
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.stringIdInTable);

843
build.xml

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked into Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
tested.project.dir=tested-module

View File

@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -64,27 +64,10 @@ android {
dexOptions {
dexInProcess false
javaMaxHeapSize "300m"
//default is 4 and Total Memory = maxProcessCount * javaMaxHeapSize
maxProcessCount 1
additionalParameters "--debug"
javaMaxHeapSize "600m"
}
}
task jarTestFolders() {
println "Jar folders..."
new File("${projectDir}/libs/").listFiles().each { File file ->
if (file.isDirectory()) {
println "Jar '${file.name}' folder..."
ant.jar(basedir: "libs/${file.name}/", destfile: "libs/" + file.name + ".jar")
}
}
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn jarTestFolders
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile 'junit:junit:4.12'

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="testsForAndroid" default="help" basedir="">
<property file="local.properties"/>
<property file="ant.properties"/>
<loadproperties srcFile="project.properties"/>
<import file="custom_rules.xml" optional="true"/>
<import file="${sdk.dir}/tools/ant/build.xml"/>
<target name="pack_libraries">
<jar basedir="libs/codegen-test-output" destfile="libs/test.jar"/>
<delete dir="libs/codegen-test-output"/>
</target>
</project>

View File

@@ -1,2 +0,0 @@
#don't try to download android specific tools within gradle: licence acceptance will be required
android.builder.sdkDownload=false

View File

@@ -20,6 +20,7 @@ import com.intellij.util.PlatformUtils;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.android.tests.ant.AntRunner;
import org.jetbrains.kotlin.android.tests.download.SDKDownloader;
import org.jetbrains.kotlin.android.tests.emulator.Emulator;
import org.jetbrains.kotlin.android.tests.gradle.GradleRunner;
@@ -82,6 +83,8 @@ public class CodegenTestsOnAndroidRunner {
downloader.unzipAll();
PermissionManager.setPermissions(pathManager);
AntRunner antRunner = new AntRunner(pathManager);
antRunner.packLibraries();
Emulator emulator = new Emulator(pathManager, Emulator.ARM);
GradleRunner gradleRunner = new GradleRunner(pathManager);
gradleRunner.clean();
@@ -148,7 +151,7 @@ public class CodegenTestsOnAndroidRunner {
for (int i = 0; i < testCases.getLength(); i++) {
Element item = (Element) testCases.item(i);
NodeList failure = item.getElementsByTagName("failure");
final NodeList failure = item.getElementsByTagName("failure");
String name = item.getAttribute("name");
String clazz = item.getAttribute("classname");

View File

@@ -16,8 +16,6 @@
package org.jetbrains.kotlin.android.tests;
import org.jetbrains.kotlin.android.tests.download.SDKDownloader;
import java.io.File;
public class PathManager {
@@ -52,8 +50,8 @@ public class PathManager {
return getAndroidSdkRoot() + "/build-tools";
}
public String getOutputForCompiledFiles(int index) {
return tmpFolder + "/libs/libtest" + index;
public String getOutputForCompiledFiles() {
return tmpFolder + "/libs/codegen-test-output";
}
public String getLibsFolderInAndroidTestedModuleTmpFolder() {
@@ -77,13 +75,17 @@ public class PathManager {
}
public String getGradleBinFolder() {
return getDependenciesRoot() + "/gradle-" + SDKDownloader.GRADLE_VERSION + "/bin";
return getDependenciesRoot() + "/gradle-2.12/bin";
}
public String getRootForDownload() {
return getDependenciesRoot() + "/download";
}
public String getAntBinDirectory() {
return rootFolder + "/dependencies/ant-1.8/bin";
}
public String getAndroidModuleRoot() {
return rootFolder + "/compiler/android-tests/android-module";
}

View File

@@ -0,0 +1,105 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.android.tests.ant;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.openapi.util.SystemInfo;
import org.jetbrains.kotlin.android.tests.OutputUtils;
import org.jetbrains.kotlin.android.tests.PathManager;
import org.jetbrains.kotlin.android.tests.run.RunResult;
import org.jetbrains.kotlin.android.tests.run.RunUtils;
import org.jetbrains.kotlin.utils.ExceptionUtilsKt;
import java.util.ArrayList;
import java.util.List;
public class AntRunner {
private final List<String> listOfAntCommands;
public AntRunner(PathManager pathManager) {
listOfAntCommands = new ArrayList<String>();
String antCmdName = SystemInfo.isWindows ? "ant.bat" : "ant";
listOfAntCommands.add(pathManager.getAntBinDirectory() + "/" + antCmdName);
listOfAntCommands.add("-Dsdk.dir=" + pathManager.getAndroidSdkRoot());
listOfAntCommands.add("-buildfile");
listOfAntCommands.add(pathManager.getTmpFolder() + "/build.xml");
}
/* Pack compiled sources on first step to one jar file */
public void packLibraries() {
System.out.println("Pack libraries...");
RunResult result = RunUtils.execute(generateCommandLine("pack_libraries"));
OutputUtils.checkResult(result);
}
/* Clean output directory */
public void cleanOutput() {
System.out.println("Clearing output directory...");
RunResult result = RunUtils.execute(generateCommandLine("clean"));
OutputUtils.checkResult(result);
}
public void compileSources() {
System.out.println("Compiling sources...");
RunResult result = RunUtils.execute(generateCommandLine("debug"));
OutputUtils.checkResult(result);
}
public void installApplicationOnEmulator() {
System.out.println("Installing apk...");
RunResult result = RunUtils.execute(generateCommandLine("installt"));
String resultOutput = result.getOutput();
if (!isInstallSuccessful(resultOutput)) {
installApplicationOnEmulator();
return;
}
else {
if (result.getStatus()) {
System.out.println(resultOutput);
}
}
OutputUtils.checkResult(result);
}
public String runTestsOnEmulator() {
System.out.println("Running tests...");
RunResult result = RunUtils.execute(generateCommandLine("test"));
String resultOutput = result.getOutput();
OutputUtils.checkResult(result);
return resultOutput;
}
private static boolean isInstallSuccessful(String output) {
if (output.contains("Is the system running?")) {
System.out.println("Device not ready. Waiting for 20 sec.");
try {
Thread.sleep(20000);
}
catch (InterruptedException e) {
throw ExceptionUtilsKt.rethrow(e);
}
return false;
}
return true;
}
private GeneralCommandLine generateCommandLine(String taskName) {
GeneralCommandLine commandLine = new GeneralCommandLine(listOfAntCommands);
commandLine.addParameter(taskName);
return commandLine;
}
}

View File

@@ -43,7 +43,6 @@ public class SDKDownloader {
private static final String SDK_TOOLS = "25.1.1";
public static final String BUILD_TOOLS = "23.0.3";
private static final int ANDROID_VERSION = 19;
public static final String GRADLE_VERSION = "2.14.1";
public SDKDownloader(PathManager pathManager) {
@@ -54,7 +53,7 @@ public class SDKDownloader {
platformToolsZipPath = pathManager.getRootForDownload() + "/platform-tools.zip";
skdToolsZipPath = pathManager.getRootForDownload() + "/tools.zip";
buildToolsZipPath = pathManager.getRootForDownload() + "/build-tools.zip";
gradleZipPath = pathManager.getRootForDownload() + "/gradle" + GRADLE_VERSION + ".zip";
gradleZipPath = pathManager.getRootForDownload() + "/gradle.zip";
}
public void downloadPlatform() {
@@ -79,7 +78,7 @@ public class SDKDownloader {
}
public void downloadGradle() {
download("https://services.gradle.org/distributions/gradle-" + GRADLE_VERSION + "-bin.zip", gradleZipPath);
download("https://services.gradle.org/distributions/gradle-2.12-bin.zip", gradleZipPath);
}
private static String getDownloadUrl(String prefix) {
@@ -195,18 +194,21 @@ public class SDKDownloader {
}
try {
byte[] buf = new byte[1024];
ZipEntry zipEntry = null;
try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(pathToFile))) {
zipEntry = zipInputStream.getNextEntry();
while (zipEntry != null) {
String entryName = zipEntry.getName();
ZipInputStream zipinputstream;
ZipEntry zipentry;
zipinputstream = new ZipInputStream(new FileInputStream(pathToFile));
zipentry = zipinputstream.getNextEntry();
try {
while (zipentry != null) {
String entryName = zipentry.getName();
int n;
File outputFile = new File(outputFolder + "/" + entryName);
if (zipEntry.isDirectory()) {
if (zipentry.isDirectory()) {
outputFile.mkdirs();
zipInputStream.closeEntry();
zipEntry = zipInputStream.getNextEntry();
zipinputstream.closeEntry();
zipentry = zipinputstream.getNextEntry();
continue;
}
else {
@@ -217,19 +219,23 @@ public class SDKDownloader {
outputFile.createNewFile();
}
try (FileOutputStream fileOutputStream = new FileOutputStream(outputFile)) {
while ((n = zipInputStream.read(buf, 0, 1024)) > -1) {
fileOutputStream.write(buf, 0, n);
FileOutputStream fileoutputstream = new FileOutputStream(outputFile);
try {
while ((n = zipinputstream.read(buf, 0, 1024)) > -1) {
fileoutputstream.write(buf, 0, n);
}
}
zipInputStream.closeEntry();
zipEntry = zipInputStream.getNextEntry();
finally {
fileoutputstream.close();
}
zipinputstream.closeEntry();
zipentry = zipinputstream.getNextEntry();
}
zipinputstream.close();
}
catch (IOException e) {
if (zipEntry != null) {
System.err.println("Entry name: " + zipEntry.getName());
}
System.err.println("Entry name: " + zipentry.getName());
e.printStackTrace();
}
}

View File

@@ -30,7 +30,7 @@ public class GradleRunner {
private final List<String> listOfCommands;
public GradleRunner(PathManager pathManager) {
listOfCommands = new ArrayList<>();
listOfCommands = new ArrayList<String>();
String cmdName = SystemInfo.isWindows ? "gradle.bat" : "gradle";
listOfCommands.add(pathManager.getGradleBinFolder() + "/" + cmdName);
listOfCommands.add("--build-file");
@@ -46,9 +46,7 @@ public class GradleRunner {
public void build() {
System.out.println("Building gradle project...");
GeneralCommandLine build = generateCommandLine("build");
build.addParameter("--stacktrace");
RunResult result = RunUtils.execute(build);
RunResult result = RunUtils.execute(generateCommandLine("build"));
OutputUtils.checkResult(result);
}

View File

@@ -29,6 +29,7 @@ public class PermissionManager {
public static void setPermissions(PathManager pathManager) {
if (!SystemInfo.isWindows) {
RunUtils.execute(generateChmodCmd(pathManager.getAntBinDirectory() + "/ant"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk()));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk() + "/bin64"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getBuildToolsFolderInAndroidSdk() + "/" + SDKDownloader.BUILD_TOOLS));

View File

@@ -86,15 +86,22 @@ public class RunUtils {
return run(settings);
}
public static void executeOnSeparateThread(@NotNull RunSettings settings) {
public static void executeOnSeparateThread(@NotNull final RunSettings settings) {
assert !settings.waitForEnd : "Use execute() instead";
new Thread(() -> run(settings)).start();
Thread t = new Thread(new Runnable() {
@Override
public void run() {
RunUtils.run(settings);
}
});
t.start();
}
private static RunResult run(RunSettings settings) {
private static RunResult run(final RunSettings settings) {
System.out.println("RUN COMMAND: " + settings);
StringBuilder stdOut = new StringBuilder();
StringBuilder stdErr = new StringBuilder();
final StringBuilder stdOut = new StringBuilder();
final StringBuilder stdErr = new StringBuilder();
OSProcessHandler handler;
try {
@@ -104,7 +111,10 @@ public class RunUtils {
}
close(handler.getProcessInput());
}
catch (ExecutionException | IOException e) {
catch (ExecutionException e) {
return new RunResult(false, getStackTrace(e));
}
catch (IOException e) {
return new RunResult(false, getStackTrace(e));
}

View File

@@ -29,8 +29,8 @@ public class AndroidJpsBuildTestCase extends BaseKotlinJpsBuildTestCase {
public void doTest() {
initProject();
rebuildAllModules();
buildAllModules().assertSuccessful();
rebuildAll();
makeAll().assertSuccessful();
}
@Override

View File

@@ -64,8 +64,11 @@ public class AndroidRunner extends TestSuite {
private static void writeAndroidSkdToLocalProperties() throws IOException {
System.out.println("Writing android sdk to local.properties: " + pathManager.getAndroidSdkRoot());
File file = new File(pathManager.getTmpFolder() + "/local.properties");
try (FileWriter fw = new FileWriter(file)) {
FileWriter fw = new FileWriter(file);
try {
fw.write("sdk.dir=" + pathManager.getAndroidSdkRoot());
} finally {
fw.close();
}
}
}

View File

@@ -69,11 +69,7 @@ internal fun genFiles(file: File, fileContent: String, filesHolder: CodegenTests
}.patchSelfImports(file.newPackage)
}
resultFiles.forEach { resultFile ->
if (resultFile.name.endsWith(".kt") || resultFile.name.endsWith(".kts")) {
filesHolder.addFile(resultFile.name, resultFile.content)
}
}
resultFiles.forEach { resultFile -> filesHolder.addFile(resultFile.name, resultFile.content) }
val boxFiles = resultFiles.filter { hasBoxMethod(it.content) }
if (boxFiles.size != 1) {

View File

@@ -23,19 +23,21 @@ import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.backend.common.output.OutputFileCollection;
import org.jetbrains.kotlin.cli.common.output.outputUtils.OutputUtilsKt;
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles;
import org.jetbrains.kotlin.cli.jvm.compiler.JvmPackagePartProvider;
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
import org.jetbrains.kotlin.codegen.CodegenTestFiles;
import org.jetbrains.kotlin.codegen.GenerationUtils;
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime;
import org.jetbrains.kotlin.config.CommonConfigurationKeys;
import org.jetbrains.kotlin.config.CompilerConfiguration;
import org.jetbrains.kotlin.config.JVMConfigurationKeys;
import org.jetbrains.kotlin.idea.KotlinFileType;
import org.jetbrains.kotlin.load.java.JvmAbi;
import org.jetbrains.kotlin.name.FqName;
import org.jetbrains.kotlin.name.NameUtils;
import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.test.*;
import org.jetbrains.kotlin.test.ConfigurationKind;
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestJdkKind;
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase;
import org.jetbrains.kotlin.utils.Printer;
import org.junit.Assert;
@@ -55,7 +57,6 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
private static final String generatorName = "CodegenTestsOnAndroidGenerator";
private static int MODULE_INDEX = 1;
private int WRITED_FILES_COUNT = 0;
private final List<String> generatedTestNames = Lists.newArrayList();
@@ -141,27 +142,23 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
class FilesWriter {
private final boolean isFullJdkAndRuntime;
private final boolean inheritMultifileParts;
private boolean inheritMultifileParts;
public List<KtFile> files = new ArrayList<>();
public List<KtFile> files = new ArrayList<KtFile>();
private KotlinCoreEnvironment environment;
private FilesWriter(boolean isFullJdkAndRuntime, boolean inheritMultifileParts) {
this.isFullJdkAndRuntime = isFullJdkAndRuntime;
this.inheritMultifileParts = inheritMultifileParts;
this.environment = createEnvironment(isFullJdkAndRuntime);
environment = createEnvironment(isFullJdkAndRuntime);
}
private KotlinCoreEnvironment createEnvironment(boolean isFullJdkAndRuntime) {
ConfigurationKind configurationKind = isFullJdkAndRuntime ? ConfigurationKind.ALL : ConfigurationKind.NO_KOTLIN_REFLECT;
TestJdkKind testJdkKind = isFullJdkAndRuntime ? TestJdkKind.FULL_JDK : TestJdkKind.MOCK_JDK;
CompilerConfiguration configuration =
KotlinTestUtils.newConfiguration(configurationKind, testJdkKind, KotlinTestUtils.getAnnotationsJar());
configuration.put(CommonConfigurationKeys.MODULE_NAME, "android-module-" + MODULE_INDEX++);
if (inheritMultifileParts) {
configuration.put(JVMConfigurationKeys.INHERIT_MULTIFILE_PARTS, true);
}
return KotlinCoreEnvironment.createForTests(myTestRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES);
return isFullJdkAndRuntime ?
KotlinTestUtils.createEnvironmentWithJdkAndNullabilityAnnotationsFromIdea(
myTestRootDisposable, ConfigurationKind.ALL, TestJdkKind.FULL_JDK
) :
KotlinTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY);
}
public boolean shouldWriteFilesOnDisk() {
@@ -176,39 +173,46 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
public void writeFilesOnDisk() {
writeFiles(files);
files = new ArrayList<>();
files = new ArrayList<KtFile>();
environment = createEnvironment(isFullJdkAndRuntime);
}
public void addFile(String name, String content) {
try {
files.add(CodegenTestFiles.create(name, content, environment.getProject()).getPsiFile());
}
catch (Throwable e) {
throw new RuntimeException("Problem during creating file " + name + ": \n" + content, e);
} catch (Throwable e) {
new RuntimeException("Problem during creating file " + name + ": \n" + content, e);
}
}
private void writeFiles(List<KtFile> filesToCompile) {
if (filesToCompile.isEmpty()) return;
//1000 files per folder, each folder would be jared by build.gradle script
// We can't create one big jar with all test cause dex has problem with memory on teamcity
WRITED_FILES_COUNT += filesToCompile.size();
File outputDir = new File(pathManager.getOutputForCompiledFiles(WRITED_FILES_COUNT / 1000));
System.out.println("Generating " + filesToCompile.size() + " files" +
(inheritMultifileParts
? " (JVM.INHERIT_MULTIFILE_PARTS)"
: isFullJdkAndRuntime ? " (full jdk and runtime)" : "") + " into " + outputDir.getName() + "...");
: isFullJdkAndRuntime ? " (full jdk and runtime)" : "") + "...");
OutputFileCollection outputFiles;
try {
outputFiles = GenerationUtils.compileFiles(filesToCompile, environment).getFactory();
//hack to pass module name
CompilerConfiguration configuration = environment.getConfiguration().copy();
configuration.put(JVMConfigurationKeys.MODULE_NAME, "android-module-" + MODULE_INDEX++);
if (inheritMultifileParts) {
configuration.put(JVMConfigurationKeys.INHERIT_MULTIFILE_PARTS, true);
}
configuration.setReadOnly(true);
outputFiles = GenerationUtils.compileManyFilesGetGenerationStateForTest(
filesToCompile.iterator().next().getProject(),
filesToCompile,
new JvmPackagePartProvider(environment),
configuration
).getFactory();
}
catch (Throwable e) {
throw new RuntimeException(e);
}
File outputDir = new File(pathManager.getOutputForCompiledFiles());
if (!outputDir.exists()) {
outputDir.mkdirs();
}
@@ -245,12 +249,7 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
else {
String fullFileText = FileUtil.loadFile(file, true);
if (!InTextDirectivesUtils.isPassingTarget(TargetBackend.JVM, file)) {
continue;
}
//TODO: support LANGUAGE_VERSION
if (InTextDirectivesUtils.isDirectiveDefined(fullFileText, "LANGUAGE_VERSION:")) {
if (!hasJvmBackendTarget(fullFileText)) {
continue;
}
@@ -279,6 +278,21 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
return text.contains("fun box()");
}
private static boolean hasJvmBackendTarget(String text) {
List<String> backends = InTextDirectivesUtils.findLinesWithPrefixesRemoved(text, "// TARGET_BACKEND: ");
if (backends.isEmpty()) {
return true;
}
for (String backend : backends) {
if (backend.equals("JVM")) {
return true;
}
}
return false;
}
private static void generateTestMethod(Printer p, String testName, String className, String filePath) {
p.println("public void test" + testName + "() throws Exception {");
p.pushIndent();
@@ -289,7 +303,7 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
}
private String generateTestName(String fileName) {
String result = NameUtils.sanitizeAsJavaIdentifier(FileUtil.getNameWithoutExtension(StringUtil.capitalize(fileName)));
String result = JvmAbi.sanitizeAsJavaIdentifier(FileUtil.getNameWithoutExtension(StringUtil.capitalize(fileName)));
int i = 0;
while (generatedTestNames.contains(result)) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,106 +22,81 @@ import java.util.Set;
public class SpecialFiles {
private static final Set<String> excludedFiles = Sets.newHashSet();
private static final Set<String> filesCompiledWithoutStdLib = Sets.newHashSet();
static {
fillExcludedFiles();
}
public static Set<String> getExcludedFiles() {
return excludedFiles;
}
private static void fillExcludedFiles() {
// Reflection
excludedFiles.add("enclosing");
excludedFiles.add("noReflectAtRuntime");
excludedFiles.add("methodsFromAny");
excludedFiles.add("genericProperty.kt");
excludedFiles.add("kt3238.kt");
excludedFiles.add("kt1482_2279.kt");
excludedFiles.add("extensionMethod.kt");
excludedFiles.add("functionNtoStringNoReflect.kt");
excludedFiles.add("innerGeneric.kt");
excludedFiles.add("simpleCreateType.kt");
excludedFiles.add("equalsHashCodeToString.kt");
excludedFiles.add("arrayOfKClasses.kt");
excludedFiles.add("enumKClassAnnotation.kt");
excludedFiles.add("primitivesAndArrays.kt");
excludedFiles.add("getDelegateWithoutReflection.kt");
excludedFiles.add("native"); // Reflection is used to check full class name
// Reflection is used to check full class name
excludedFiles.add("native");
excludedFiles.add("enclosing"); //reflection tests
excludedFiles.add("noReflectAtRuntime"); //reflection tests
excludedFiles.add("methodsFromAny"); //reflection tests
// "IOOBE: Invalid index 4, size is 4" for java.lang.reflect.ParameterizedType on Android
excludedFiles.add("innerGenericTypeArgument.kt");
excludedFiles.add("kt3238.kt"); // Reflection
excludedFiles.add("kt1482_2279.kt"); // Reflection
excludedFiles.add("extensionMethod.kt"); // Reflection loadClass
// Cannot change package name
excludedFiles.add("nestedInPackage.kt");
excludedFiles.add("packageQualifiedMethod.kt");
excludedFiles.add("classObjectToString.kt");
excludedFiles.add("assertionStackTrace.kt");
excludedFiles.add("anonymousObjectReifiedSupertype.kt");
excludedFiles.add("innerAnonymousObject.kt");
excludedFiles.add("nestedReifiedSignature.kt");
excludedFiles.add("recursiveInnerAnonymousObject.kt");
excludedFiles.add("approximateCapturedTypes.kt");
excludedFiles.add("classForEnumEntry.kt");
excludedFiles.add("kt10143.kt");
excludedFiles.add("internalTopLevelOtherPackage.kt");
excludedFiles.add("noPrivateDelegation.kt");
excludedFiles.add("platformTypeAssertionStackTrace.kt");
excludedFiles.add("packages.kt");
excludedFiles.add("kt10259.kt");
excludedFiles.add("kt11081.kt");
excludedFiles.add("kt6990.kt");
excludedFiles.add("mainInFiles.kt");
excludedFiles.add("noClassForSimpleEnum.kt");
excludedFiles.add("simpleClassLiteral.kt");
excludedFiles.add("jvmName.kt");
excludedFiles.add("qualifiedName.kt");
excludedFiles.add("topLevelProperty.kt");
excludedFiles.add("typeParameters.kt");
excludedFiles.add("kt13133.kt");
excludedFiles.add("genericOverriddenFunction.kt");
excludedFiles.add("genericOverriddenProperty.kt");
excludedFiles.add("genericProperty.kt");
excludedFiles.add("nestedInPackage.kt"); // Cannot change package name
excludedFiles.add("packageQualifiedMethod.kt"); // Cannot change package name
excludedFiles.add("classObjectToString.kt"); // Cannot change package name
excludedFiles.add("assertionStackTrace.kt"); // Cannot change package name
excludedFiles.add("anonymousObjectReifiedSupertype.kt"); // Cannot change package name
excludedFiles.add("innerAnonymousObject.kt"); // Cannot change package name
excludedFiles.add("nestedReifiedSignature.kt"); // Cannot change package name
excludedFiles.add("recursiveInnerAnonymousObject.kt"); // Cannot change package name
excludedFiles.add("approximateCapturedTypes.kt"); // Cannot change package name
excludedFiles.add("classForEnumEntry.kt"); // Cannot change package name
excludedFiles.add("kt10143.kt"); // Cannot change package name
excludedFiles.add("internalTopLevelOtherPackage.kt"); // Cannot change package name
excludedFiles.add("noPrivateDelegation.kt"); // Cannot change package name
excludedFiles.add("platformTypeAssertionStackTrace.kt"); // Cannot change package name
excludedFiles.add("packages.kt"); // Cannot change package name
excludedFiles.add("kt10259.kt"); // Cannot change package name
excludedFiles.add("kt11081.kt"); // Cannot change package name
excludedFiles.add("kt6990.kt"); // Cannot change package name
excludedFiles.add("mainInFiles.kt"); // Cannot change package name
excludedFiles.add("noClassForSimpleEnum.kt"); // Cannot change package name
excludedFiles.add("simpleClassLiteral.kt"); // Cannot change package name
excludedFiles.add("jvmName.kt"); // Cannot change package name
excludedFiles.add("qualifiedName.kt"); // Cannot change package name
excludedFiles.add("topLevelProperty.kt"); // Cannot change package name
excludedFiles.add("typeParameters.kt"); // Cannot change package name
excludedFiles.add("kt13133.kt"); // Cannot change package name
excludedFiles.add("genericOverriddenFunction.kt"); // Cannot change package name
excludedFiles.add("genericOverriddenProperty.kt"); // Cannot change package name
excludedFiles.add("genericProperty.kt"); // Cannot change package name
// StackOverflow with StringBuilder (escape())
excludedFiles.add("kt684.kt");
excludedFiles.add("kt684.kt"); // StackOverflow with StringBuilder (escape())
// Wrong enclosing info or signature after package renaming
excludedFiles.add("enclosingInfo");
excludedFiles.add("signature");
excludedFiles.add("genericBackingFieldSignature.kt");
excludedFiles.add("genericMethodSignature.kt");
excludedFiles.add("kt11121.kt");
excludedFiles.add("kt5112.kt");
excludedFiles.add("genericBackingFieldSignature.kt"); // Wrong signature after package renaming
excludedFiles.add("genericMethodSignature.kt"); // Wrong signature after package renaming
excludedFiles.add("kt11121.kt"); // Wrong signature after package renaming
excludedFiles.add("kt5112.kt"); // Wrong signature after package renaming
// Different format of inner signature on Android and JVM
excludedFiles.add("signatureOfDeepGenericInner.kt");
excludedFiles.add("signatureOfDeepInner.kt");
excludedFiles.add("signatureOfDeepInnerLastGeneric.kt");
excludedFiles.add("signatureOfGenericInnerGenericOuter.kt");
excludedFiles.add("signatureOfGenericInnerSimpleOuter.kt");
excludedFiles.add("signatureOfSimpleInnerSimpleOuter.kt");
excludedFiles.add("classpath.kt"); // Some classes are not visible on android
// Some classes are not visible on android
excludedFiles.add("classpath.kt");
excludedFiles.add("manyNumbers.kt"); // Out of memory
// Out of memory
excludedFiles.add("manyNumbers.kt");
excludedFiles.add("external"); //native methods
// Native methods
excludedFiles.add("external");
excludedFiles.add("enclosingInfo"); // Wrong enclosing info after package renaming
excludedFiles.add("signature"); // Wrong signature after package renaming
// Additional nested class in 'Thread' class on Android
excludedFiles.add("nestedClasses.kt");
// No 'modifiers' field in 'java.lang.reflect.Field' class
excludedFiles.add("kt12200Const.kt");
excludedFiles.add("functionNtoStringNoReflect.kt"); // disabled cause test executed with reflection
// KT-8120
excludedFiles.add("closureOfInnerLocalClass.kt");
excludedFiles.add("closureWithSelfInstantiation.kt");
excludedFiles.add("nestedClasses.kt"); // additional nested class in 'Thread' class on Android
excludedFiles.add("kt12200Const.kt"); // no 'modifiers' field in 'java.lang.reflect.Field' class
excludedFiles.add("closureOfInnerLocalClass.kt"); // KT-8120
excludedFiles.add("closureWithSelfInstantiation.kt"); // KT-8120
}
private SpecialFiles() {

Some files were not shown because too many files have changed in this diff Show More