From e9adfe912229ceae3d3715dfdfbba96130a3f561 Mon Sep 17 00:00:00 2001 From: Keith Pinson <3661051+Kazark@users.noreply.github.com> Date: Tue, 22 Feb 2022 11:37:17 -0500 Subject: [PATCH] [scala] add keybinding for running `Test / compile` in SBT (#15372) --- CHANGELOG.develop | 2 ++ layers/+lang/scala/README.org | 15 ++++++++------- layers/+lang/scala/funcs.el | 5 +++++ layers/+lang/scala/packages.el | 1 + 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.develop b/CHANGELOG.develop index b12f7c112..f14575308 100644 --- a/CHANGELOG.develop +++ b/CHANGELOG.develop @@ -3430,6 +3430,8 @@ files (thanks to Daniel Nicolai) - ~SPC c s d~ Copy rpms to the phone - ~SPC c s i~ Install rpms into target **** Scala +- Shortcut key for compiling tests in SBT without running them (~Test / compile~) + (thanks to Keith Pinson) - Shortcut keys for common/standard SBT commands (~scalafmtAll~, ~compile~ and ~test~) (thanks to Keith Pinson) - Remove long-deprecated Ensime support (thanks to Keith Pinson) diff --git a/layers/+lang/scala/README.org b/layers/+lang/scala/README.org index 6a1c5e113..6b749b47d 100644 --- a/layers/+lang/scala/README.org +++ b/layers/+lang/scala/README.org @@ -129,10 +129,11 @@ Additional major mode key bindings are populated by LSP and DAP. ** sbt -| Key binding | Description | -|-------------+--------------------------| -| ~SPC m b .~ | SBT transient state | -| ~SPC m b b~ | SBT command | -| ~SPC m b c~ | Run ~compile~ in SBT | -| ~SPC m b t~ | Run ~test~ in SBT | -| ~SPC m b =~ | Run ~scalafmtAll~ in SBT | +| Key binding | Description | +|-------------+-----------------------------| +| ~SPC m b .~ | SBT transient state | +| ~SPC m b b~ | SBT command | +| ~SPC m b c~ | Run ~compile~ in SBT | +| ~SPC m b t~ | Run ~test~ in SBT | +| ~SPC m b T~ | Run ~Test / compile~ in SBT | +| ~SPC m b =~ | Run ~scalafmtAll~ in SBT | diff --git a/layers/+lang/scala/funcs.el b/layers/+lang/scala/funcs.el index a060a296f..0a6fcf84e 100644 --- a/layers/+lang/scala/funcs.el +++ b/layers/+lang/scala/funcs.el @@ -82,3 +82,8 @@ point to the position of the join." "Run `test' via SBT" (interactive) (sbt-command "test")) + +(defun spacemacs/scala-sbt-compile-test () + "Compile `test' via SBT" + (interactive) + (sbt-command "Test / compile")) diff --git a/layers/+lang/scala/packages.el b/layers/+lang/scala/packages.el index aff4ae7a3..c0fdb87c2 100644 --- a/layers/+lang/scala/packages.el +++ b/layers/+lang/scala/packages.el @@ -61,6 +61,7 @@ "bb" 'sbt-command "bc" #'spacemacs/scala-sbt-compile "bt" #'spacemacs/scala-sbt-test + "bT" #'spacemacs/scala-sbt-compile-test "b=" #'spacemacs/scala-sbt-scalafmt-all)))) (defun scala/init-scala-mode ()