You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was wondering if it is possible to target the doc strings that are in a defn form separately from normal Strings? (defn my-function "This is the doc string I am talking about. It would be great if this can be highlighted differently from regular Strings" [arg 1 arg2] ...
I probably need a syntax region, but I am lost with the syntax file format. Thanks
The text was updated successfully, but these errors were encountered:
It is technically possible, however I wouldn't say it is worth the pain of adding it. There are several reasons I say this:
For consistency, the same syntax highlighting of doc-strings should happen for def, defonce, defn, defn-, defmacro, defmulti, defprotocol, defrecord, defstruct, deftype and definline. Some of these have different rules for where doc-strings appear.
The regular expressions to make it work would be very complex and difficult to write/maintain. Just differentiating between these two things with regular expressions, is far more difficult than you would initially think:
(deffoo"regular string")
(defbar"doc-string"nil)
For yet more consistency, I think there would need to be a way to configure the same highlighting on custom macros such as defrule in Clara rules. I have no idea how this could be accomplished.
Doc-strings are actually just strings.
As far as I'm aware, for these reasons (and maybe others), no other editor supports this. However, you can of course add the syntax highlight rules for it to your personal Vim config overriding our defaults. Unfortunately I'm not entirely sure how you would go about writing those syntax rules.
Was wondering if it is possible to target the doc strings that are in a defn form separately from normal Strings?
(defn my-function "This is the doc string I am talking about. It would be great if this can be highlighted differently from regular Strings" [arg 1 arg2] ...
I probably need a syntax region, but I am lost with the syntax file format. Thanks
The text was updated successfully, but these errors were encountered: