aboutsummaryrefslogtreecommitdiffstats
path: root/queries/clojure
diff options
context:
space:
mode:
authorOliver Marshall <olivershawmarshall@gmail.com>2021-06-05 01:36:20 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-07-19 16:24:01 +0000
commit336206e380f49df5933a9c4281550993aa088853 (patch)
treeb70c3cbcc4c3c9f2cfea5fbb971d2c4d5b20848b /queries/clojure
parentMatch % variables (diff)
downloadnvim-treesitter-336206e380f49df5933a9c4281550993aa088853.tar
nvim-treesitter-336206e380f49df5933a9c4281550993aa088853.tar.gz
nvim-treesitter-336206e380f49df5933a9c4281550993aa088853.tar.bz2
nvim-treesitter-336206e380f49df5933a9c4281550993aa088853.tar.lz
nvim-treesitter-336206e380f49df5933a9c4281550993aa088853.tar.xz
nvim-treesitter-336206e380f49df5933a9c4281550993aa088853.tar.zst
nvim-treesitter-336206e380f49df5933a9c4281550993aa088853.zip
First pass at def-likes
Diffstat (limited to 'queries/clojure')
-rw-r--r--queries/clojure/highlights.scm26
1 files changed, 17 insertions, 9 deletions
diff --git a/queries/clojure/highlights.scm b/queries/clojure/highlights.scm
index fd0c912e6..7bf22b342 100644
--- a/queries/clojure/highlights.scm
+++ b/queries/clojure/highlights.scm
@@ -73,14 +73,22 @@
;; >> Functions
;; TODO: Enforce function-like things are the first thing in a list?
-;; def-like things
-;; TODO
-;(list_lit
-; .
-; (sym_lit) @keyword.function
-; (#match? @keyword.function "^(declare|def.*|ns)$")
-; .
-; (sym_lit) @function)
+;; def & fn
+; TODO: fix it so that meta isn't marked as @function
+; e.g (fn ^:meta name [a] a) marks `^:meta` as @function
+(list_lit
+ .
+ (sym_lit) @keyword.function
+ (#match? @keyword.function "^(fn|fn[*]|def.*)$")
+ .
+ (sym_lit)? @function
+ .
+ (str_lit)? @text
+ .
+ ; TODO: Get this working?
+ (vec_lit
+ (sym_lit) @parameter)?)
+
;; def-like things
;; TODO
@@ -114,7 +122,7 @@
"." ".." "->" "->>" "amap" "and" "areduce" "as->" "assert"
"binding" "bound-fn" "case" "catch" "comment" "cond" "cond->"
"cond->>" "condp" "delay" "do" "doseq" "dosync" "dotimes"
- "doto" "extend-protocol" "extend-type" "finally" "fn" "fn*"
+ "doto" "extend-protocol" "extend-type" "finally"
"for" "future" "gen-class" "gen-interface" "if" "if-let"
"if-not" "if-some" "import" "io!" "lazy-cat" "lazy-seq" "let"
"letfn" "locking" "loop" "memfn" "monitor-enter" "monitor-exit"