Are scratch files still messed up? I remember tryi...
# getting-started
m
Are scratch files still messed up? I remember trying years ago and couldn't make any progress when depending on projects and/or external libraries. Today I tried and despite intellisense acting correctly with regards to import com.acme.Animal and val a1 = Animal("bobo") it does not run as says unresolved reference even with "use class path of module" set to containing project
g
It works for me perfectly fine for really long time, last year or two at least, with project dependencies at least (rarely add external libs which are not a part of the project)
m
just tried it from scratch. any idea whats wrong?
image.png
image.png
g
As I see your project is not synced
ah, on last one it's fine
wait, how do you run this scratch?
it's not scratch output
you running not main.kts file
m
i right click
image.png
and then Run scratch.main.kts
g
you run scratch.main.kts directly
it's not related to project at all
it just does kotlin scratch,main.kts
click here
Run on menu is runnit it as a file
m
wow, that works
thanks
g
or enable interactive mode, no need to run
m
whats happening when I right click and do the non working version?
g
also, you don't really need main.kts
I just use scratch Kotlin files
main.kts is nice when you run it as standalone thing, without IDE, as a script
> whats happening when I right click and do the non working version? So, IDE detects that it main,kts file and uses default runner for it, which is just do: kotlin script.main.kts
m
ah I see
g
if you click here (grey text) you should see how IDE runs it
m
thanks, much appreciated
👍 1
g
I tracked progress of Scratch files for long time and now they work great for me, but now I'm slowly switching to #C05333T208Y and now again on square one, reporting bugs and wait them to be stable and fast 🙈
m
I thought notebook didnt work with K2?
ah wait that Kotlin worksheets, so many ways...
g
It's the same thing
it doesn't work with K2 yet
but usually it's not an issue until you use some specific K2 feature in your notebook, you still can rely on k2 code
👍 1