Commit Graph

38337 Commits

Author SHA1 Message Date
Kirill Rakhman d44bf27ec3 Completion of keywords (like constructor) doesn't insert parentheses/braces if they're already there
#KT-15603 Fixed
 #KT-13524 Fixed
2017-04-13 13:41:41 +03:00
Zalim Bashorov 56d3f90a02 Don't log content of module.xml when Logger is not initialized
When Logger is not initialized it returns default logger which prints to stdout and stderr,
so it can lead to different results when run CLI tests locally and on TC.
2017-04-13 13:16:32 +03:00
Alexey Andreev 43c084fde3 Simplify coroutine generation in JS backend
Stop making aliasing suspend function descriptor with reference to
instance of state machine. This may cause problems in some cases,
for example, when compiling recursive suspend function. See KT-17281.
Instead, make alias for synthetic continuation parameter. This
additionally required some refactoring, e.g. *always* generating
continuation parameter during codegen.
2017-04-13 12:56:34 +03:00
Ilya Chernikov f4a4a41525 Restore parts of the template resolving code in the compiler...
that was moved to the script-runtime, that it a row caused the incompatibility
with old GSK implementations. Now the legacy template resolving related code
is restored, marked obsolete and wrapped for compatibility with the new code.
2017-04-12 19:48:43 +02:00
Vyacheslav Gerasimov d8fdd04e7f Remove custom lint detectors registration from kotlin lint
#KT-14970 Fixed
2017-04-12 19:23:43 +03:00
Dmitry Jemerov 2a8933e5a0 Run all Gradle import tests with Gradle 3.5 2017-04-12 15:37:44 +02:00
Alexander Udalov 27c3155ce3 Refactor AnalyzerFacade.setupResolverForProject for better readability 2017-04-12 14:22:34 +03:00
Alexander Udalov f594a4c018 Drop ModuleDescriptor.sourceKind, move this code to IDE modules
This information is only used in IDE and it can easily be computed there
2017-04-12 14:22:34 +03:00
Ilya Chernikov aaeb53fb8b Fix compiler client test after introducing nullable CompilerMessageLocation 2017-04-12 11:51:02 +02:00
Dmitry Jemerov 40df565369 Use correct repository for checking if current EAP version is published
Logic for determining the Maven repository corresponding to the current
plugin version has been centralized and reused in the version chooser
in "Configure Kotlin" dialog.
  #KT-17291 Fixed
2017-04-12 10:41:57 +02:00
Dmitry Jemerov 546040fafd Change AddKotlinLibQuickFix to support adding multiple jars 2017-04-12 10:41:57 +02:00
Dmitry Jemerov aee32e6204 New Kotlin projects and Configure Kotlin adds JRE-specific jars 2017-04-12 10:41:57 +02:00
Dmitry Jemerov aacaa61cf2 JavaRuntimeLibraryDescription: J2K 2017-04-12 10:41:57 +02:00
Dmitry Jemerov f4db36ad5d JavaRuntimeLibraryDescription: rename to .kt 2017-04-12 10:41:57 +02:00
Dmitry Jemerov 8000989bb8 Fix updating libraries
Use correct order root type for updating jars; correctly find file
in VFS after rename; provide logging instead of exceptions in case
of failure; update library model under write action; locate stdlib
sources under the old name
 #KT-17334 Fixed
2017-04-12 10:41:57 +02:00
Mikhael Bogdanov a4fef1371f Split resulting test jar into small ones (1000 files per jar)
Dex on teamcity has memory problems with large jar
2017-04-11 20:28:25 +02:00
Simon Ogorodnik c6cdbe7eed Fix import member quickfix to check receiver
#KT-17037 fixed
2017-04-11 20:29:15 +03:00
Vyacheslav Gerasimov a47bc1492d Update changelog for 1.1.2 EAP 2 2017-04-11 18:13:14 +03:00
Alexey Andreev 72898b378e Add and target to prepare running tests in node.js 2017-04-11 16:15:26 +03:00
Alexey Andreev 7077de02e7 Fix passing non-string value to print/println in node.js
See KT-15484
2017-04-11 16:15:25 +03:00
Alexey Andreev dbfa3fce2a Fix running tests in node.js 2017-04-11 16:15:24 +03:00
Alexander Udalov 3430059b3a Minor, refactor TargetPlatformDetector.getPlatform
Inline dangerous getPlatform(PsiFile) method to prevent it from being
called accidentally instead of getPlatform(KtFile)
2017-04-11 16:06:56 +03:00
Zalim Bashorov 5f0e896843 Minor: simplify isVisible of Visibilities.INTERNAL and write comment on non-obvious line 2017-04-11 15:47:02 +03:00
Zalim Bashorov 712b2c8117 Add tests for KT-12199 to prevent regression
#KT-12199 Obsolete
2017-04-11 15:46:13 +03:00
Nikolay Krasko ab2dbba249 Abstract class icon added (KT-7810)
#KT-7810 Fixed
2017-04-11 14:28:11 +03:00
Nikolay Krasko 6898176b43 Abstract extension function added 2017-04-11 14:28:10 +03:00
Denis Zharkov 1596f19fd7 Add javaslang library to kotlin-plugin artifact
This change should be contained in 5e449fdc02
But I've forgotten to apply it
2017-04-11 12:52:52 +03:00
Nikolay Krasko cee54a4111 Revert "Workaround for building against jars from both JDK 6 and JDK 8 on TeamCity"
This reverts commit 0cf1c8d900.
2017-04-11 12:33:07 +03:00
Nikolay Krasko cc3b6998b1 Minor: fix warnings in KotlinTypeMapper.java 2017-04-11 12:33:07 +03:00
Nikolay Krasko 172bee58b4 Expose connection between mangling internal names in backend and jdiEval 2017-04-11 12:33:07 +03:00
Nikolay Krasko 42868b1364 Fix evaluate for internal functions (KT-15854)
#KT-15854 Fixed
2017-04-11 12:33:07 +03:00
Nikolay Krasko 9eae9aa938 Minor: fix warnings and refactoring 2017-04-11 12:33:07 +03:00
Alexey Sedunov 9979c6e361 Move: Fix processing of callable references to Java constructors 2017-04-11 12:11:51 +03:00
Alexey Sedunov bdaf73411a Move: Extract MoveToKotlinFileProcessor class 2017-04-11 12:11:50 +03:00
Alexander Udalov cb4d2994a3 Drop CompilerMessageLocation.NO_LOCATION, use null everywhere instead 2017-04-11 12:08:31 +03:00
Alexander Udalov 861d9a1620 Use null instead of CompilerMessageLocation.NO_LOCATION in MessageCollector 2017-04-11 12:08:31 +03:00
Alexey Sedunov 411a8dc206 Move: Remove duplicating conflict messages from test data 2017-04-11 11:45:13 +03:00
Alexey Sedunov cd6177534a Move: Add conflict checking for "Move packages" case 2017-04-11 11:45:12 +03:00
Alexey Sedunov e21ff23e26 Move: Add conflict checking for "Move directory with classes" case 2017-04-11 11:45:11 +03:00
Alexey Sedunov 87a12ee1c7 Move: Check for conflicts using entire collections of elements to move 2017-04-11 11:45:10 +03:00
Alexey Sedunov 358b5fe548 Move: Force package name change when moving Java files
Package statement in Java file is updated too late
when moving the entire containing directory, so we force it
with intercepting MoveFileHandler implementation
2017-04-11 11:45:08 +03:00
Alexey Sedunov 3007b11973 Move: Use MoveFilesWithDeclarationProcessor for files & directories 2017-04-11 11:45:07 +03:00
Alexey Sedunov 22a56a81b9 Move: Drop obsolete code 2017-04-11 11:45:06 +03:00
Alexey Sedunov f5d106a68f Refactoring: Drop obsolete KotlinFileReferencesResolver class 2017-04-11 11:45:05 +03:00
Alexey Sedunov 7f115343f9 Kotlin Facet: Drop Gradle/Maven-based version info providers
They are obsolete since compiler/library version can be detected
based on module dependencies generated on external model import
2017-04-11 11:45:04 +03:00
Denis Zharkov aaddc34b54 Optimize control-flow analysis algorithm
There's no need to recalculate results if all of the
previous instructions' results remain unchanged.

It's a crucial optimizations because otherwise algorithm
can degrate to O(n * m) [n - instructions number, m - variables number]
even in a linear code like this:
var a_1 = 1
var a_2 = 1
...
var a_m = 1

We perform analysis iteration once, then we repeat it to be sure
that no changes happened and here for each instruction we're
starting to check if recomputed value is the same, that basically
compares maps of all the variables, so it works O(n * m)

After this change on the second iteration we won't recompute new values
as none of predecessor has been changed
2017-04-11 11:26:11 +03:00
Denis Zharkov 5e449fdc02 Optimize control-flow analysis by use of persistent maps
The case that it's worth to optimize is functions
with a lot of variables.

After debugging it's recovered that control-flow works nearly
O(n * m) where n is pseudocode size and m is a number of variables:
the algorithm performs O(n) copies of hashmap of size O(m)

Persistent maps should help because we don't need to perform a
copy of them, so the expected performance after the change is applied
is O(n log m)

We've tried pcollections and javaslang, and the latter one has demonstrated
better results

See results before and after optimizations
before:
https://github.com/dzharkov/kotlin-compiler-benchmarks/blob/3da7ba45a704969653d70b50995f730e968540d8/reports/benchmarks-many-vars-2017-03-14.txt

after with pcollections:
https://github.com/dzharkov/kotlin-compiler-benchmarks/blob/3da7ba45a704969653d70b50995f730e968540d8/reports/benchmarks-many-vars-persistent-optimizations-2017-03-17.txt

after with javaslang:
https://github.com/dzharkov/kotlin-compiler-benchmarks/blob/d22a871b175b291fb337b51ef6465ba70bbfd96c/reports/benchmarks-many-vars-javaslang-2017-04-07.txt
2017-04-11 11:26:11 +03:00
Yan Zhulanow 9e61eea758 Support inline properties in debugger class search 2017-04-10 23:25:55 +03:00
Yan Zhulanow cb9e90183a Debugger: Fix AbstractPositionManagerTest
MockReferenceType can't be used anymore because the new DebuggerClassNameProvider requires much more from it.
The new SmartMockReferenceType implements methods such as nestedTypes() or allLineLocations() properly.

Also, as PositionManager can return more than one class, we should check if any of the classes it returned matches the pattern.
2017-04-10 23:25:54 +03:00
Yan Zhulanow 622430a296 Debugger: Fix AbstractPositionManagerTest
MockReferenceType can't be used anymore because the new DebuggerClassNameProvider requires much more from it.
The new SmartMockReferenceType implements methods such as nestedTypes() or allLineLocations() properly.

Also, as PositionManager can return more than one class, we should check if any of the classes it returned matches the pattern.
2017-04-10 23:25:53 +03:00