Commit Graph

44702 Commits

Author SHA1 Message Date
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
Natalia Selezneva f957b3072b Add FATAL severity to ScriptExternalHighlightingPass 2018-03-17 00:28:34 +03:00
Natalia Selezneva dcea9d0cd5 Add FATAL severity to script dependencies resolve result 2018-03-17 00:23:57 +03:00
Natalia Selezneva 82481b48c4 Restore old package for ScriptTemplatesProvider.
Note that this is EP used in another plugins (ex. LivePlugin https://plugins.jetbrains.com/plugin/7282-liveplugin)
2018-03-17 00:21:32 +03:00
Natalia Selezneva 1f75eaed9a Don't highlight gradle scripts during gradle import.
Show warning on the top panel for these files
2018-03-17 00:21:25 +03:00
Natalia Selezneva 5f1118e820 Don't highlight scripts if resolver returns Failure.
Note that we don't highlight script when ScriptDependenciesFileAttribute is not set.
2018-03-17 00:21:17 +03:00
Natalia Selezneva 4b4acfee2c Scripts: display errors from external resolver in panel if text range is empty 2018-03-17 00:21:10 +03:00
Natalia Selezneva 26a4b67fa3 Introduce default ScriptTemplate for Gradle scripts
^KT-23228 Fixed
2018-03-17 00:21:02 +03:00
Natalia Selezneva 9f02664351 Minor: reformat 2018-03-17 00:20:55 +03:00
Vyacheslav Gerasimov 042873fa2c Build: add maven.repository.mirror property
May be used to add additional repository to all projects

(cherry picked from commit d8407b9)
2018-03-16 20:07:31 +03:00
Nikolay Krasko 79d9ea6716 Check module is from given set of modules before passing it to callbacks
`module` variable is fetched from `moduleInfoByDescriptor`, and this map
is filled in `createModuleDescriptor`, witch is called in
`doGetDescriptorForModule` only for modules from the given set.
2018-03-16 18:19:52 +03:00
Nikolay Krasko 7f501e3a78 Minor: document fields usages in ResolverForProjectImpl 2018-03-16 18:03:21 +03:00
Nikolay Krasko 03459eb808 Protect resolverByModuleDescriptor collection with storageManager lock
Read access from isResolverFromModuleDescriptorComputed was exposed through
DelegatingPackageFragmentProvider.
2018-03-16 16:40:38 +03:00
Nikolay Krasko 9145470f79 Minor: remove "JVM" constant usages in multi target platform 2018-03-16 16:40:38 +03:00
Nikolay Krasko 34569c2541 Minor: hasTopLevelCallables rename 2018-03-16 16:40:37 +03:00
Nikolay Krasko 14a0434737 Remove reference to binding context from LazyLightClassDataHolder cache
The ultimate goal is to remove references to binding context and resolve
result from light classes. There still can be references from `diagnostics`
field, but `bindingContext` is unneeded and can be removed.

Relates to snapshots from IDEA-187395.
2018-03-16 16:40:37 +03:00
Nikolay Krasko 481a5bc28d Update JUnit3RunnerWithInners.java for Gradle 4.6 (KT-23292)
Update after "Executer -> Executor" rename
https://github.com/gradle/gradle/commit/3f1487e8006d0c606e3be25267a238427468917a

 #KT-23292 Fixed
2018-03-16 16:40:37 +03:00
Yan Zhulanow e2ed77354f Pill: Update module structure, add missing modules metadata and metadata.jvm 2018-03-16 16:31:55 +03:00
Ilmir Usmanov 826d667398 Remove redundant locals
Do not transform already transformed suspend lambdas
Ignore duplicates of continuation in local variable table during redundant locals elimination.
2018-03-16 16:26:14 +03:00
Ilmir Usmanov 81f3e39f29 Do not generate ACONST_NULL as continuation of crossinline suspend lambda 2018-03-16 16:26:13 +03:00
Ilmir Usmanov 6b7173ba13 Forbid default inline/crossinline suspend parameters 2018-03-16 16:26:12 +03:00
Ilmir Usmanov 7224b99928 Add intention to remove suspend from parameter on suspend inline function 2018-03-16 16:26:11 +03:00
Ilmir Usmanov 6854135077 Support crossinline suspend lambda as parameter of inline function
Use fake continuation instead of ALOAD 0 while inlining
Do not generate state machine for inner lambdas and inner objects,
which capture crossinline suspend lambda.

 #KT-19159: Fixed
2018-03-16 16:26:11 +03:00
Ilmir Usmanov 042ca55be7 Do not generate suspension points for crossinline lambdas 2018-03-16 16:26:10 +03:00
Ilmir Usmanov e6a353e590 Remove returns unit markers in suspend lambdas 2018-03-16 16:26:09 +03:00
Ilmir Usmanov e169383f76 Fix problem with transforming suspend lambda instantiation by itself
#KT-21605: Fixed
2018-03-16 16:26:09 +03:00
Svyatoslav Scherbina f3bc8d179c Add one more IR text test case 2018-03-16 14:47:20 +03:00
Svyatoslav Scherbina aac940415f Fix psi2ir when type parameter bound goes after the type parameter 2018-03-16 14:47:18 +03:00
Simon Ogorodnik c0b0f6d1ca Extract PSI to separate module 2018-03-16 13:32:14 +03:00
Toshiaki Kameyama 55c93bc8b6 Fix NPE on conversion: run/apply with explicit signature -> let/also
So #KT-22949 Fixed
2018-03-16 12:17:24 +03:00
Toshiaki Kameyama f93b21eaa2 Fix "Add function to supertype" braces #KT-23215 Fixed 2018-03-16 12:11:26 +03:00
Alexander Udalov 404bcc58e5 Update bootstrap to 1.2.40-dev-967 2018-03-15 20:47:35 +01:00
Alexander Udalov 4484335eac Update light classes test data after d0ed0c4049 2018-03-15 18:23:16 +01:00
Alexander Udalov a23af6306c Update test data of log tag consistency test on lint
The reason is that UastUtils.tryResolveNamed (in
LogDetector.checkTagConsistent) started to refer to the field of the
property in the companion after d0ed0c4049 instead of its getter
2018-03-15 18:19:43 +01:00
Denis Zharkov 21932b5824 Use mockJDK as a bootClasspath for AbstractCompileKotlinAgainstJavaTest
Otherwise JAVA_HOME is being used that lead to test result depending
on minor JDK version used on a computer

 #KT-21047 Fixed
2018-03-15 19:00:31 +03:00
Denis Zharkov 1766812bf3 Minor. Reformat AbstractCompileKotlinAgainstJavaTest 2018-03-15 19:00:31 +03:00
Denis Zharkov c334f46825 Avoid retaining reference to ProtoBuf.Package in JvmPackagePartSource
Otherwise, 2e933a165a doesn't help
2018-03-15 18:59:44 +03:00
Denis Zharkov 4b78abaa7a Minor. Reformat JvmPackagePartSource 2018-03-15 18:59:44 +03:00
yukuku 6f6b0baf3b Fix wrong example on the docs of @PurelyImplements 2018-03-15 18:56:26 +03:00
Alexey Tsvetkov baa20e2677 Ensure absolute paths are written to module xml file
Since d0ca0dca2b
first IC build uses CompilationMode.Rebuild instead of Incremental
to avoid unnecessary work (computing API difference etc.).

However there is a branch that does not transform source files
paths to absolute ones before writing them to module xml file.

In our plugins we have always transformed files to absolute ones before
passing them to IncrementalJvmCompilerRunner, so there is no problem.

But third party build systems could pass relative paths to IncrementalJvmCompilerRunner
(namely Kobalt does so).
It turned out to break builds because KotlinToJVMBytecodeCompiler takes
module xml file's (which is a temporary file itself) parent as a base
for relative source files (see KotlinToJVMBytecodeCompiler.getAbsolutePaths).

This change ensures that makeModuleFile always uses absolute files.

    #KT-22542 fixed
2018-03-15 18:06:13 +03:00
Anton Bannykh e377a30929 Use mocha instead of QUnit for debugging stdlib tests in browser 2018-03-15 17:54:17 +03:00
Anton Bannykh 338bde23fc JS stdlib: run kotlin.test library tests 2018-03-15 17:54:17 +03:00
Vyacheslav Gerasimov f0ec073bf6 Build: Include ultimate projects only if intellijUltimateEnabled 2018-03-15 16:35:20 +03:00
Vyacheslav Gerasimov ef018d2ac1 Make dependencies on Android gradle plugin non-transitive
com.android.tools.build:gradle brings about 50 unused transitive dependencies including idea-core and uast, sometimes it breaks IDE features like navigation to declarations and debugging.

Inline contents of ReflectionUtil.findMethod to remove dependency on idea-core
2018-03-15 15:20:22 +03:00