Commit Graph

44745 Commits

Author SHA1 Message Date
Mikhail Zarechenskiy baf16895f2 Refactor and prettify checkCompileTimeConstant method 2018-03-22 03:03:56 +03:00
Vyacheslav Gerasimov 96caf7f4ce Build: Get rid of build scan deprecated methods 2018-03-21 20:08:42 +03:00
Alexey Tsvetkov 605bcc66a1 IC: add destination dir to start of classpath instead of end
Otherwise IC fails when a project declares a class with the same name
as in one of its dependencies.
The issue is relevant only for non-JPS IC (Gradle, Maven, etc.),
but I added the test for JPS too.

  #KT-20516 fixed
2018-03-21 18:44:42 +03:00
Alexey Tsvetkov 55cbd28910 Do not exclude :ultimate:generateTests in "Generate All Tests"
:ultimate is excluded by default now,
so `-x :ultimate:generateTests` fails
2018-03-21 18:44:42 +03:00
Ilya Gorbunov 5d13b1681f Refactor: extract JVM API into separate files
Increase visibility to internal for:
- copyToArrayOfAny
- UNINITIALIZED_VALUE
- InitializedLazyImpl

Change file classes to multifile:
- LazyKt
- GroupingKt
- IntrinsicsKt (coroutines)
2018-03-21 18:08:00 +03:00
Nikolay Krasko 5dc4e31918 Update idea to 173.3.5 (173.4674.33) 2018-03-21 17:25:45 +03:00
Nikolay Krasko 3b4ca3558b Add hard dependency to Java module in plugin.xml
Otherwise resulting plugin will be installable to PyCharm, WebStorm and
other Intellij IDE without Java.

It can be resolved with `xi:include`, but it should be done with care,
because some declarations in `jvm.xml` should be placed after some
declarations in `plugin.xml` (action groups suffer from this issue for
sure).
2018-03-21 17:25:40 +03:00
Nikolay Krasko d847f9f7ac Use stringValue for getting version of *jre usage in Maven (KT-23271)
#KT-23271 Fixed
2018-03-21 17:25:34 +03:00
Natalia Selezneva 3b11b890e9 Set FATAL severity for errors from GradleScriptTemplateProvider 2018-03-21 16:51:53 +03:00
Roman Artemev 0d0adbbc05 Fixed handling of default params in declaration (KT-23239) 2018-03-21 12:44:24 +03:00
Roman Artemev a121a4a6b2 Added test to check default params in declaration (issue KT-23239) 2018-03-21 12:44:24 +03:00
Alexander Podkhalyuzin 7d72fe07bb Fixed broken exception reporter 2018-03-21 12:25:32 +03:00
Mikhail Glukhikh b739db3c35 Fix parameter handling in "Move suspicious reference into parentheses"
Related to KT-21743
2018-03-21 09:53:38 +03:00
Toshiaki Kameyama fbd06dc74f Fix "move suspicious reference into parentheses" for functional types
So #KT-21743 Fixed
2018-03-21 09:30:17 +03:00
Toshiaki Kameyama 3fbf85dc37 Add inspection to highlight unnecessary explicit companion references
So #KT-22971 Fixed
2018-03-21 09:15:48 +03:00
Zalim Bashorov 4c5913f5a3 Regenerate tests 2018-03-20 22:44:30 +03:00
Zalim Bashorov 68457a55a8 [JS IR BE] support more constructions:
* generate declaration for top level properties
* basic support for calls
* break
* continue
* throw
* generate declaration for local vals and vars
2018-03-20 22:44:29 +03:00
Zalim Bashorov 560e35174b Minor: renames
IrElementToJsNodeTransformer -> BaseIrElementToJsNodeTransformer
IrFileTransformer -> IrFileToJsTransformer
IrModuleTransformer -> IrModuleToJsTransformer
2018-03-20 22:44:29 +03:00
Zalim Bashorov 87ee373205 Few improvements in test infrastructure:
* add the way to specify another compatible target for target backend.
  It's used to generate a test for X_IR backend even when in a test data
  is explicitly written a target: "// TARGET_BACKEND: X".
* Add the ability to run tests "ignored" with the "IGNORE_BACKEND" directive
  as regular tests, i.e. w/o catching exceptions.
* Print stack trace of caught exception inside tests "ignored"
  with the "IGNORE_BACKEND" directive.
2018-03-20 22:44:28 +03:00
Zalim Bashorov f899394126 Regenerate tests 2018-03-20 22:44:28 +03:00
Zalim Bashorov e0a070ff35 [JS IR BE] basic compiler 2018-03-20 22:44:27 +03:00
Zalim Bashorov 4404c6dd2c Run JS box tests for JS IR BE 2018-03-20 22:44:26 +03:00
Zalim Bashorov bef7b5389b Create ir/backend.js module with dummy compiler 2018-03-20 22:44:26 +03:00
Zalim Bashorov f820b3eadd Fix exception from PathManager.getHomePath with message "Could not find installation home path" 2018-03-20 22:44:25 +03:00
Zalim Bashorov 44d5d0da7e Rid of most of the usage of JsConfig in TopDownAnalyzerFacadeForJS 2018-03-20 22:44:25 +03:00
Vyacheslav Gerasimov 66eaa34bdb Build: Put local repositories to the top of repositories block 2018-03-20 20:57:13 +03:00
Vyacheslav Gerasimov 40a765819a Remove unused versions.intellij-plugin property 2018-03-20 20:44:20 +03:00
Vyacheslav Gerasimov f55d137790 Upgrade shadow plugin to 2.0.2
Fixes warning 'Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.'
2018-03-20 20:44:20 +03:00
Toshiaki Kameyama 9d6b36c249 KT-20282 'Move statement up' works incorrectly for statement after 'finally' block if 'try' block contains closure 2018-03-20 20:39:17 +03:00
Alexey Belkov d3b1b7a5be Minor: fix assertion 2018-03-20 20:39:17 +03:00
Yan Zhulanow 793a05106c Minor: Remove old 'buildLexer.xml' path from ant.xml 2018-03-20 16:22:52 +03:00
Denis Zharkov d8538db719 Avoid retaining whole KotlinClassHeader in IDEKotlinBinaryClassCache
Before this change there was a retention chain
VirtualFile -> KotlinBinaryData -> KotlinBinaryHeaderData -> KotlinClassHeader

The latter one contains all binary metadata (a lot of String[])
while only a small part of it is used.

The used parts are moved straight to KotlinBinaryClassHeaderData
in this change.

 #KT-19484 Fixed
2018-03-20 10:46:13 +03:00
Ilya Chernikov dca7323627 [minor] fix asm sources connection 2018-03-19 17:17:10 +01:00
Alexey Tsvetkov 6ab96c1d7d Set up idea.home.path in :incremental-compilation-impl
To avoid warnings in stderr
2018-03-19 18:04:33 +03:00
Alexey Tsvetkov 2584143e92 Report correct source to output mapping for kjsm files
Now IC can correctly remove kjsm files when source files are changed
2018-03-19 18:04:33 +03:00
Alexey Tsvetkov ea09f4caf6 Remove all kjsm files before writing new ones 2018-03-19 18:04:33 +03:00
Alexey Tsvetkov a3feb77193 Compare diverged .meta.js files in a human readable way 2018-03-19 18:04:33 +03:00
Alexey Tsvetkov 1cd2abf76f Fix comparing directories after IC test
A directory-after-rebuild should correspond to expectedDir parameter,
a directory-after-IC should correspond to actualDir parameter.
Also we should not forgive extra directories.
2018-03-19 18:04:33 +03:00
Alexey Tsvetkov d95abf2234 Generate meta info in JS IC tests 2018-03-19 18:04:33 +03:00
Alexey Tsvetkov 1d87aaf3d6 Avoid serializing JS metadata twice per compilation 2018-03-19 18:04:33 +03:00
Alexey Tsvetkov ebb774b0ee Sort package fragments by fq-name for JS serialization 2018-03-19 18:04:33 +03:00
Alexey Tsvetkov 1fd0e5e50c Optimize serializing JS metadata
This makes JS IC tests twice as fast
2018-03-19 18:04:33 +03:00
Alexey Tsvetkov 89275410a6 Avoid reading JS libraries twice per compilation 2018-03-19 18:04:33 +03:00
Alexey Tsvetkov ba60ca468c Improve JS inliner performance 2018-03-19 18:04:32 +03:00
Ilya Chernikov 0e5c5af727 Add asm sources into idea sdk sources on the sdk preparation
restores navigation to asm sources in idea.
The asm sources could not be added separately, due to the gradle issue
https://issues.gradle.org/browse/GRADLE-3210
2018-03-19 15:47:19 +01:00
Alexey Tsvetkov 30d0cc3a34 Ensure all output directories are cleared on IC rebuild
In some cases IC needs to perform a rebuild.
Before this change IC was not clearing output directories
besides destination dir for classes, so for example
kapt stubs were not cleared.

Stalled stubs might lead to compile errors.
For example:
1. foo/XGen.java is generated from annotated class foo/X (XGen also
references X).
2. foo/X is moved to bar/X and some other change forces IC to rebuild.
3. kapt generates bar/X stub, but foo/X stub
was not removed because stubs dir is not cleared.
4. kapt runs annotation processors, foo/XGen.java is generated from
foo/X stub, bar/XGen.java is generated from bar/X stub.
5. kotlinc rebuilds. Since destination dir is cleared properly,
only bar/X.class exists.
6. javac tries to compile foo/XGen and fails, because it
compiles against actual Kotlin classes, not stubs.

This commit fixes the issue by passing all output directories
of a task from Gradle to Kotlin IC.

   #KT-21735 fixed
2018-03-19 17:39:47 +03:00
Alexey Tsvetkov afce075dc8 Fix unresolved references in kotlin-gradle-plugin in Idea 2018-03-19 17:39:47 +03:00
Ilya Chernikov d6792f5f52 Implement support for additional compiler arguments for scripts in IDE
fixes #KT-19120
2018-03-19 11:45:10 +01:00
Ilya Chernikov 643e81f0ae Refactor language feature settings processing for exposing it outside of the CLI compiler 2018-03-19 11:45:09 +01:00
Natalia Selezneva 58edab37c1 Add test for fatal severity in scripts 2018-03-19 09:41:38 +03:00