Bare-bones VS Code plugin for Clojure
Please, don't be confused if 'bb' reminds you the babashka project - it's just a coincidence, abbreviation for bare-bones
- code formatting allowing custom rules (used cljstyle)
- eval forms in REPL opened in integrated terminal
- load file & switch namespace
- show symbol definition link
npm run package
Then open VS Code plugins list and select Install from VSIX
Add zero-character-prefixed prompt to used lein profile (or :user
for common use)
{
...
:repl-options {:prompt (fn [ns] (str (char 0) ns "=> "))
...}
}
Open integrated terminal and start lein repl with this profile and redirect its output to repl-output-processor
(file locates in extension folder)
lein with-profile +whidbey,+bb repl | $HOME/.vscode/extensions/ivana.bb-clj-0.1.0/repl-output-processor
Create file expect-clj
with followed content
#!/usr/bin/expect
spawn clojure -e "(clojure.main/repl :init #(apply require clojure.main/repl-requires) :prompt #(print (str (char 0) (ns-name *ns*) \"=> \")))"
interact
make it executable
chmod +x ./expect-clj
Open integrated terminal and start clojure cli repl via this file and redirect its output to repl-output-processor
./expect-clj | $HOME/.vscode/extensions/ivana.bb-clj-0.1.0/repl-output-processor
Set cursor near some Clojure code form and enjoy the bb-clj: Run Form in Active Terminal
command