-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Clojure language definition #3387
Conversation
languages.toml
Outdated
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot"] | ||
roots = ["project.clj" "build.boot" "deps.edn" "shadow-cljs.edn"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for TOML arrays you'll need commas between the elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for the catch! It's been a while since I manually edited a toml file.
This will update the auto-generated docs as well so you'll need to run |
I think changing the regex to include boot and edn makes sense 👍
Yep, this is the case. The relevant code is here: we find the workspace root (so we can tell the language server about it) by checking for any of the root markers or a |
I've fixed the missing commas, updated the regex, and I ran |
Ah yeah sorry I read the diff wrong 😅, there shouldn't be any changes |
Thanks! |
@IGJoshua and any others concerned, as far as I'm aware, ClojureCLR uses See the following for some evidence:
If you know otherwise, please let me know as that might be relevant for tree-sitter-clojure. |
For clarity, the ClojureCLR port of Clojure can and will use https://github.com/clojure/clojure-clr/blob/master/Clojure/Clojure/Lib/RT.cs#L3229 |
@IGJoshua Thanks a lot for the explanation! |
Hello,
I'd like some feedback on this PR since I don't fully understand all the fields that are being set in this table.
Does this edit look complete, or does the injection regex need to be updated in order to match some of the other file types, like
edn
andboot
?Otherwise, this is a simple update to add support for Clojure files supported by clojure-lsp but which aren't reflected in helix's language definition, and to correct the comment token.
File types
cljs
for ClojureScriptcljc
for cross-compiled Clojure filesclje
for Clojerlcljr
for ClojureCLRcljx
for legacy cross-compiled Clojureedn
for Extensible Data Notation files, they are to Clojure what JSON is to JSboot
for build files using the boot build toolThe last thing I'd like confirmation on is that
roots
defines a set of alternate files to detect a project root, and not that all must be present to detect a project, as the files here are for the major build tools, and it's quite common to have only one of these and none of the others.