Skip to content

Instantly share code, notes, and snippets.

@aboisvert
Created May 26, 2026 21:00
Show Gist options
  • Select an option

  • Save aboisvert/3eacd367a22da200705c64e9a3cd2065 to your computer and use it in GitHub Desktop.

Select an option

Save aboisvert/3eacd367a22da200705c64e9a3cd2065 to your computer and use it in GitHub Desktop.
Instructions to show that Metals doesn't recompile a project upon restart
  1. Clone this random scala repository (just one of my open-source scala projects)

     % git clone https://github.com/aboisvert/hotmetal.git
    
  2. Open the project in VSCode

     % cd hotmetal
     % code .
    
  3. When prompted, click Import build

  4. Open HtmlSuite.scala to trigger compilation

  5. Quit VSCode and reopen the project

     % code .
    

    (Be sure to keep HtmlSuite.scala open 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment