Skip to content

Commit

Permalink
Fixed tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioszabo committed Apr 30, 2024
1 parent 781060e commit 9e70a72
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/language-clojure/grammars/ts/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
(list_lit
"(" @punctuation.section.expression.begin (#is-not? test.descendantOfNodeWithData "clojure.dismissTag")
.
(sym_lit) @keyword.control (#match? @keyword.control "^def(on[^\s]*|test|macro|n|n-|)$")
(sym_lit) @keyword.control (#match? @keyword.control "^def(on[^\s]*|test|macro|n|n-|protocol|record|struct|)$")
.
(sym_lit) @meta.definition.global @entity.global
")" @punctuation.section.expression.end)
Expand Down
46 changes: 43 additions & 3 deletions packages/language-clojure/grammars/ts/tags.scm
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
(list_lit
"(" (#is-not? test.descendantOfNodeWithData "clojure.dismissTag")
.
(sym_lit) @keyword.control (#match? @keyword.control "^def(on[^\s]*|test|macro|n|n-|)$")
(sym_lit) @keyword.control (#match? @keyword.control "defmacro")
.
(sym_lit) @definition.function
")")
(sym_lit) @name
")") @definition.constructor

(list_lit
"(" (#is-not? test.descendantOfNodeWithData "clojure.dismissTag")
.
(sym_lit) @keyword.control (#match? @keyword.control "def(protocol|struct|record)")
.
(sym_lit) @name
")") @definition.struct

(list_lit
"(" (#is-not? test.descendantOfNodeWithData "clojure.dismissTag")
.
(sym_lit) @keyword.control (#match? @keyword.control "^def(on[^\s]*|test|macro|n|n-)$")
.
(sym_lit) @name
")") @definition.function

(list_lit
"(" (#is-not? test.descendantOfNodeWithData "clojure.dismissTag")
.
(sym_lit) @keyword.control (#match? @keyword.control "^def(on[^\s]*|test|macro|n|n-)$")
.
(sym_lit) @name
")") @definition.variable

(list_lit
"(" @punctuation.section.expression.begin (#is-not? test.descendantOfNodeWithData "clojure.dismissTag")
.
(sym_lit) @keyword.control (#match? @keyword.control "/def.")
.
(sym_lit) @name
")") @definition.function

(list_lit
"(" @punctuation.section.expression.begin (#is-not? test.descendantOfNodeWithData "clojure.dismissTag")
.
(sym_lit) @keyword.control (#match? @keyword.control "/def")
.
(sym_lit) @name
")") @definition.variable
9 changes: 9 additions & 0 deletions packages/language-clojure/spec/fixtures/tokens.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@
; ^ keyword.control
; ^ entity.global

(defprotocol FooBar
; ^ keyword.control
; ^ entity.global
(-eq [this other]))

(defrecord Lol [a b])
; ^ keyword.control
; ^ entity.global

(def a "A STRING")
; <- keyword.control
; ^ entity.global
Expand Down

0 comments on commit 9e70a72

Please sign in to comment.