-
Clone this random scala repository (just one of my open-source scala projects)
% git clone https://github.com/aboisvert/hotmetal.git -
Open the project in VSCode
% cd hotmetal % code . -
When prompted, click
Import build -
Open
HtmlSuite.scalato trigger compilation -
Quit VSCode and reopen the project
% code .(Be sure to keep
HtmlSuite.scalaopen before closing so it's in focus after you restart.)
Result: Metals reindexes project upon restart but doesn't recompile.
You can check this by looking at Metal's logs (open the Output view, and select Metals from the drop-down list of views)
2026.05.26 15:50:27 INFO time: indexed workspace in 1.83s
The second time you open the project, you should NOT see anything looking like:
2026.05.26 15:53:02 INFO compiling core (3 scala sources)
2026.05.26 15:53:04 INFO compiling core-test (6 scala sources)
2026.05.26 15:53:04 INFO compiling samples (8 scala sources)
2026.05.26 15:53:04 INFO time: compiled core in 2.49s
2026.05.26 15:53:04 INFO compiling bench (3 scala sources)
2026.05.26 15:53:04 INFO time: compiled samples in 0.77s
2026.05.26 15:53:04 INFO time: compiled bench in 0.23s
2026.05.26 15:53:05 INFO compiling samples-test (1 scala source)
2026.05.26 15:53:05 INFO time: compiled core-test in 1.01s
2026.05.26 15:53:05 INFO time: compiled samples-test in 0.21s
(Or similar)
Hope this helps!