Commit Graph

2764 Commits

Author SHA1 Message Date
Nikita Bobko
39fa2b0baf Delete Kotlin IntelliJ IDEA plugin sources
Kotlin plugin sources were migrated to intellij-community:
https://github.com/JetBrains/intellij-community/tree/master/plugins/kotlin

Preserve `jps-plugin/testData/incremental`
because it's used in `compiler/incremental-compilation-impl/test`

Preserve `idea/testData/multiModuleHighlighting/multiplatform`
because it's used in `MppHighlightingTestDataWithGradleIT`
2021-07-21 11:23:43 +02:00
Ilya Muradyan
46bbe5b1cb Replace Ivy resolver with Maven resolver in all places 2021-07-19 21:31:49 +03:00
Ilya Chernikov
0cd29adcc7 Get rid of kotlinx-coroutines usage in scripting libs and plugins
the dependency on the coroutines library caused various problems like
KT-30778, or stdlib/runtime version conflicts.
The only function used was `runBlocking`, so this change replaces it
with the internal implementation based on the similar internal thing
from the stdlib.
#KT-30778 fixed
2021-07-19 16:35:36 +03:00
Ilya Chernikov
56805dded8 [minor] IR: minor builtins infrastructure fixes 2021-07-16 02:24:40 +03:00
Ilya Chernikov
dee0487185 IR: Refactor IrBuiltIns to abstract it from descriptors 2021-07-16 02:24:18 +03:00
Georgy Bronnikov
20b76d4149 JVM_IR: reorganize initialization of JvmGeneratorExtensionsImpl
CachedFields are now created at initialization.
Therefore we need CompilerConfiguration as a constructor parameter.
2021-07-14 21:20:30 +03:00
Alexander Udalov
7a42f603f2 JVM IR: rename mangler implementation classes 2021-07-13 01:54:41 +02:00
Ilya Muradyan
55ec6729b0 [REPL] Fix completion after final expressions 2021-07-09 04:06:53 +03:00
Ilya Muradyan
787ce6335c Change nestedClasses logic to accept classes with nested type aliases
#KT-47650 fixed
2021-07-08 21:04:53 +03:00
Dmitriy Novozhilov
11faf04a4c [Test] Remove dependencies on IDEA classes from test modules
Some of IDEA services (like in `com.intellij/execution`) was copied,
  because they are used in tests but jars with them compiled with
  jdk 11 and we run our tests on jdk 8, so their bytecode can not
  be read
2021-07-08 13:29:19 +03:00
Nikita Bobko
3ca0e11dab Add README to scripting-ide-common
Originally, we though that we would move classes from `ide-common` from Kotlin plugin to this
module but it turns that these classes are heavily used in Kotlin plugin and it's better to
keep them with the rest of Kotlin plugin. So now classes in `scripting-ide-common` are copy-pasted
2021-07-08 10:01:34 +00:00
Nikita Bobko
fbe062ee64 [refactoring] Move files in scripting-ide-common into unique subpackage
I am afraid of FQN clashes with classes in `ide-common` in kotlin-ide
2021-07-07 16:51:45 +02:00
Nikita Bobko
339231b05e Move KtFunctionLiteral.findLabelAndCall from kotlin-ide.frontend-independent to compiler.psi
I want to be able to use this function in `:kotlin-scripting-ide-common` & `frontend-independent`

This commit also allows to remove copy-pasted `findLabelAndCall` in `scripting-ide-services` module
2021-07-07 16:51:44 +02:00
Dmitry Gridin
a8a6f51a0e [common] fix flexible type approximation in renders
^KTIJ-3030 Fixed

(cherry picked from commit 4855d88a9f6fbce9aeeea6fe1f29dd099a833aed)

KT-CR-2373
2021-07-07 16:51:44 +02:00
Matthew Gharrity
958b0ff24a Ignore diagnostics in ShadowedDeclarationsFilter
During code completion, ShadowedDeclarationsFilter resolves many
synthetic calls (sometimes >1000 for certain projects/scenarios).
By ignoring diagnostics we can avoid running call checkers
during this process (pending a sibling change in the compiler).

Relates to KT-44276 and github.com/JetBrains/kotlin/pull/4027
2021-07-07 16:51:44 +02:00
Matthew Gharrity
e2109c3f8f ShadowedDeclarationsFilter: check for equivalence
If there are multiple copies of the same library on the classpath,
then ShadowedDeclarationsFilter becomes very slow because it
encounters many equal-signature declarations and thus has to resolve
a lot of calls in order to pick among them.

Having multiple copies of the same library on the classpath is
somewhat common in real-world projects. It occurs in the
JetBrains/intellij-kotlin project, for example. In that project,
ShadowedDeclarationsFilter ends up resolving thousands of calls,
accounting for around 80% of completion time when there are
many completion results (see KT-44276).

We can optimize ShadowedDeclarationsFilter by checking whether the
descriptors in an equal-signature group are structurally equivalent.
If they are, we can just pick one rather than running resolve.

Testing on a small project with Kotlin stdlib duplicated on the
classpath, this change reduces overhead in ShadowedDeclarationsFilter
from 1200 ms to 20 ms when running completion on the prefix 'a'.
End-to-end completion time is cut in half.

Test: JvmBasicCompletionTestGenerated.Common.Shadowing
2021-07-07 16:51:43 +02:00
Andrei Klunnyi
decfcd28d2 KT-39398 Wrong import of unrelated object member is suggested for receiver
Receiver of a function call '<receiver>.foo()' (where receiver is a
class/object/alias name) might be specified incorrectly - corresponding
[companion] object might not be declared.

Before this commit '<receiver>' was considered to be undefined (null).
As a consequence, import suggestion included all 'foo()' functions from
the search scope.

Now as a value of '<receiver>' we set class/object/alias itself
resulting in an empty import suggestion list.
See org/jetbrains/kotlin/idea/util/CallType.kt:307
(#extractReceiverTypeFrom(descriptor: ClassDescriptor)).
2021-07-07 16:51:43 +02:00
Nikita Bobko
365821ae54 2/2 Extract code which is required for :kotlin-scripting-ide-services from ide-common into seprate module
Extract the code and keep it in Kotlin repo. See previous preparation commit as well
2021-07-07 16:51:43 +02:00
Nikita Bobko
cf3f35e1c8 1/2 Preparation commit: move ide-common files which are required for scripting to separate directory
This commit is needed to preserve git history
2021-07-07 16:51:43 +02:00
Ilya Kirillov
51576c70b6 FIR: introduce package directive
The package directive is needed for KtElement -> FirElement mapping in IDE.
There should be some FirElement which will be result of mapping of elements
inside KtPackageDirective.
2021-07-06 22:49:50 +03:00
Sergey Shanshin
0d211a53cb Support serializable classes clash with JVM primitive types by name
Fixes Kotlin/kotlinx.serialization#1353
2021-07-06 12:52:53 +03:00
Yahor Berdnikau
7789054547 Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
2021-07-05 14:11:12 +00:00
Andrey Zinovyev
1130344fb1 [lombok] Get field names directly from JavaClassImpl
Otherwise it fails with recursion on annotation types
#KT-47513 Fixed
2021-06-30 10:44:31 +03:00
Dmitriy Novozhilov
f400477c70 [FIR] Remove generic parameter from FirDeclaration 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov
725be466f0 [FIR] Move declaration utils to separate package 2021-06-29 21:03:29 +03:00
Dmitriy Novozhilov
1324e9223f [FIR] Make FirDeclaration an abstract class 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov
b3e5c6e079 [FIR] Add symbol to all declarations. Get rid of FirSymbolOwner 2021-06-29 21:03:28 +03:00
Andrey Zinovyev
c8fa8b0444 [lombok] Don't fail on fake overrides
#KT-47455 Fixes
2021-06-27 13:46:09 +03:00
Nikita Bobko
938cd955e1 Remove :idea prefix in IDE FIR modules which are going to stay in kotlin repo
This commit fixes not possibility to build project with `disableKotlinPluginModules`
flag on because Gradle tries to resolve `:idea` module which is disabled
2021-06-22 03:06:16 +03:00
Jinseong Jeon
bc09d94717 FIR UAST: running resolve API tests for both plugins 2021-06-21 13:49:47 +03:00
Jinseong Jeon
610b68c29d FIR/UAST: commonize expressions with label 2021-06-21 13:49:46 +03:00
Jinseong Jeon
fa613a32b2 FIR/UAST: commonize safe qualified expression 2021-06-21 13:49:45 +03:00
Jinseong Jeon
2999d0bd4b FIR/UAST: commonize double colon expressions 2021-06-21 13:49:44 +03:00
Jinseong Jeon
77e8aed995 FIR/UAST: move multi resolve utils/APIs to the base module/service 2021-06-21 13:49:42 +03:00
Jinseong Jeon
e870bf7399 FIR/UAST: commonize simple reference expression 2021-06-21 13:49:41 +03:00
Jinseong Jeon
4ec745abd7 FIR: relax simple type requirement in AbstractTypeMapper
The counterparts in old FE don't have such restriction, so it can
map a type that has a flexible type as a type argument to JVM type,
e.g., Stream<String..String?>
2021-06-21 13:49:40 +03:00
Jinseong Jeon
08e486d1a7 FIR/UAST: commonize dot qualified expression 2021-06-21 13:49:39 +03:00
Ilya Kirillov
f00170eb31 FIR IDE: add missing runtime dependencies for tests 2021-06-21 02:50:11 +02:00
Jinseong Jeon
833761ac3c FIR IDE/UAST: add KtCompileTimeConstantProvider with evaluate API 2021-06-19 21:58:41 -07:00
Jinseong Jeon
cda1a7edbe FIR/UAST: commonize UAnnotationMethod 2021-06-19 11:39:46 +02:00
Jinseong Jeon
638b0beadb FIR UAST: unify UMethod creation 2021-06-19 11:39:46 +02:00
Jinseong Jeon
5ec5b7f041 FIR/UAST: commonize constructor declarations 2021-06-19 11:39:45 +02:00
Jinseong Jeon
cbaa645dbe FIR/UAST: commonize base UMethod 2021-06-19 11:39:45 +02:00
Jinseong Jeon
4a06ca637a FIR/UAST: commonize anonymous UClass 2021-06-19 11:39:45 +02:00
Jinseong Jeon
3bd4cb274d FIR/UAST: commonize invalid UClass 2021-06-19 11:39:44 +02:00
Jinseong Jeon
1749c90083 FIR/UAST: commonize base UClass (with bogus annotation abstraction) 2021-06-19 11:39:44 +02:00
Jinseong Jeon
06c20bb10e FIR/UAST: commonize abstraction of Kotlin UClass 2021-06-19 11:39:43 +02:00
Jinseong Jeon
0c011f4e73 UAST: place method declarations together 2021-06-19 11:39:43 +02:00
Jinseong Jeon
beddf03f74 FIR/UAST: convert annotation via base converter 2021-06-19 11:39:42 +02:00
Jinseong Jeon
33ff90a6da FIR/UAST: commonize named/vararg expressions 2021-06-19 11:39:42 +02:00