https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
scripting
  • t

    Tmpod

    01/23/2020, 1:47 PM
    Hey there! I'm trying this super simple and somewhat janky setup to test scripting and I'm getting the following error after all script evaluations, even if the script only contains something like
    println("foo")
    . Here's the error:
    wrong number of arguments
    ERROR
    sp: null
    e: java.lang.IllegalArgumentException: wrong number of arguments
    null ; null
    ---
    null
    btw,
    scriptResource
    is just getting a resource from the calss loader, like this:
    val scriptResource = ModuleScript::class.java.classLoader.getResource("scripts/test.kts")
    Any idea what the issue might be?
    • 1
    • 1
  • t

    Tmpod

    01/25/2020, 10:03 PM
    Hey again, back with another question :p Has anyone got IntelliJ to recognise implicit receivers in scripts? I'm relying on those for a nice interface but I can't get the IDE to properly process it.
    i
    • 2
    • 2
  • r

    Rick Fast

    01/26/2020, 11:16 PM
    hello. question about custom .kts scripting w/
    @KotlinScript
    :
    i
    e
    • 3
    • 14
  • j

    Jakub Gwóźdź

    01/27/2020, 1:53 PM
    Hi. Is there any known workaround for https://youtrack.jetbrains.com/issue/KT-28475 ? I'd like to use some DB calls in my scripts, but when using JVM11, I end up with
    % cat script/Environment.ws.kts
    println("sql:" + javax.sql.DataSource::class.java)
    % kotlinc -Xadd-modules=java.sql -script script/Environment.ws.kts
    java.lang.NoClassDefFoundError: javax/sql/DataSource
            at Environment_ws.<init>(Environment.ws.kts:1)
    i
    • 2
    • 8
  • g

    gianluz

    02/09/2020, 8:51 PM
    good afternoon!! i have a
    .main.kts
    script, where i would like to use a local jar directly from my maven local without using
    -cp
    option at compile time.. something using
    @file:Repository("path/to/mavenlocal")
    and then
    @file:DependsOn("groupId:artifactId:version")
    i’m using the version 1.3.61 😕 any idea??
    i
    • 2
    • 13
  • e

    edwinRNDR

    02/12/2020, 3:04 PM
    Are there any strategies for speeding up the loading of scripts when embedding the script host using
    BasicJvmScriptingHost
    and
    dependenciesFromCurrentContext(wholeClasspath = true)
    and one repeatedly loads the same script with small changes?
    i
    • 2
    • 8
  • s

    SrSouza

    02/15/2020, 3:56 PM
    Hi, I'm not active here but I want to ask something that I not test, kscript on IDEA using @file:MavenRepository + @file:DependsOnMaven, the IDEA can resolve that? If yes, three is any configuration to script definition that you can provide implicit repositories and dependencies just for the IDEA can give the dependencies resolution on the script?
    i
    • 2
    • 5
  • e

    Egor

    02/17/2020, 1:32 PM
    Hi. I have a problem with running kotlin script from Intellij with custom template. I added discovery file to the project, as a result IDE see the script with custom extension and I am able to navigate to methods defined in my custom script template. But when I try to run the script with run configuration I see the Error: “error: error processing script definition class com.some.scripting.CustomScriptTemplate: Unable to construct script definition: Expecting KotlinScript annotation on the class com.some.scripting.CustomScriptTemplate” My CustomScriptTemplate has this annotation. I’ll appreciate any help. @ilya.chernikov do you have any idea?
    i
    • 2
    • 2
  • l

    Leon K

    02/19/2020, 10:35 AM
    Is there any "official" documentation on Embedded (as in, JVM-Embedded, not microcomputer-embedded) kotlin-scripting with or without JSR223? is there any documentation on JSR223? The only way I was able to use this feature is by following some old blog-posts and issue-threads, I've never stumbled upon actual documentation. And I'm having a lot of problems with my scripting (it seems to not clean up any memory, -> memory-leak that i don't know how to prevent)) and I have no idea where to find out what I'm doing wrong. many of these problems here seem to come from a point of "I read a few blog-posts, now it isn't working the same way as i'm using a different language or context, what do i do"....
    i
    j
    • 3
    • 10
  • s

    SrSouza

    03/03/2020, 9:37 PM
    What is the current state of @ScriptBody and support for scripts with Coroutines (suspend keyword) ?
    i
    • 2
    • 1
  • l

    Leon Linhart

    03/04/2020, 1:34 PM
    Hey, I've been having some issues getting IntelliJ to recognize my script definitions. The IDE log suggests that the issue is caused by some access problems:
    java.lang.IllegalAccessException: class kotlin.reflect.jvm.internal.KClassImpl$Data$objectInstance$2 cannot access a member of class com.github.themrmilchmann.kwiki.dsl.SiteScriptCompilationConfiguration with modifiers "public static final"
    (I will include the full stacktrace as a thread comment.) However, my compilation configuration is a public object as shown in examples in this channel before. (
    object SiteScriptCompilationConfiguration : ScriptCompilationConfiguration({ ... })
    ) Now my actual question is what I can do to debug this further? (Could this be an issue caused by using Java 11 as IDE runtime?)
    i
    • 2
    • 14
  • f

    fcosta

    03/04/2020, 9:28 PM
    $ ./jvm/main-kts/scripts/kotlin-shell.main.kts 
    :: problems summary ::
    :::: WARNINGS
    		module not found: eu.jrie.jetbrains#kotlin-shell-core;0.2.1
    
    	==== central: tried
    
    	  <https://repo1.maven.org/maven2/eu/jrie/jetbrains/kotlin-shell-core/0.2.1/kotlin-shell-core-0.2.1.pom>
    
    	  -- artifact eu.jrie.jetbrains#kotlin-shell-core;0.2.1!kotlin-shell-core.jar:
    
    	  <https://repo1.maven.org/maven2/eu/jrie/jetbrains/kotlin-shell-core/0.2.1/kotlin-shell-core-0.2.1.jar>
    
    error: cannot access script base class 'org.jetbrains.kotlin.mainKts.MainKtsScript'. Check your module classpath for missing or conflicting dependencies (kotlin-shell.main.kts:3:1)
    error: unresolved reference: Repository (kotlin-shell.main.kts:3:7)
    error: unresolved reference: DependsOn (kotlin-shell.main.kts:4:7)
    error: unresolved reference: DependsOn (kotlin-shell.main.kts:5:7)
    error: unresolved reference: CompilerOptions (kotlin-shell.main.kts:6:7)
    error: unresolved reference: kotlinx (kotlin-shell.main.kts:7:13)
    error: an annotation argument must be a compile-time constant (kotlin-shell.main.kts:7:13)
    error: unresolved reference: eu (kotlin-shell.main.kts:9:8)
    error: unresolved reference: shell (kotlin-shell.main.kts:11:1)
    error: unresolved reference: args (kotlin-shell.main.kts:12:9)
    error: expression '"ls -l"' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found (kotlin-shell.main.kts:13:9)
    error: unresolved reference: pipeline (kotlin-shell.main.kts:21:9)
    error: unresolved reference: args (kotlin-shell.main.kts:22:20)
    error: unresolved reference: process (kotlin-shell.main.kts:22:30)
    error: unresolved reference: streamLambda (kotlin-shell.main.kts:23:21)
    error: cannot infer a type for this parameter. Please specify it explicitly. (kotlin-shell.main.kts:23:36)
    error: cannot infer a type for this parameter. Please specify it explicitly. (kotlin-shell.main.kts:23:42)
    error: cannot infer a type for this parameter. Please specify it explicitly. (kotlin-shell.main.kts:23:45)
    error: expression '"wc ${args[0]}"' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found (kotlin-shell.main.kts:44:9)
    error: unresolved reference: args (kotlin-shell.main.kts:44:15)
    jvm/main-kts/scripts/kotlin-shell.main.kts: error: unresolved dependency: eu.jrie.jetbrains#kotlin-shell-core;0.2.1: not found
    jvm/main-kts/scripts/kotlin-shell.main.kts:3:1: error: cannot access script base class 'org.jetbrains.kotlin.mainKts.MainKtsScript'. Check your module classpath for missing or conflicting dependencies
    @file:Repository("<https://dl.bintray.com/jakubriegel/kotlin-shell>")
    ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:3:7: error: unresolved reference: Repository
    @file:Repository("<https://dl.bintray.com/jakubriegel/kotlin-shell>")
          ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:4:7: error: unresolved reference: DependsOn
    @file:DependsOn("eu.jrie.jetbrains:kotlin-shell-core:0.2.1")
          ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:5:7: error: unresolved reference: DependsOn
    @file:DependsOn("org.slf4j:slf4j-simple:1.7.28")
          ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:6:7: error: unresolved reference: CompilerOptions
    @file:CompilerOptions("-Xopt-in=kotlin.RequiresOptIn")
          ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:7:13: error: unresolved reference: kotlinx
    @file:OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)
                ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:7:13: error: an annotation argument must be a compile-time constant
    @file:OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)
                ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:9:8: error: unresolved reference: eu
    import eu.jrie.jetbrains.kotlinshell.shell.*
           ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:11:1: error: unresolved reference: shell
    shell {
    ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:12:9: error: unresolved reference: args
        if (args.isEmpty()) {
            ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:13:9: error: expression '"ls -l"' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found
            "ls -l"()
            ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:21:9: error: unresolved reference: pipeline
            pipeline {
            ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:22:20: error: unresolved reference: args
                "cat ${args[0]}".process() pipe
                       ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:22:30: error: unresolved reference: process
                "cat ${args[0]}".process() pipe
                                 ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:23:21: error: unresolved reference: streamLambda
                        streamLambda { strm, _, _ ->
                        ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:23:36: error: cannot infer a type for this parameter. Please specify it explicitly.
                        streamLambda { strm, _, _ ->
                                       ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:23:42: error: cannot infer a type for this parameter. Please specify it explicitly.
                        streamLambda { strm, _, _ ->
                                             ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:23:45: error: cannot infer a type for this parameter. Please specify it explicitly.
                        streamLambda { strm, _, _ ->
                                                ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:44:9: error: expression '"wc ${args[0]}"' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found
            "wc ${args[0]}"()
            ^
    jvm/main-kts/scripts/kotlin-shell.main.kts:44:15: error: unresolved reference: args
            "wc ${args[0]}"()
                  ^
    m
    i
    j
    • 4
    • 10
  • p

    Paul Woitaschek

    03/06/2020, 8:31 AM
    My kotlin scripts are all really flaky because they require a specific file in the same folder as the script. So when I don't execute them from the directory where they are located, they fail. Is there some way I can get the location of the script from inside the script?
    m
    a
    i
    • 4
    • 4
  • t

    Tmpod

    03/10/2020, 4:15 PM
    @ilya.chernikov Hey! I'm trying out my scripting stuff in 1.3.70 now and I still can't get IntelliJ to recognise the implicit receivers. I have the META-INF in the right place (afaik) and I've set
    ide { acceptedLocations(ScriptAcceptedLocation.Everywhere) }
    in the compilation settings
    i
    r
    • 3
    • 24
  • l

    Luis Munoz

    03/16/2020, 3:40 PM
    I have many kotlin scripts that suspend querying external services. The problem I am having is that I am having to create many script engines because as far as I understand running engine.eval isn't thread safe. Is this correct? Is there anyway to run scripts that suspend and not eat up an entier thread? or si the recommended usage is to make sure eval is never running on different threads?
    Untitled
    i
    • 2
    • 2
  • p

    Paul Woitaschek

    03/20/2020, 8:36 AM
    How can I pass an argument to kts file? When I run
    kotlin my-script.main.kts --hello
    the compiler doesn't pass it through:
    error: invalid argument: --hello
    v
    • 2
    • 2
  • p

    Paul Woitaschek

    03/20/2020, 9:49 AM
    How can I add the serialization plugin to a kts script?
    ➕ 2
    ❓ 2
    t
    m
    i
    • 4
    • 5
  • c

    Czar

    03/26/2020, 1:24 PM
    I'm trying to redirect script output to a
    Flow<String>
    Attached is a scratch file I'm playing in, it prints
    test
    whereas I expect it to print
    Z: test
    if output redirection worked. Any idea what am I doing wrong? Or is Kotlin ScriptEngine just ignoring context that is passed in to eval?
    output-redirection_kts.kt
    i
    d
    • 3
    • 6
  • p

    Paul Woitaschek

    03/27/2020, 2:01 PM
    I found something interesting. Can someone confirm that the first execution of this script prints
    false
    and the second execution throws a
    KotlinReflectionNotSupportedError
    ?
    test_main_kts.kt
    i
    • 2
    • 3
  • n

    Nikky

    03/27/2020, 7:05 PM
    i am getting this error again:
    Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
    i have thise code in place... and it used to work
    compilerOptions.append("-jvm-target 1.8")
    has anything changed there ?
    i
    • 2
    • 2
  • p

    Paul Woitaschek

    03/28/2020, 8:26 AM
    How can I use free compiler args? This doesnt remove the warning: `
    @file:CompilerOptions("-Xuse-experimental=kotlin.ExperimentalStdlibApi")
    i
    • 2
    • 1
  • n

    Nikky

    03/29/2020, 2:35 AM
    and what does
    ide.dependencySources
    do ? can i make the ide know about which files are used as dependencies (instead of all files in sources) ? that wuld be useful, because i have multiple scripts that have different files they use as dependencies each.. but the ide does not look at the
    importScripts
    that are used
    i
    • 2
    • 2
  • l

    Lorin

    04/01/2020, 1:43 AM
    I might find a bug in kotlin-scripting (v1.3.61 and v1.3.70). The code is as follows:
    @KotlinScript(fileExtension = "simplescript.kts")
    abstract class SimpleScript
    
    fun main() {
        val config = createJvmCompilationConfigurationFromTemplate<SimpleScript> {
            jvm {
                dependenciesFromCurrentContext(wholeClasspath = true)
            }
        }
    
        val s = """
            println("This is a test!")
        """.trimIndent()
    
        val res = BasicJvmScriptingHost().eval(s.toScriptSource(), config, null)
        println(res)
    }
    Running this program, the output is as follows:
    This is a test!
    Success(value=EvaluationResult(returnValue=Unit, configuration=kotlin.script.experimental.api.ScriptEvaluationConfiguration@a9a8cb94), reports=[])
    Though the evalution of this script is successful,
    EvaluationResult.returnValue
    is
    Unit
    , which is not expected. I try to run this program with kotlin-scripting (v1.3.31), the output is:
    This is a test!
    Success(value=EvaluationResult(returnValue=:  = Script_simplescript@3ddf2a72, configuration=kotlin.script.experimental.api.ScriptEvaluationConfiguration@a4b45b1a), reports=[])
    It is clear that the script object (Script_simplescript@3ddf2a72) is stored in
    EvaluationResult.returnValue
    , which is the desirable behavior for me. Could anyone from JB confirm it? Thanks!
    i
    n
    • 3
    • 6
  • g

    gammanik

    04/02/2020, 1:35 PM
    Hello! Are there any repos or examples of how to use Kotlin script engine in Intellij plugin dev? I’m trying to start with a simple code:
    setIdeaIoUseFallback()
    val engine = ScriptEngineManager().getEngineByExtension("kts")!!
    I’ve added dependencies and
    /services/javax.script.ScriptEngineFactory
    file. But the engine is actually null.
    i
    • 2
    • 5
  • m

    mbonnin

    04/03/2020, 5:03 PM
    Do
    *.main.kts
    support dependencies resolution ? The following doesn't work:
    #!/usr/bin/env kotlin
    
    @file:DependsOn("com.squareup.moshi:moshi:1.9.2")
    @file:DependsOn("com.squareup.okio:okio:2.4.3")
    
    import okio.source // error: unresolved reference: source
    import <http://java.io|java.io>.File
    
    File("foo").source()
    if I swap the imports of okio and moshi, it works well though, leading me to think that the script will import the first version it encounters ?
    j
    • 2
    • 7
  • j

    jimn

    04/04/2020, 4:36 AM
    did i paste the example wrong?
    e
    h
    • 3
    • 4
  • g

    Gary Tierney

    04/05/2020, 6:14 PM
    @ilya.chernikov is there anything different about how completion contributors or import suggestions are done in the IDE for kotlin scripts? I have a script definition whose scripts are unable to get code assistance on imports or symbol names (and has been that way since around 1.3.40). I'm looking into debugging the Kotlin plugin now, but it's a little difficult without an easy way to configure debug sources.
    i
    • 2
    • 9
  • s

    SrSouza

    04/10/2020, 10:59 PM
    Hi @ilya.chernikov, I saw the LightEditor from IntelliJ 2020.1, is really cool for editing simples files, or single files that a project is not needed. You think that in the feature LightEditor will be able to be used to edit Kotlin scripts without a project?
    👍 1
    e
    m
    i
    • 4
    • 5
  • m

    mbonnin

    04/12/2020, 2:34 PM
    Can I add mavenLocal to a script using
    @file:Repository
    ? I tried
    @file:Repository("file:///Users/m.bonnin/.m2/repository")
    but that doesn't seem to work
    • 1
    • 1
  • s

    steenooo

    04/13/2020, 5:57 PM
    Is it possible to only compile the script to JVM Bytecode with the scripting api? So I can apply some changes to it on runtime
    ➕ 2
    i
    • 2
    • 1
Powered by Linen
Title
s

steenooo

04/13/2020, 5:57 PM
Is it possible to only compile the script to JVM Bytecode with the scripting api? So I can apply some changes to it on runtime
➕ 2
i

ilya.chernikov

04/14/2020, 5:03 PM
There are no well-defined hooks for doing this, but you can use a pseudo-evaluator, simplar to the
BasicJvmScriptClassFilesGenerator
to get an access to the bytecode.
View count: 5