zed icon indicating copy to clipboard operation
zed copied to clipboard

Clojure/Clojurescript support

Open vedang opened this issue 3 years ago • 5 comments

I'd love to have Clojure / Clojurescript language support for Zed. clojure-lsp is a well-supported language server for the Clojure/script ecosystem.

Other resources:

  1. a lot of the Clojure tooling is powered by the Cider stack
  2. clj-kondo is the goto static linter of the Clojure world (it powers clojure-lsp as well)

vedang avatar Jul 14 '22 21:07 vedang

Check out the discussion I just opened #311 !

kees- avatar Jul 14 '22 21:07 kees-

Looking forward to Clojure/Script support!

roman01la avatar Feb 06 '23 19:02 roman01la

Quick mention that the parinfer algorithm also has a rust port (https://github.com/eraserhd/parinfer-rust), which I've found to be extremely helpful in vim/neovim. However, not sure how it would work with collaborative editing as parinfer is quite destructive to the buffer's state

Apart from that, I'm looking forward to seeing how zed's tree-sitter features will enable cooler structural editing support in the future ❤️

shaunsingh avatar Feb 09 '23 17:02 shaunsingh

Would love to see Clojure(Script) + parinfer support in the future as well! ✨

mlabod avatar Sep 15 '23 09:09 mlabod

Cursive's parinfer support has its quirks, but it's still miles better than the VSCode plugins I've tried (I couldn't get any to work properly). Parinfer support is the single critical feature I want from a Clojure/Lisp editor. Even REPL is less important to me.

Other top requirements: Find all usages of an identifier/keyword, regardless of how it's written (e.g. destructuring map keys). Rename refactoring for identifiers/keywords. Evaluate selected code in REPL.

Some nice-to-haves: Other refactorings like extracting and inlining variables/functions, but with good parinfer and "select larger syntax node" it's easy enough to do without advanced refactoring support, since the language is so regular.

luontola avatar Jan 26 '24 23:01 luontola

This is looking great in the preview release! Can you add the .cljc file extension to this list?: https://github.com/zed-industries/zed/blob/54f82eb16693e42f223dd4fe01d5a2bddb181130/crates/zed/src/languages/clojure/config.toml#L3

.cljc files allow mixing Clojure dialects (e.g. JVM Clojure and ClojureScript) in the same file and are fairly common in the Clojure ecosystem.

Is that file extension list user configurable?

cap10morgan avatar Feb 14 '24 21:02 cap10morgan

Wow !! At last!

In addition to cljc, what support does zed offer for autodetecting languages from shebangs?

Babashka (clojure SCI scripting) supports files without extensions that have clojure-related shebangs e.g. #!/usr/bin/env bb. Having bb would continue to round out clojure support.

kees- avatar Feb 14 '24 22:02 kees-

Not sure if this is the right place to report this, but I was testing the preview release (0.123.1) and it appeared that sometimes (but not always) when I edited a .cljc file that I had manually told Zed was a Clojure file, on save it would revert my changes. Is that a format-on-save bug?

cap10morgan avatar Feb 14 '24 22:02 cap10morgan

Wow !! At last!

In addition to cljc, what support does zed offer for autodetecting languages from shebangs?

Babashka (clojure SCI scripting) supports files without extensions that have clojure-related shebangs e.g. #!/usr/bin/env bb. Having bb would continue to round out clojure support.

Yes to all of the above. And that also reminds me that .bb and .edn should be added to the Clojure file extension list as well. Thanks!!!

cap10morgan avatar Feb 14 '24 22:02 cap10morgan

Support for this has landed in today's v0.123.1-pre release.

Since initial Clojure support has landed, let's close this issue out and open new issues for whatever comes up.

JosephTLyons avatar Feb 15 '24 02:02 JosephTLyons