you think we’ll ever get runnable Kotlin scratch f...
# announcements
s
you think we’ll ever get runnable Kotlin scratch files?
a
What are scratch files?
s
oh man, it’s one of my favorite IntelliJ features
just lets you open a new buffer and run the code you write in it
😮 1
super helpful for testing new methods or sandboxing behavior
ctrl/cmd+shift+n
and select/type Java to open a new java scratch file
a
That's awesome. Did not even know such a feature existed.
p
how is that helpful for testing anything when you can't execute anything in it?
s
it’s useful when you can execute something in it lol
p
for me it's just a more convenient notepad with syntax highlighting
👍 1
s
do you write java?
p
yes
can you execute java?
s
yeah, write a quick main method
p
huh TIL, ok
s
still needs to be in a class, but that’s nbd
a
Yeah I tried it just now. Needs to have a class and main method but once you do that you can run things.
s
also - if you have some code selected when you hit the shortcut, it’ll auto-select the language and copy the selected code into the scratch buffer
a
+10000 for adding this to Kotlin. Do you have the YT issue?
s
b
i've also been waiting for this feature, for now I just have a "scratch" unit test that I use to try things
a
I like try.kotl.in but the lack of auto complete can be difficult.
1
b
try.kotl.in has a hotkey for auto-complete, but I usually want to import stuff from libraries/my code which you can't do there
ctrl+space
😮 1
l
Also, note that try.kotl.in supports autocomplete from imports, useful when you want to play with kotlinx.coroutines for example 😋
l
Alright, the developer assigned to the issue reworded the issue name today. This is a good sign 😉
👏 2