Detect more def* forms in Clojure syntax#25546
Detect more def* forms in Clojure syntax#25546tonsky wants to merge 2 commits intomicrosoft:masterfrom tonsky:patch-1
Conversation
|
This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request. |
|
Thanks for looking into this. Our clojure grammar actually comes from https://github.com/atom/language-clojure . Could you please resubmit this PR against that repo. That way any improvements will benefit other editors and tools as well. Once the PR is merged into language-clojure, back in the vscode Clojure extension, simply run |
|
Thanks! I've pulled in these changes from language/clojure with 0ddd558 They should be in VSCode 1.13 insiders once those start up again Closing but marking as part of the May milestone so that it is clear this change was picked up, just not through this PR |
|
awesome! Thank you! |
It’s a convention in Clojure to use macros whose name starts with
defto define something. Libraries often define their own custom macros for this:defroutes(Compojure)defc(Rum)This is why whitelisting only def macros from clojure.core isn’t working: it will detect standard vars and functions but will fail to detect custom
def*-like macros.This PR adds regular expression that treats all forms whose name starts with
def(with optional namespace) similarly.This convention is very well established so it shouldn’t hurt anyone.