pme
pme

Reputation: 14803

Visual Studio Code: how can I import the `sbt`-changes

After adding another dependency in build.sbt - how can I import the sbt-changes?

With the Command Reload Window it works but it reloads everything (like bloob).

Is there a way just to just import the sbt-changes?

Upvotes: 2

Views: 1916

Answers (1)

Mario Galic
Mario Galic

Reputation: 48430

Metals extension supports natively importing sbt changes

When you change build.sbt or sources under project/, you will be prompted to re-import the build.

enter image description here

We can also manually import the changes by executing Metals: Import Build command.


Without Metals perhaps try Send text from a keybinding to terminal which executes sbt reload; update by navigating to View | Command Palette | Preferences: Open Keyboard Shortcuts (JSON) and defining the following, say, cmd+shift+R shortcut:

[
    {
        "key": "cmd+shift+R",
        "command": "workbench.action.terminal.sendSequence",
        "args": {
          "text": ";reload; update\u000D"
        }
      }
]

cmd+shift+R should now just reload sbt changes instead of reloading whole Visual Studio Code window.

Upvotes: 2

Related Questions