https://kotlinlang.org logo
e

Eugen Martynov

06/13/2023, 6:31 PM
Screenshot 2023-06-13 at 20.31.32.png
i

Ilya Muradyan

06/13/2023, 6:50 PM
What's the location of a file? Isn't it in a source root?
e

Eugen Martynov

06/13/2023, 6:50 PM
It is in root of the project
Screenshot 2023-06-13 at 20.51.02.png
I saw warning that it will stop compilation after 1.9
i

Ilya Muradyan

06/13/2023, 6:52 PM
It says that it's a source root at the same time
e

Eugen Martynov

06/13/2023, 6:52 PM
Not sure I understood
Screenshot 2023-06-13 at 20.54.14.png
i

Ilya Muradyan

06/13/2023, 6:56 PM
Try clicking on this cross
e

Eugen Martynov

06/13/2023, 6:56 PM
Magic! It worked
Means, it was treating it as kotlin script before and just as source?
But it is kts extension
i

Ilya Muradyan

06/13/2023, 7:01 PM
If it's part of the module sources then kotlin-main-kts should be present in this module's dependencies. It was not your case. If it's outside of the source roots, separate module is created for this script, kotlin-main-kts is added to it automatically based on file extension
e

Eugen Martynov

06/13/2023, 7:04 PM
Strange not my case, at least I don’t see extra module in project settings. Unless you say it is some invisible module. Let me check iml file or .idea folder
i

Ilya Muradyan

06/13/2023, 7:04 PM
By the way, if you're interested in Kotlin scripting, Kotlin Notebook plugin might be also interesting for you https://plugins.jetbrains.com/plugin/16340-kotlin-notebook
e

Eugen Martynov

06/13/2023, 7:05 PM
Thank you! I saw it on the KotlinConf, I didn’t expect it is available already
i

Ilya Muradyan

06/13/2023, 7:06 PM
You've created a project with the source root same as the project root. Why it happened - it's another question
e

Eugen Martynov

06/13/2023, 7:07 PM
Oke, doesn’t matter much! It kinda works now
👍 1
Thank you!!!
2 Views