File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change 1414(require 'scheme )
1515(require 'tree-sitter )
1616
17- (eval-when-compile
18- (require 'cl-lib ))
19-
2017(defgroup tree-sitter-query nil
2118 " Tree-Sitter playground."
2219 :group 'tree-sitter )
5754 (remove-overlays )
5855 (let* ((query (ts-make-query tree-sitter-language patterns))
5956 (root-node (ts-root-node tree-sitter-tree))
60- (captures-list (ts-query-captures query root-node)))
61- (if (= (length captures-list ) 0 )
57+ (captures (ts-query-captures query root-node)))
58+ (if (= (length captures) 0 )
6259 (message " No matches found " )
63- ; ; Highlight captures.
64- (cl-loop
65- for captures across captures-list
66- do
67- (cl-loop
68- for capture on captures
69- do (tree-sitter-query--highlight-capture capture)))))))
60+ (mapc #'tree-sitter-query--highlight-capture captures)))))
7061
7162(defun tree-sitter-query--after-change (&rest _args )
7263 " Run query patterns against the target buffer and update highlighted texts."
You can’t perform that action at this time.
0 commit comments