Open tonsky opened 6 years ago
Agree. Looks like in other languages meta.definition
tends to capture the whole expression, while entity.name
is usually just class/function name. I made the appropriate changes. I also think entity.name.definition.clojure
is a better name than entity.name.global.clojure
because meta is called meta.defintion.global.clojure
, with definition
being the main semantic part and global
just a modifier
I don't think that patterns: include $self
block should actually be there. Since before it was at the wrong indentation and not doing anything and similar grammars don't have it.
Actually, I think I messed up the indentation when I copied it back. 'patterns'
was on the same level as 'captures'
and I accidentally made it deeper. Would it make more sense if I return it the way it was before?
@tonsky the previous indentation, with the patterns at the same level as captures, also doesn't make sense. That syntax is only for begin/end patterns and not regular matches.
Description of the Change
In top-level definitions like
we shouldn’t mark the whole expression as
"meta.definition.global.clojure"
. Instead, we should mark onlyf
(function name) as"entity.name.global.clojure meta.definition.global.clojure"
. This is similar to how other syntaxes do it, e.g. JavaScript and Python.In addition to that, this PR contains a couple of fixes to existing regexps:
[0-9#']
[#$%&'|]
(def *var* ...)
, capture*var*
as"entity.name.global"
as wellAlternate Designs
Not applicable
Benefits
Possible Drawbacks
Existing themes that were designed specifically with Clojure syntax in mind might break (I doubt ones exist, though)
Applicable Issues
Not applicable
This change is![Reviewable](https://reviewable.io/review_button.svg)