Commit Graph

138 Commits

Author SHA1 Message Date
Roman Artemev
cd9e341fa9 [JS IR] Support additional repositories in CLI (compiler part) 2021-01-26 19:23:22 +03:00
Alexander Udalov
3be62dfc89 Build: enable -Werror in stdlib/core/compiler/plugins modules
Exclude modules where there are still warnings in an explicitly declared
variable `tasksWithWarnings`.

Also remove "-progressive" from compiler arguments in modules which are
built with non-latest language version, as the warning about that leads
to an error with -Werror.
2021-01-13 19:34:24 +01:00
Ilya Chernikov
9a7d1948a7 Implement support for -Xdefault-script-extension cli option 2021-01-07 10:37:22 +01:00
Zalim Bashorov
0372dae3ce [JS scripting] Remove usages of descriptor based APIs and proper support for callable references 2020-12-28 18:53:53 +03:00
Zalim Bashorov
7c5ea414b7 [JS IR] Use mappedNames in NameTable only for REPL
And throw exception for unsupported types in mapToKey
2020-12-24 20:03:21 +03:00
Ilya Chernikov
65cf941b9b Remove assertion about dispatch receiver in scripts
#KT-42530 fixed
2020-12-21 09:43:44 +01:00
Alexander Udalov
691b20a685 JVM IR, FIR: set IR configuration key to true if FIR is enabled 2020-12-20 23:14:41 +01:00
Ilya Muradyan
65ce7cd0c2 Fix path for Windows in Fibonacci test 2020-11-28 09:44:06 +01:00
Mikhail Glukhikh
037c505069 Unbind general FirDiagnostic from PsiFile & PsiElement 2020-11-26 08:37:49 +03:00
Mikhail Glukhikh
1795c4f3e5 Implement common Diagnostic(Factory/Renderer) in related FIR classes 2020-11-26 08:37:46 +03:00
Ilya Gorbunov
b2b2629e79 Use new kotlin.io.path API in tests 2020-11-20 09:03:25 +03:00
Ilya Chernikov
af7102a586 Enable IR backend in script compiler 2020-10-30 12:57:42 +01:00
Ilya Chernikov
d7112a4500 Implement JVM IR support for scripts 2020-10-30 12:57:42 +01:00
Ilya Chernikov
db23460fd5 Implement proper script runtime exception rendering with tests
#KT-42335 fixed
2020-10-06 21:43:11 +02:00
Alexander Udalov
1d15a5547d Suppress deprecation warnings related to scripting 2020-08-20 14:58:11 +02:00
Ilya Chernikov
0a9089bc72 Set correct base classloader for REPL evaluation
the contributed partial fix of KT-35925 set it to the system classloader
which brought in many cases the compiler CP into the evaluation and lead
to the problems like KT-40898. This fix set it to the extension/platform
classloader, which preserves (partial) fix of the KT-35925 and do not
bring the compiler jar into the REPL evaluation classpath.

#KT-40898 fixed
2020-08-19 15:17:07 +02:00
Alexander Udalov
cce55f1609 IR: add module ir.tree.impl, move main IR implementation there 2020-07-28 19:04:44 +02:00
Alexander Udalov
db4cbe7103 IR: use IrFactory in SymbolTable 2020-07-28 12:05:23 +02:00
Alexander Udalov
d3a34a8898 Psi2Ir: somewhat simplify Psi2IrTranslator API
Inline some methods only used once, deduplicate usages, rearrange
parameters, etc.
2020-07-22 22:38:21 +02:00
Ilya Chernikov
cd1bf563cd Add error reporting on the options parsing errors in scripting
also report standard parsing warnings
also fix language version test, since it is not possible anymore
  to use version 1.0
2020-06-19 13:20:58 +02:00
Mathias Quintero
f0bc52222d Fix annotation construction with array literals
Turns out the issue happens to be that ArrayValue uses a list of values which needs to be translated to an array of the percise type before it is used by callBy

This also addresses handling of arguments after a vararg in an annotation
2020-06-19 13:20:57 +02:00
Efeturi Money
8cb4f59114 Explicitly handle array annotation args in scripting pre-processing
#KT-35411 fixed
2020-06-19 13:20:57 +02:00
Ilya Muradyan
743abea690 Don't create default importing scopes for REPL snippets
Default scopes should be created only once, for the first snippet.
All following snippets should not create new default importing scopes.
#KT-35651 fixed
2020-06-19 13:03:25 +02:00
Ilya Muradyan
94de114894 Support selective filtering of implicits for extensions resolution in REPL 2020-06-19 13:03:23 +02:00
Ilya Chernikov
8fb41e4562 Process compiler plugins and options in scripting compiler
#KT-37766 fixed
2020-06-16 17:11:33 +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
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
Ilya Muradyan
489290263f Add info about the end of range in scripting REPL compiler messages 2020-06-05 21:58:28 +02:00
Ilya Chernikov
5e33612238 Extract interface from CompilerMessageLocation to ease extension
The CompilerMessageLocation is an implicit part of the binary daemon
protocol so changing it breaks compatibility with older daemons.
This change allows to extend location for non-daemon uses without
breaking the binary protocol.
2020-06-05 21:58:27 +02:00
Roman Artemev
5eae262264 [PLUGIN API] Implement custom linkage for plugin extensions 2020-06-03 12:17:14 +03:00
Ilya Chernikov
dec8eb7899 Revert renaming scripting plugin jar:
it conflicts with the compilation on daemon, so transistion should
be planned accordingly, and now it is not a good time for it.
The most important part of the renaming remains intact.

Partially reverts commit "Rename scripting libs and plugin - invert embeddable suffix"
2020-05-27 13:15:50 +02:00
Ilya Chernikov
2509dfb287 Rename scripting libs and plugin - invert embeddable suffix
now regular, unshaded libs, are named with suffix `-unshaded`, while
former `-embeddable` ones named without any suffix. This will encoursge
use of the shaded libs by default, avoiding conflicts with 3-party
libs packed into the `kotlin-compiler`.
Note, that only the "frontline" libs are renamed to avoid switching
problems, the ones that not normally used directly are left as is,
including the `kotlin-compiler` itself.
2020-05-26 15:58:25 +02:00
Ilya Chernikov
f363134fbc Do not continue compilation if collected dependencies contain error
avoids additional errors reported by compilation, if configuration
refinement returned error
2020-05-21 16:49:56 +02:00
Ilya Chernikov
255ad47406 Use copied key to extract default jdkHome from host configuration 2020-05-21 16:49:55 +02:00
Ilya Chernikov
fb6ef38370 Revert "Add info about the end of range in scripting REPL compiler messages"
This reverts commit af251caf, because it breaks daemon/client
compatibility, which we'd like to keep as much as possible
2020-05-15 21:15:48 +02:00
Roman Artemev
31af1e6ca7 [JS SCRIPT] Fix ScriptDependencyCompiler
- Invoke KotlinIrLinker properly
2020-05-14 17:58:33 +03:00
Roman Artemev
3c50b47333 [IR] Add new API into IrBuiltIns to access functional interfaces 2020-05-12 14:29:53 +03:00
Roman Artemev
a477aa7289 [KLIB] Pass IrFunctionFactory from outside 2020-05-12 14:29:53 +03:00
Svyatoslav Kuzmich
3d5003d476 [JS_IR] Use new plugin to build Kotlin/JS stdlib with IR compiler
- Switch to building stdlib with bootstrap compiler since IR is stable
  enough
- Build stdlib with coreLibs by default
- Include JS IR stdlib to kotlin distribution
2020-05-08 10:37:48 +03:00
Georgy Bronnikov
9561cc8270 JVM_IR: JvmNameProvider 2020-04-28 18:19:46 +03:00
Georgy Bronnikov
82d55e1a67 Minor: remove unused parameters, reformat code 2020-04-28 18:19:46 +03:00
Ilya Muradyan
d2fec96f38 Add new REPL API JVM implementation 2020-04-16 21:16:08 +02:00
Ilya Muradyan
b240fce224 Add incompleteCode diagnostic type 2020-04-16 21:16:08 +02:00
Ilya Muradyan
af251cafa4 Add info about the end of range in scripting REPL compiler messages 2020-04-16 21:16:08 +02:00
Ilya Chernikov
4ecedf2e3b Get rid of KTUsefulTestCase, improve stability of the tests 2020-04-14 14:15:11 +02:00
Roman Artemev
a9788f9506 [KLIB] Create an abstract class for module deserializer
- Introduce Ir-based Functional interface factory
 - Switch from LazyIr to pure
 - Use kotlin library to access raw bytes
 - Link dirty files against IC cache and dependencies instead of LazyIr
 - Move `DescriptorByIdSignatureFinder` from K/N to common
 - Support inline-bodies only MODE
2020-04-14 11:12:08 +03:00
Ilya Chernikov
195a90d333 Cleanup warnings in scripting code 2020-04-13 13:49:34 +02:00
Ilya Chernikov
d863dc04e6 Move compiler scripting tests to scripting plugin, remove unused funs
also remove some tests that are covered in the scripting-compiler
tests now.
Part of the cleanup to rewrite scripting to the new infrastructure.
2020-04-13 13:49:34 +02:00
Ilya Chernikov
138efda19f Refactor scripting - get rid of unused type parameter in CompiledScript 2020-04-13 13:49:33 +02:00
Ilya Chernikov
c64ba50655 Abstract script compiled module implementation used in saving/caching
removes classloading problem when main-kts is loaded from a CL
without scripting compiler.
Also relax dependencies collection on saving to a jar and hide redundant
logging.
Running main.kts script via a run configuration works now.
#KT-37765 fixed
2020-04-13 13:49:32 +02:00