diff --git a/hosts/pinwheel/modules/work/wt.zsh b/hosts/pinwheel/modules/work/wt.zsh index 4e05cd8..12451d7 100644 --- a/hosts/pinwheel/modules/work/wt.zsh +++ b/hosts/pinwheel/modules/work/wt.zsh @@ -105,6 +105,12 @@ _wt_setup() { print -r -- "[python-repos] find_links = [\"file://$primary/dist/\"]" >"$dir/.pants.rc" fi + if [[ -f $primary/.bsp/pants.json && -f $dir/pants.toml ]]; then + print -r -- "wt: writing .bsp/pants.json for Metals" + (cd "$dir" && direnv exec . pants --no-pantsd experimental-bsp) || + print -u2 "wt: no .bsp/pants.json, so Metals will set up scala-cli here; run" \ + "pants --no-pantsd experimental-bsp in the devshell before opening a Scala file" + fi } _wt() {