You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sbt): default to auto-mode — pick bsp when .bsp/sbt.json present, else oneshot
Answers the real concern: oneshot mode is SLOWER than bare sbt (see
benchmark table in README), so defaulting to oneshot actively hurt
anyone who called sbt-direct on a BSP-capable project.
bin/sbt-direct-coordinator.js:
New `auto` mode (now the default) probes <workspace>/.bsp/sbt.json:
- present → select bsp (warm calls ~130ms)
- absent → select oneshot, with a stderr log:
"<path> not found — falling back to oneshot mode (slower).
Run `sbt bspConfig` once in the workspace to enable bsp mode
(warm calls <200ms)."
Always emits `[sbt-direct] mode=<bsp|oneshot>` so operators can
confirm which path ran without reading code.
bin/sbt-direct:
SBT_DIRECT_MODE default is now `auto`. `bsp` / `oneshot` explicit
overrides still work. Start-timeout extended from 30s to 120s for
any non-oneshot mode (auto might resolve to bsp, which needs JVM
boot time).
docs/per-language/sbt.md:
Two-mode table replaced with an auto-detection table showing which
mode is selected based on .bsp/sbt.json presence. Overrides
documented but framed as deliberate-test-only.
README.md:
"Where direct wrappers don't help" note on oneshot updated — auto
mode means users only hit the slow path on BSP-less projects and
get a remediation message at start time.
Verified:
- fixture (has .bsp/sbt.json from our earlier bspConfig): auto →
mode=bsp, start in ~1s, warm compile ~130ms.
- scratch project (no .bsp/sbt.json): auto → mode=oneshot with the
remediation log line fired, start binds immediately.
verify.sh --diff-baselines clean.
console.error(`[sbt-direct] ${bspDescriptor} not found — falling back to oneshot mode (slower). Run \`sbt bspConfig\` once in the workspace to enable bsp mode (warm calls <200ms).`);
40
+
}
41
+
}
30
42
constadapterModule=MODE==='bsp'
31
43
? './adapters/sbt-bsp.js'
32
44
: './adapters/sbt-oneshot.js';
33
45
const{ createAdapter }=require(adapterModule);
46
+
console.error(`[sbt-direct] mode=${MODE}`);
34
47
35
48
if(!fs.existsSync(WORKSPACE))die(`workspace does not exist: ${WORKSPACE}`);
0 commit comments