Commit Graph

268 Commits

Author SHA1 Message Date
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
Sergey Rostov 1f52c0e0d4 gradle.kts: improve service initializtion
- prevent analyzing .gradle.kts files until all services are loaded
- remove services caches where it is not required
- replace cached services with cache only during vfs events batch processing
- prevent services loading in actions updating
2020-07-10 17:47:10 +03:00
Ilya Muradyan 2487f9369c Fix REPL completion for import directives 2020-07-09 13:19:04 +03:00
Ilya Muradyan 1798542db7 Fix and enable embedded tests in scripting-ide-services 2020-07-03 12:21:45 +03:00
Ilya Muradyan e88bef4275 Fix jar-dependent test in scripting-ide-services 2020-07-03 12:21:45 +03:00
Vladimir Dolzhenko ab20b3e083 Add InterruptedException handler to CancellableSimpleLock
#EA-220650 Fixed
2020-06-29 08:47:53 +00:00
Natalia Selezneva bcd3921bae Fix freeze during loading script configurations through legacy scripting API
Do not wrap the whole configuration loading process into readAction
^KT-39771 Fixed
2020-06-23 16:04:24 +03: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 53b31a20ca Refactor REPL IDE services testing configuration and add new tests 2020-06-19 13:03:24 +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
Vyacheslav Gerasimov b4df4e5525 Build: Fix variant resolution ambiguity 2020-06-14 20:31:27 +03:00
Vyacheslav Gerasimov 4aa3040550 Build: Use runtimeOnly instead of deprecated runtime
maven-publish plugin uses `runtimeOnly` for runtime scope instead of
`runtime`
2020-06-14 20:31:26 +03: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 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
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
Pavel Kirpichenkov 7fff8f82e2 Changes after review
- Replace leaking ModuleResolverTracker with use of ModuleDescriptor.Capabilies
- Provide API for retrieving ResolverForProject from ResolutionFacade
- Update names
2020-06-03 20:58:07 +03:00
Roman Artemev 5eae262264 [PLUGIN API] Implement custom linkage for plugin extensions 2020-06-03 12:17:14 +03:00
Natalia Selezneva fd07d5f301 Scripting setting: auto reloading of script dependencies is now per definition 2020-06-01 15:12:53 +03:00
Ilya Muradyan bbe00b2fdc Add scripting REPL completion options
nameFilter - way of filtering descriptors by their names;
filterOutShadowedDescriptors - if true, filters out descriptors
shadowed by descriptors in latter-compiled snippets. May slow down
completion performance.
2020-05-31 17:05:24 +02: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 a1c173733c Fix gradle tests after renaming scripting libs and plugin 2020-05-26 20:24:15 +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 d92e4d28f5 Provide a method to update script definitions after loading into IDE
also documenting ScriptDefinitionsProvider
2020-05-21 16:49:56 +02:00
Ilya Chernikov 4b032a14af Refactor host configuration handling and script definition creation
so it is possible now to create custom host configuration with template
and all configurations are handled consistenly.
Also introduce and use new ScriptDefinition class wrapping compilation
and evaluation configurations, that could be consistenly created from a
template.
2020-05-21 16:49:55 +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
Sergey Rostov 4daac14008 Revert due to massive flaky tests 2020-05-12 23:01:01 +03:00
Sergey Rostov 802c03b934 Script configuration: fix getting javaHome 2020-05-12 16:20:43 +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
Ilya Muradyan 7cde9b4355 Add tests for analyze return type in REPL IDE services
also refactor existing tests infrastructure
2020-05-11 10:45:49 +02:00
Ilya Muradyan 8a1b44cc2b Add snippet result type to analysis output of REPL IDE services 2020-05-11 10:45:49 +02: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
Sergey Rostov 14edc26cf1 Revert due to test failing in 201 2020-05-08 10:13:07 +03:00
Sergey Rostov aca1771619 Script configuration: fix getting javaHome 2020-05-07 21:48:46 +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 af147017b4 Fix REPL completion after "final" expressions
Final expressions here are literals, "closed" function calls,
expressions in brackets. Completion variants should not appear after
them if they are not followed by by dot (.) or double colon (::).

Note that identifiers are not considered as final expressions.
2020-04-20 08:55:29 +02:00
Ilya Muradyan 400ea13f07 Fix scripting REPL completion after literals 2020-04-17 09:37:35 +02:00
Ilya Muradyan d2fec96f38 Add new REPL API JVM implementation 2020-04-16 21:16:08 +02:00