Logo

0x3d.Site

is designed for aggregating information.
Welcome
check repository here

clojureVSCode

Version Build Status

Clojure and ClojureScript support for Visual Studio Code.

If you are a ClojureScript user, please read this section carefully.

I'm trying, believe me!

Quickstart

Make sure that Leiningen is installed on your machine, open a Clojure file or project, wait until the extension starts the nREPL (see status on the bottom of the VSCode window) and connect to it - now all the goodies should work :-)

Doesn't work? Not exactly what you need? See the Manual Configuration section!

Supported Features

  • Code completion

Code completion example

  • Code navigation

Code navigationtion example

  • Interaction with REPL
  • Showing documentation on hover
  • Code formatting (cljfmt)
  • Function signatures
  • Integration with the Clojure unit test framework

Code completion example

Features That Are not Supported (but Nice to Have)

Connecting to the REPL

  • Open a terminal (either the one embedded in VSCode or a separate one)
  • Change directory to the root directory of the Clojure project (where the REPL started by clojureVSCode will have updated the hidden file .nrepl-port)
  • with lein, do lein repl :connect.

Evaluating code in the REPL

Clojure: Eval (in the command palette) will compile the current file in the editor and load it in the REPL.

Manual Configuration

The method from the Quickstart section utilizes the so-called embedded nREPL that is run as an internal process. Sometimes you need more control on your development environment. In this case you can disable the automatical firing of the embedded nREPL by setting the


"clojureVSCode.autoStartNRepl": true

option in your VSCode settings globally or per-project and connect manually to whichever REPL instance you want by "Clojure: Connect to a running nREPL" command. Note, that in order to make the autocompletion, go to definition, and formatting functionality work you have to write necessary dependencies in your profiles.clj. Put the following content to your ~/.lein/profiles.clj for macOS and Linux:

{:user {:plugins  [[cider/cider-nrepl "0.24.0"]]
        :dependencies [[cljfmt "0.6.7"]]}}

Alternatively, you can put the code above to your project project.clj file.

Contributed Configuration

The extension contributes the configuration parameters listed in the table below.

ParameterDescription
clojureVSCode.autoStartNReplWhether to start an nREPL when opening a file or project.
clojureVSCode.formatOnSaveFormat files with cljfmt on save.
clojureVSCode.cljfmtParametersFormatting parameters passed to cljfmt each time it runs, e.g. :indentation? true :remove-surrounding-whitespace? false
clojureVSCode.showResultInlineShow evaluation result inline.
clojureVSCode.ciderNReplVersionVersion of CIDER nREPL to use for the embedded nREPL.
clojureVSCode.cljfmtVersionVersion of cljfmt to use for formatting Clojure files.

ClojureScript Project Setup

The extension has the experimental support of ClojureScript. The example of a ClojureScript project setup can be found here. Checkout the project profile.clj file to learn what dependencies you need.

The embedded nREPL does not support ClojureScript, consider to use the "clojureVSCode.autoStartNRepl" setting. You will need to run an nREPL manually and execute the following commands inside it:

(require 'cljs.repl.node)
(cider.piggieback/cljs-repl (cljs.repl.node/repl-env))

After that you can connect to the nREPL using the "Clojure: Connect to a running nREPL" command. Now you can evaluate you ClojureScript code and use the other extension facilities.

Troubleshooting

All kinds of errors on nREPL start

Please check that you're using the latest version of CIDER nREPL. The version the extension uses by default updates periodically, but there still can be a mismatch. In order to redefined the CIDER nREPL version you can either:

  1. Define it in the ~/.lein/profiles.clj (see the "Manual Configuration" section above).
  2. Redefine it with the clojureVSCode.cljfmtVersion extension setting.

How to Contribute

Open an issue if you want to propose new features and ideas or to report bugs. If you want to help with some code and looking for a place to start, please check out the How to Contribute wiki page.

Thanks

License

MIT

Clojure
Clojure
Clojure is a modern, functional programming language that runs on the JVM. It emphasizes immutability and concurrency, making it suitable for scalable applications. Its simplicity and powerful abstractions attract developers in data science and backend development.
Biff | Clojure web framework
Biff | Clojure web framework
Kamalavelan / column · GitLab
Kamalavelan / column · GitLab
Clojure Tutorials
Clojure Tutorials
reborg
reborg
Misophistful
Misophistful
ClojureVids
ClojureVids
GitHub - venantius/photon: Experiments in realtime web framework design. Like Meteor, but for Clojure(Script)
GitHub - venantius/photon: Experiments in realtime web framework design. Like Meteor, but for Clojure(Script)
GitHub - fhd/clostache: {{ mustache }} for Clojure
GitHub - fhd/clostache: {{ mustache }} for Clojure
GitHub - dakrone/cheshire: Clojure JSON and JSON SMILE (binary json format) encoding/decoding
GitHub - dakrone/cheshire: Clojure JSON and JSON SMILE (binary json format) encoding/decoding
GitHub - mrdimosthenis/clj-synapses: A neural networks library for Clojure
GitHub - mrdimosthenis/clj-synapses: A neural networks library for Clojure
GitHub - plumatic/schema: Clojure(Script) library for declarative data description and validation
GitHub - plumatic/schema: Clojure(Script) library for declarative data description and validation
GitHub - http-kit/http-kit: Simple, high-performance event-driven HTTP client+server for Clojure
GitHub - http-kit/http-kit: Simple, high-performance event-driven HTTP client+server for Clojure
GitHub - pedestal/pedestal: The Pedestal Server-side Libraries
GitHub - pedestal/pedestal: The Pedestal Server-side Libraries
GitHub - ztellman/proteus: local. mutable. variables.
GitHub - ztellman/proteus: local. mutable. variables.
GitHub - fulcrologic/fulcro: A library for development of single-page full-stack web applications in clj/cljs
GitHub - fulcrologic/fulcro: A library for development of single-page full-stack web applications in clj/cljs
GitHub - tpope/vim-fireplace: fireplace.vim: Clojure REPL support
GitHub - tpope/vim-fireplace: fireplace.vim: Clojure REPL support
Home
Home
GitHub - clojure-cookbook/clojure-cookbook: This is the home of O'Reilly's Clojure Cookbook - http://clojure-cookbook.com
GitHub - clojure-cookbook/clojure-cookbook: This is the home of O'Reilly's Clojure Cookbook - http://clojure-cookbook.com
GitHub - ertugrulcetin/re-frame-flow: Graph based visualization tool for re-frame event chains
GitHub - ertugrulcetin/re-frame-flow: Graph based visualization tool for re-frame event chains
Build software better, together
Build software better, together
Daniel Amber
Daniel Amber
Build software better, together
Build software better, together
GitHub - technomancy/leiningen: Moved to Codeberg; this is a convenience mirror
GitHub - technomancy/leiningen: Moved to Codeberg; this is a convenience mirror
Build software better, together
Build software better, together
Build software better, together
Build software better, together
GitHub - darkleaf/di: DI is a dependency injection framework that allows you to define dependencies as cheaply as defining function arguments.
GitHub - darkleaf/di: DI is a dependency injection framework that allows you to define dependencies as cheaply as defining function arguments.
Build software better, together
Build software better, together
GitHub - junegunn/rainbow_parentheses.vim: :rainbow: Simpler Rainbow Parentheses
GitHub - junegunn/rainbow_parentheses.vim: :rainbow: Simpler Rainbow Parentheses
GitHub - clojure/core.match: An optimized pattern matching library for Clojure
GitHub - clojure/core.match: An optimized pattern matching library for Clojure
GitHub - yogthos/clojure-error-message-catalog: a catalog of common Clojure errors and their meaning
GitHub - yogthos/clojure-error-message-catalog: a catalog of common Clojure errors and their meaning
Clojure
More on Clojure

  1. Programming Tips & Tricks
  2. Error Solutions
  3. Shortcuts
  4. Collections

Tools

available to use.

Made with ❤️

to provide resources in various ares.