Commit Graph

136 Commits

Author SHA1 Message Date
Andrei Klunnyi 2d50bd6857 KT-60193 scripts: configuration discovery might fail silently (2)
This commit covers one more case similar to what is described
in the previous commit of the series (c9eebffb).
2023-07-13 13:31:52 +02:00
Vladimir Dolzhenko 4a1552e907 Use nameSequence instead of file extensions to reduce memory allocations
#KTIJ-25470
2023-05-17 12:45:19 +00:00
Vladimir Dolzhenko 8ad781987e Optimize file extensions usage
#KTIJ-25470

Merge-request: KT-MR-10135
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-05-15 13:59:24 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Sergej Jaskiewicz e3a4d6fa56 Use star-projected types for building ScriptProvidedPropertyDescriptors
Otherwise, the type parameters of the `kotlin.script.state` property
of type `AggregatedReplStageState` were undefined, which led to
building an ill-formed signature for the script class constructor.
2023-03-03 22:08:57 +00:00
Andrei Klunnyi 661a2626f3 KT-56632 Script configuration isn't loaded for embedded code snippets
From now on we load script configurations for embedded Kotlin code
snippets. Potentially this might lead to an extra load during a file
analysis.

IDEA side test for the change is here:
`HighlightingTestGenerated.Uncategorized#testKotlinInJavaInjection`

^KT-56632 fixed
2023-03-03 12:49:38 +00:00
Ilya Muradyan 10e9ef349f Scripts: fix NPE on creating KtFileScriptSource from PSI copy 2023-02-27 13:27:48 +00:00
Ilya Chernikov 00a28f9f49 K2 Scripting: compiler extension for script configuration 2022-12-21 14:34:20 +00:00
Ilya Chernikov 5d968bc2f4 Fix gradle scripts detection in the sources
#KT-54325 fixed
2022-10-31 09:30:13 +00:00
Ilya Muradyan 7f6bd2ab1e Fix compatibility issue for kotlin.jupyter 2022-10-08 04:02:39 +02:00
Ilya Muradyan b801d963a1 [Scripting] Fix obtaining virtual file for getting compilation configuration 2022-08-31 20:51:06 +00:00
Nikita Bobko 2a4f3f41aa 2/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Note: Kotlin Maven artifacts (./gradlew publish) changed their
dependency on kotlin-reflect
2022-08-22 15:43:49 +02:00
Nikita Bobko 0874fb71c6 Replace all kotlin-reflect-api dependencies with kotlin-reflect
Review: https://jetbrains.team/p/kt/reviews/6753

Why: I'm going to replace source dependency on kotlin-reflect with
binary dependency. Normalize reflect dependency before global
processing.
2022-08-22 15:43:11 +02:00
Ilya Chernikov ceea563d63 Scripting: avoid creating multiple PSIs for every imported script
#KT-53009 fixed
#KT-42810 should be possible now too, but more testing is needed
#KT-42101 can also be addressed now, but first the serialization
 of the imported scripts property should be solved
2022-07-21 13:53:41 +00:00
Ilya Chernikov 8bc43917ec Scripting: switch default definition to new scheme
also correctly pass externaly provided configuration on compilation
and evaluation.
Fixes REPL evaluation with dependencies passed via compilation classpath.
2022-06-28 16:21:24 +02:00
Ilya Chernikov c2316ca305 Scripting: avoid definitions discovery when compiling regular kotlin
If only regular kotlin .kt (and .java) files are compiled, do not
register file extensions that may come from discovered script
definitions. Since the discovery is lazy by itself, this should
skip jars processing for regular compilation scenarios without scripts.
#KT-47816 fixed
2022-06-16 21:28:07 +00:00
Ilya Chernikov 5caf2a2aca Scripting: refactor plugin command line processing
- process command line properly when plugin is autoloaded
- add and fix options to disable definitions autoloading and discovery
- cleanup unused code
(partial test is added to "avoid definitions discovery" commit)
2022-06-16 21:28:07 +00:00
Ilya Chernikov 855059b93c Scripting: update scripts in source roots handling
#KT-52525 fixed
related to #KT-52735
2022-06-16 21:28:06 +00:00
Vladimir Dolzhenko efd5beb49b IJ file type optimizations based on extension
#KTIJ-21668

Merge-request: KT-MR-6288
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2022-05-17 14:46:00 +00:00
Ilya Chernikov 49902bb851 IR Scripting: allow to specify nullable types for provided props...
but only explicitly. This does not fix a breaking change described in
#KT-52120, because it seems the correct behavior, but it allows
to "workaround" the problem by specifying nullability explicitly.
Also improve handling of nullable bindings in JSR-223.
#KT-49173 fixed
#KT-51213 fixed
2022-04-29 11:03:11 +00:00
Ilya Chernikov 35f80c04ca IR Scripting: update capturing logic for the REPL, imported scripts,
as well as all other implicit receivers.
2022-04-04 14:55:53 +00:00
Ilya Chernikov 9d2cadc908 [minor] scripting fixes in obsolete and test code...
relax acceptedAnnotations extraction rules for obsolete script template
handling code - the previous variant was failing on the typealias
comparison

also reduce warnings and possible exceptions on some test execution
paths
2022-03-30 08:32:48 +00:00
Ilya Muradyan 9637b6b848 REPL: Fix REPL scripts metadata to be correctly recognized by class file decompiler 2022-01-27 02:23:27 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Mikhael Bogdanov c599b58eb3 Remove obsolete options 2021-12-08 12:25:02 +01:00
Mikhael Bogdanov 0997207c7c Apply -Xjvm-default for specific modules only 2021-12-03 06:39:38 +01:00
Anastasiya Shadrina 37495bcba0 [FE] Change resolution scheme 2021-12-02 20:23:57 +03:00
Anastasiya Shadrina d923c95671 [FE] Add context receivers to scope 2021-12-02 20:23:22 +03:00
Anastasiya Shadrina a39fbd3822 [FE] Add getContextReceivers to CallableDescriptor interface 2021-12-02 20:23:17 +03:00
Ilya Muradyan 6917ff7d2a [scripting] Move earlierScripts to the frontend descriptor
^KT-20488 fixed
2021-11-30 09:11:59 +03:00
Ilya Muradyan 58831eacca [scripting] Make properties from destructing declarations available with reflection 2021-10-07 18:17:21 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Dmitriy Novozhilov d46e2dd749 Fix OVERRIDE_DEPRECATION warnings in project code 2021-09-02 15:04:07 +03:00
Jinseong Jeon 5819959cce Consolidate arrayOf call names 2021-08-18 16:04:36 +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
Mikhail Zarechenskiy f8efe3b5df Make function open to overrie it IDE specific part
Namely, this function is overrided in 211 & 212 platforms, see ScriptDefinitionsManager
2021-04-21 20:00:22 +03:00
Vladimir Dolzhenko 590a8d088d Refine locking to avoid dead lock
#KT-46215 Fixed
2021-04-21 11:01:12 +00:00
Ilya Chernikov 375441832e Implement REPL support in IR scripting 2021-03-11 15:50:30 +01:00
Ilya Chernikov 4dc228a0a3 Implement proper call to the base class ctor in ir script lowering 2021-03-11 15:49:46 +01:00
Dmitry Savvinov 42345b9c49 Minor: use more clear and specific naming for LazyClassContext.typeChecker (relevant for MPP with type refinement) 2021-02-26 12:37:02 +03:00
Ilya Chernikov ef4fa3381d Pass provided script configuration to refining code
when script compilation configuration refinement
happening during parsing, the updated configuration
passed to the script compiler/REPL compile function
is now used.
#KT-44580 fixed
2021-02-09 15:22:55 +00:00
Dmitriy Novozhilov 0a47b1c32b Remove incorrectly added dependency on experimental coroutines 2021-01-29 14:57:08 +03:00
Dmitriy Novozhilov 71d8b842fd Add runtime dependency on experimental coroutines to :kotlin-scripting-compiler-impl
This is needed to keep compatibility with old gradle versions which
  are steel using kotlin 1.2 with experimental coroutines
2021-01-28 13:19:34 +03:00
Alexander Udalov b3d85e656e Fix warnings after update to 202 platform
#KT-44069 Fixed
2021-01-13 19:17:22 +01:00
Ilya Chernikov 9a7d1948a7 Implement support for -Xdefault-script-extension cli option 2021-01-07 10:37:22 +01:00
Ilya Chernikov 1bd6cc823c Fix provided properties access generation
The presense of accessors in the descriptor led to the wrong code
generation in some cases.
#KT-43176 fixed
2021-01-07 10:37:20 +01:00
Ilya Muradyan 89bba93615 Introduce GetScriptingClassByClassLoader interface
It is needed to override default JVM behaviour
2020-11-28 09:44:06 +01:00
Ilya Chernikov 7572b50385 Expose script parameters from descriptor explicitly...
and universally as ValueParameterDescriptors;
update implementation accordingly
2020-10-30 12:57:43 +01:00
Ilya Chernikov 5ab822be36 Import scope of the imported script
#KT-34178
2020-10-02 18:53:31 +02:00