zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.27k stars 2.98k forks source link

Clojure/Clojurescript support #5292

Closed vedang closed 8 months ago

vedang commented 2 years ago

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)
kees- commented 2 years ago

Check out the discussion I just opened #311 !

roman01la commented 1 year ago

Looking forward to Clojure/Script support!

shaunsingh commented 1 year ago

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 ❤️

mlabod commented 1 year ago

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

luontola commented 9 months ago

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.

cap10morgan commented 8 months ago

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?

kees- commented 8 months ago

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.

cap10morgan commented 8 months ago

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 commented 8 months ago

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!!!

JosephTLyons commented 8 months ago

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.