diff options
| author | ObserverOfTime <chronobserver@disroot.org> | 2024-01-21 12:57:34 +0200 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-01-24 13:47:19 +0100 |
| commit | 81660800352ecab6a2e95f4ca30d637df1f3765e (patch) | |
| tree | d5c0cda4e60f1d86a17c5d26d198384b7fcc9dd4 /queries/yuck | |
| parent | fix(godot_resource): improve highlights (diff) | |
| download | nvim-treesitter-81660800352ecab6a2e95f4ca30d637df1f3765e.tar nvim-treesitter-81660800352ecab6a2e95f4ca30d637df1f3765e.tar.gz nvim-treesitter-81660800352ecab6a2e95f4ca30d637df1f3765e.tar.bz2 nvim-treesitter-81660800352ecab6a2e95f4ca30d637df1f3765e.tar.lz nvim-treesitter-81660800352ecab6a2e95f4ca30d637df1f3765e.tar.xz nvim-treesitter-81660800352ecab6a2e95f4ca30d637df1f3765e.tar.zst nvim-treesitter-81660800352ecab6a2e95f4ca30d637df1f3765e.zip | |
feat(yuck): add missing injections
And builtin variable highlights
Diffstat (limited to 'queries/yuck')
| -rw-r--r-- | queries/yuck/highlights.scm | 21 | ||||
| -rw-r--r-- | queries/yuck/injections.scm | 24 |
2 files changed, 35 insertions, 10 deletions
diff --git a/queries/yuck/highlights.scm b/queries/yuck/highlights.scm index bd414b8e7..2d5d01c0b 100644 --- a/queries/yuck/highlights.scm +++ b/queries/yuck/highlights.scm @@ -6,16 +6,14 @@ ; Includes (list . - ((symbol) @keyword.import - (#eq? @keyword.import "include"))) + (symbol) @keyword.import + (#eq? @keyword.import "include")) ; Keywords -; I think there's a bug in tree-sitter the anchor doesn't seem to be working, see -; https://github.com/tree-sitter/tree-sitter/pull/2107 (list . - ((symbol) @keyword - (#any-of? @keyword "defwindow" "defwidget" "defvar" "defpoll" "deflisten" "geometry" "children" "struts"))) + (symbol) @keyword + (#any-of? @keyword "defwindow" "defwidget" "defvar" "defpoll" "deflisten" "geometry" "children" "struts")) ; Loop (loop_widget @@ -39,8 +37,8 @@ ; Builtin widgets (list . - ((symbol) @tag.builtin - (#any-of? @tag.builtin "box" "button" "calendar" "centerbox" "checkbox" "circular-progress" "color-button" "color-chooser" "combo-box-text" "eventbox" "expander" "graph" "image" "input" "label" "literal" "overlay" "progress" "revealer" "scale" "scroll" "transform"))) + (symbol) @tag.builtin + (#any-of? @tag.builtin "box" "button" "calendar" "centerbox" "checkbox" "circular-progress" "color-button" "color-chooser" "combo-box-text" "eventbox" "expander" "graph" "image" "input" "label" "literal" "overlay" "progress" "revealer" "scale" "scroll" "transform")) ; Variables (ident) @variable @@ -48,7 +46,10 @@ (array (symbol) @variable) -; Properties & Fields +((ident) @variable.builtin + (#any-of? @variable.builtin "EWW_TEMPS" "EWW_RAM" "EWW_DISK" "EWW_BATTERY" "EWW_CPU" "EWW_NET" "EWW_TIME" "EWW_CONFIG_DIR" "EWW_CMD" "EWW_EXECUTABLE")) + +; Properties (keyword) @property (json_access @@ -72,7 +73,7 @@ (json_object (simplexpr - (ident) @variable.member)) + (ident) @property)) ; Functions (function_call diff --git a/queries/yuck/injections.scm b/queries/yuck/injections.scm index 2f0e58eb6..298a8d070 100644 --- a/queries/yuck/injections.scm +++ b/queries/yuck/injections.scm @@ -1,2 +1,26 @@ ((comment) @injection.content (#set! injection.language "comment")) + +((function_call + name: (ident) @_name + . + (simplexpr) + . + (simplexpr + (string + (string_fragment) @injection.content)+)) + (#any-of? @_name "replace" "search" "matches" "captures") + (#set! injection.language "regex") + (#set! injection.combined)) + +((function_call + name: (ident) @_name + . + (simplexpr) + . + (simplexpr + (string + (string_fragment) @injection.content)+)) + (#eq? @_name "jq") + (#set! injection.language "jq") + (#set! injection.combined)) |
