Skip to content

Commit

Permalink
More fine grained highlighting.
Browse files Browse the repository at this point in the history
Tighter classification of some keywords, brackets, and
specific formatting for imports via module_fqn.
  • Loading branch information
gdamore committed Oct 20, 2022
1 parent dfe20eb commit c5b85c0
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions runtime/queries/d/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
(call_expression (identifier) @function)
(call_expression (type (identifier) @function))

(module_fqn) @namespace

[
(abstract)
(alias)
Expand All @@ -27,22 +29,16 @@
(assert)
(auto)
(cast)
(class)
(const)
(debug)
(delegate)
(delete)
(deprecated)
(enum)
(export)
(extern)
(final)
(function)
(immutable)
(import)
(in)
(inout)
(interface)
(invariant)
(is)
(lazy)
Expand All @@ -63,15 +59,13 @@
(scope)
(shared)
(static)
(struct)
(super)
(synchronized)
(template)
(this)
(throw)
(typeid)
(typeof)
(union)
(unittest)
(version)
(with)
Expand All @@ -81,6 +75,16 @@
(parameters_)
] @keyword

[
(class)
(struct)
(interface)
(union)
(enum)
(function)
(delegate)
] @keyword.storage.type

[
(break)
(case)
Expand All @@ -90,17 +94,23 @@
(default)
(finally)
(else)
(for)
(foreach)
(foreach_reverse)
(goto)
(if)
(switch)
(try)
(return)
(while)
] @keyword.control

(return) @keyword.control.return

(import) @keyword.control.import

[
(for)
(foreach)
(foreach_reverse)
(while)
] @keyword.control.repeat

[
(not_in)
(not_is)
Expand Down Expand Up @@ -132,10 +142,6 @@
">>>"
"!"
"!="
"("
")"
"["
"]"
"?"
"$"
"="
Expand All @@ -154,6 +160,13 @@
"=>"
] @operator

[
"("
")"
"["
"]"
] @punctuation.bracket

[
";"
"."
Expand Down

0 comments on commit c5b85c0

Please sign in to comment.