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?
Metals extension supports natively importing sbt changes
When you change
build.sbt
or sources underproject/
, you will be prompted to re-import the build.
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.