-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clojure-lsp my-lib example (#64)
Fixes #63
- Loading branch information
Showing
5 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(ns my-lib | ||
(:require ["vscode" :as vscode] | ||
[promesa.core :as p])) | ||
|
||
;; Assuming this namespace i required by `activate.cljs` | ||
;; you can reach vars in `my-lib` using `my-lib/<symbol>` in | ||
;; `joyride.runCode` keybindings without requiring `my-lib`` | ||
;; there. | ||
|
||
;; As an example, take the feature request on Calva to add a | ||
;; **Restart clojure-lsp** command. It can be implemented with | ||
;; with this function: | ||
|
||
(defn restart-clojure-lsp [] | ||
(p/do (vscode/commands.executeCommand "calva.clojureLsp.stop") | ||
(vscode/commands.executeCommand "calva.clojureLsp.start"))) | ||
|
||
;; And then this shortcut definition in `keybindings.json` | ||
;; { | ||
;; "key": "<some-keyboard-shortcut>", | ||
;; "command": "joyride.runCode", | ||
;; "args": "(my-lib/restart-clojure-lsp)" | ||
;; }, | ||
|
||
;; If you get complaints about `my-lib` not found, you probably | ||
;; have not required it from `activate.cljs` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters