mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
chore(language/yaml): update tree-sitter-langs to get highlight queries for yaml
This commit is contained in:
@@ -20,46 +20,10 @@
|
||||
(yaml-mode . siren-yaml-mode-setup)
|
||||
|
||||
:preface
|
||||
;; Manually set full tree-sitter highlight queries for yaml-mode. This is a
|
||||
;; temporary workaround until this PR is merged:
|
||||
;; https://github.com/emacs-tree-sitter/tree-sitter-langs/pull/134
|
||||
(defun siren-yaml-mode-tree-sitter-setup ()
|
||||
(setq-local tree-sitter-hl-default-patterns
|
||||
[;; keys
|
||||
(block_mapping_pair
|
||||
key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @variable))
|
||||
(block_mapping_pair
|
||||
key: (flow_node (plain_scalar (string_scalar) @variable)))
|
||||
|
||||
;; keys within inline {} blocks
|
||||
(flow_mapping
|
||||
(_ key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @variable)))
|
||||
(flow_mapping
|
||||
(_ key: (flow_node (plain_scalar (string_scalar) @variable))))
|
||||
|
||||
["[" "]" "{" "}"] @punctuation.bracket
|
||||
["," "-" ":" "?" ">" "|"] @punctuation.delimiter
|
||||
["*" "&" "---" "..."] @punctuation.special
|
||||
|
||||
[(null_scalar) (boolean_scalar)] @constant.builtin
|
||||
[(integer_scalar) (float_scalar)] @number
|
||||
[(double_quote_scalar) (single_quote_scalar) (block_scalar)] @string
|
||||
(escape_sequence) @escape
|
||||
|
||||
(comment) @comment
|
||||
[(anchor_name) (alias_name)] @function
|
||||
(yaml_directive) @type
|
||||
|
||||
(tag) @type
|
||||
(tag_handle) @type
|
||||
(tag_prefix) @string
|
||||
(tag_directive) @property ]))
|
||||
|
||||
(defun siren-yaml-mode-setup ()
|
||||
(run-hooks 'prog-mode-hook)
|
||||
|
||||
(setq-local tab-width 2)
|
||||
(siren-yaml-mode-tree-sitter-setup)
|
||||
(tree-sitter-mode t)
|
||||
(subword-mode t)))
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
("themes" . "b5ff201f4bea4286e9ed015a2043cf2394182232")
|
||||
("tide" . "4cf6a0d89da7f946565a425a632ee2410a40c7da")
|
||||
("transient" . "79d1426de173312bd6a3091731675bb010d804ec")
|
||||
("tree-sitter-langs" . "8a33fd0ae8c4f9ee15fb5062c0d1199ebc1def09")
|
||||
("tree-sitter-langs" . "bf125472c185f098136b26b30d5e74332b4ee46b")
|
||||
("treemacs" . "b19060f25e55514f3d798d9f5af2dcd5b94a6026")
|
||||
("treepy.el" . "de1a2ddc3fd7152d0bfbd9e14312ff8a4864ab2b")
|
||||
("typescript.el" . "17d06bdf938281cf7cd9157189966a2fdfd4f62b")
|
||||
|
||||
Reference in New Issue
Block a user