Commit Graph

66272 Commits

Author SHA1 Message Date
Ilya Chernikov 3da6ff7ec3 Optimize scopes handling inside LexicalChainedScope 2020-06-11 16:16:14 +02:00
Ilya Chernikov bf97323301 Optimize data handling inside scopes 2020-06-11 16:16:14 +02:00
Ilya Chernikov c720fa5793 Optimize LazyScopeAdapter internals 2020-06-11 16:16:14 +02:00
Ilya Muradyan c2ede13d5a Fix importing scopes problem for scripting REPL
We don't need to add any importing scopes for a snippet if it doesn't
contain import directives. This fix optimizes performance by reducing
importing scopes count.
2020-06-11 16:16:13 +02:00
Ilya Muradyan b74692e96b Add missing definitelyDoesNotContainName methods
Some implementations of definitelyDoesNotContainName method were
missing that led to performance problems during symbols resolution
using TowerResolver.

Relates to KT-39139.
2020-06-11 16:16:13 +02:00
Ilya Muradyan 262e21fcbc Add overload to comply with the contract
Method getVariableNames() should return all variable names, but in the
inherited implementation it doesn't return resX names which represent
result fields.
2020-06-11 16:16:12 +02:00
Ilya Muradyan 6da22414dc [minor] Fix typo in comment 2020-06-11 16:16:12 +02:00
Toshiaki Kameyama 4d2caa8e76 KT-33211 Quickfix "add parameter" for method references should infer functional type instead of KFunction (#2664)
* "Add parameter to function" quick fix: add function type instead of KFunction for method references

#KT-33211 Fixed

* Support suspend function references
2020-06-11 17:01:07 +03:00
Alexander Udalov 6e67e1e78d Replace appendln with appendLine in project 2020-06-11 13:01:30 +02:00
Natalia Selezneva d1c88798df Load script definitions only from production source root and libraries
Exclude not connected to current project roots

EA-210662 Fixed
2020-06-11 13:43:57 +03:00
Ilya Kirillov 2d5b50531d FIR IDE: fix AbstractFirLazyResolveTest
It uses fir reference implementations which are not in the classpath
2020-06-11 12:45:41 +03:00
Toshiaki Kameyama 46907f861a Extend Selection: don't select lambda parameters if lambda is multiple lines (#2586)
#KT-29364  Fixed
2020-06-11 12:20:32 +03:00
Toshiaki Kameyama 232be94738 Smart enter: support get() clause (#2630)
#KT-31500 Fixed
2020-06-11 12:16:04 +03:00
Toshiaki Kameyama cbbdec5898 Change Signature: enable on primary constructor keyword (#2482)
#KT-19744 Fixed
2020-06-11 12:10:12 +03:00
Toshiaki Kameyama 957a927790 KT-15846 'Change lambda expression return type' quick fix does nothing (#3182)
* Change parameter type quickfix: fix it works correctly on property delegate

#KT-15846 Fixed

* Change parameter type quickfix: fix it works correctly when function literal has trailing comments

#KT-15846 Fixed
2020-06-11 12:07:44 +03:00
Denis Zharkov 5ab05e6e47 FIR: Fix incorrect resolution to synthetic property by implicit receiver
When there's an explicit one

^KT-39028 Fixed
2020-06-11 11:31:39 +03:00
Denis Zharkov 293f78efe8 FIR: Correct capturing for type-alias bases arguments
NB: The test data change at testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.fir.kt
is correct: see the relevant non-fir test, the call shouldn't be applicable

^KT-39008 Fixed
2020-06-11 11:31:38 +03:00
Denis Zharkov bea37569e6 FIR: Fix processOverriddenFunctions implementations 2020-06-11 11:31:36 +03:00
Denis Zharkov 28627e9754 FIR: Minor. Clarify naming for unwrapping overrides 2020-06-11 11:31:35 +03:00
Denis Zharkov 89cbe9bf93 FIR: Pull down FirScope.processOverriddenFunctions 2020-06-11 11:31:33 +03:00
Denis Zharkov 6178cb7206 FIR: Get rid of last usages of FirScope.processOverriddenFunctions 2020-06-11 11:31:32 +03:00
Denis Zharkov 72b09ff323 FIR: Rename FirSuperTypeScope and reuse it for type parameter type
It would allow ConeKotlinType.scope return FirTypeScope
and thus pulling down org.jetbrains.kotlin.fir.scopes.FirScope#processOverriddenFunctions
(See the following commits)
2020-06-11 11:31:31 +03:00
Denis Zharkov 0bd2a74542 FIR: Add FirTypeScope
^KT-35495 Relates
2020-06-11 11:31:29 +03:00
Denis Zharkov 38922a84f1 FIR: Do not create synthetic properties for non-Java accessors
^KT-35495 Fixed
2020-06-11 11:01:43 +03:00
Denis Zharkov 6a1f921a5c FIR: Introduce FirScope.processOverriddenFunctions
^KT-35495 In Progress
2020-06-11 11:01:43 +03:00
Denis Zharkov 8447f512b4 Minor. Drop unused FirSyntheticPropertiesScope.synthetic 2020-06-11 11:01:43 +03:00
Jinseong Jeon ab2a2b3a87 FIR2IR: eager conversion of annotations in Library class and members 2020-06-11 10:57:51 +03:00
Jinseong Jeon fd32e918d5 FIR deserializer: signature-aware annotation loading for property accessors 2020-06-11 10:57:51 +03:00
Jinseong Jeon 2d55b8db07 FIR deserializer: build property accessors if non-default ones exist 2020-06-11 10:57:51 +03:00
Vladimir Dolzhenko 369c08214b Add quick isCheapEnoughToSearch check to AddFunctionParametersFix 2020-06-11 09:45:21 +02:00
Nikita Bobko a63f83ab15 Get rid of usages of internal LibraryImpl class
KT-39327
2020-06-10 22:20:53 +03:00
Alex Plate 801c97f456 Use ModuleOrderEntry instead of ModuleOrderEntryImpl
`isProductionOnTestDependency` function was moved from implementation to
interface. The fix is important for the new IJ project model.
2020-06-10 22:19:41 +03:00
Nikolay Krasko bc20464bad 202: Restrict compatibility for 201 plugin 2020-06-10 18:05:53 +03:00
Vladimir Dolzhenko 76d819f66d Drop typo and fix fir package imports in GenerateTests.kt.192 2020-06-10 17:03:05 +02:00
Mathias Quintero e45e491718 Add options param to external dependencies resolver API 2020-06-10 16:28:41 +02:00
Mathias Quintero 83087291df Add API to get locations of collected script annotations
#KT-38404 fixed

also:
- Add wrapper class for the location combined with the location id
- Add source code location parameters to external dependency resolvers
- Add tests for locations in annotations
- Add tests for order of annotation resolution for dependencies resolvers
2020-06-10 16:28:41 +02:00
Andrey 1539128c3f Delete module kotlin-build-common included twice (#3459)
kotlin-build-common included twice in includes
2020-06-10 16:39:07 +03:00
Mikhail Zarechenskiy 3921a0ed70 Add test for obsolete issue
#KT-17341 Obsolete
 #KT-32958 Obsolete
2020-06-10 16:00:23 +03:00
Konstantin Tskhovrebov d61e40e49b Add tests for setup native run gutters. 2020-06-10 15:58:47 +03:00
Konstantin Tskhovrebov 39e1f03cd1 Fix for 192: enable native run gutters only if gradle plugin exists.
Fixed #KT-39465
2020-06-10 15:58:45 +03:00
Vasily Levchenko 25f0e38c73 [inliner] parent fix after copy
this change fix issue with inlining lambda in inline function which(function) inlined from other library.
E.g.

> cat i-lib.kt
class _special_class(val v:Int)
class _special_class1(val v:Int)

class __helper(val v:Int)

inline fun foo(h: __helper): Int {
    val sum = h.op {
        _special_class(it.v)
    }.v
    return sum
}

inline fun __helper.op(block:(_special_class1) -> _special_class) = block(_special_class1(v))

> cat i-main.kt
fun main() {
    val h = __helper(42)
    println(foo(h))
}

Here how the incorrect parent affects debug information:

(lldb) target create "program.kexe"
Current executable set to '/Users/minamoto/ws/kotlin-native/program.kexe' (x86_64).
(lldb) command source -s 0 'i-test.lldb'
Executing commands in '/Users/minamoto/ws/kotlin-native/i-test.lldb'.
(lldb) b i-lib.kt:8
Breakpoint 1: where = program.kexe`kfun:#main(){} + 435 [inlined] foo + 98 at i-main.kt:3, address = 0x00000001000540e3
(lldb) r
Process 70550 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00000001000540e3 program.kexe`kfun:#main(){} [inlined] foo at i-lib.kt:9:7
   6       inline fun foo(h: __helper): Int {
   7           val sum = h.op {
   8               _special_class(it.v)
-> 9           }.v
              ^
   10          return sum
   11      }
   12
Target 0: (program.kexe) stopped.

the parent of lambda is i-main.kt instead of i-lib.kt, and offsets calculated against wrong file.
Here is behaviour with fix:

(lldb) target create "program.kexe"
Current executable set to '/Users/minamoto/ws/.git-trees/minamoto/debug-info/subprograms-with-missed-scopes/program.kexe' (x86_64).
(lldb) command source -s 0 '/Users/minamoto/ws/kotlin-native/i-test.lldb'
Executing commands in '/Users/minamoto/ws/kotlin-native/i-test.lldb'.
(lldb) b i-lib.kt:8
Breakpoint 1: where = program.kexe`kfun:#main(){} + 337 [inlined] <anonymous>_2 at i-lib.kt:14, address = 0x0000000100054bb1
(lldb) r
Process 70560 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100054bb1 program.kexe`kfun:#main(){} [inlined] <anonymous>_2 at i-lib.kt:8:24
   5
   6       inline fun foo(h: __helper): Int {
   7           val sum = h.op {
-> 8               _special_class(it.v)
                               ^
   9           }.v
   10          return sum
   11      }
Target 0: (program.kexe) stopped.
2020-06-10 14:29:13 +02:00
Vladimir Dolzhenko 163bd34172 Fixed GenerateTests.kt.192 compilation
Relates to #KTI-17
2020-06-10 14:16:55 +02:00
Ilya Goncharov 18914ac9a5 [Gradle, JS] Fix name of publication in both mode 2020-06-10 14:52:35 +03:00
Ilya Goncharov 60d62148e8 [Gradle, JS] Fix isMain in js targets 2020-06-10 14:48:29 +03:00
Ilya Goncharov b72f7c3021 [Gradle, JS] Remove Native Only isMainCompilation only 2020-06-10 14:48:29 +03:00
Ilya Goncharov 2d068a42f4 [Gradle, JS] Use common isMain for KotlinCompilation 2020-06-10 14:48:29 +03:00
Dmitriy Dolovov 24568058e1 Minor. Remove unused code 2020-06-10 18:41:05 +07:00
Dmitriy Dolovov 84a4644490 [Commonizer] Speed-up serialization of commonized member scopes 2020-06-10 18:15:12 +07:00
Nikolay Krasko 974e01ec70 Fix bunch files after moving plugin.xml 2020-06-10 13:01:20 +03:00
Nikolay Krasko 6babc73320 AS41: Fix problems with initialization of Android plugin in tests
org/intellij/images/fileTypes/ImageFileTypeManager
java.lang.NoClassDefFoundError: org/intellij/images/fileTypes/ImageFileTypeManager
	at org.jetbrains.android.AndroidPlugin.lambda$registerWebpSupport$1(AndroidPlugin.java:50)
2020-06-10 13:01:20 +03:00