aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorYuan Fu2024-12-02 17:23:08 -0800
committerYuan Fu2024-12-04 22:39:28 -0800
commit10b4d3045e1b856009c5ac1e1a1ca257f2d4493f (patch)
tree853550194f583449a965fa561fbd082f2822fb21 /doc
parent25b4bf7fcd75564f23b2e60e29e8ff7354186371 (diff)
downloademacs-10b4d3045e1b856009c5ac1e1a1ca257f2d4493f.tar.gz
emacs-10b4d3045e1b856009c5ac1e1a1ca257f2d4493f.zip
Make tree-sitter-explorer support selecting local parser
Now treesit-explore-mode will prompt the user to select a parser to explore, rather than a language. It'll also include the local parsers at point for selection. * lisp/treesit.el (treesit--explorer-language): Change to treesit--explorer-parser. (treesit--explorer--nodes-to-highlight): (treesit--explorer-refresh): Change to use parser. (treesit--explorer-generate-parser-alist): New function. (treesit-explorer-switch-parser): New command. (treesit-explore-mode): Use switch-parser to setup. * doc/lispref/parsing.texi (Language Grammar): Mention treesit-explorer-switch-parser.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/parsing.texi3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi
index 5ef29f558ef..7fbb8e61ce1 100644
--- a/doc/lispref/parsing.texi
+++ b/doc/lispref/parsing.texi
@@ -240,12 +240,15 @@ which displays the syntax tree of the source in the current buffer in
240real time. Emacs also comes with an ``inspect mode'', which displays 240real time. Emacs also comes with an ``inspect mode'', which displays
241information of the nodes at point in the mode-line. 241information of the nodes at point in the mode-line.
242 242
243@findex treesit-explorer-switch-parser
243@deffn Command treesit-explore 244@deffn Command treesit-explore
244This command pops up a window displaying the syntax tree of the source in 245This command pops up a window displaying the syntax tree of the source in
245the current buffer. Selecting text in the source buffer highlights 246the current buffer. Selecting text in the source buffer highlights
246the corresponding nodes in the syntax tree display. Clicking 247the corresponding nodes in the syntax tree display. Clicking
247on nodes in the syntax tree highlights the corresponding text in the 248on nodes in the syntax tree highlights the corresponding text in the
248source buffer. 249source buffer.
250
251To switch to another parser, use @code{treesit-explorer-switch-parser}.
249@end deffn 252@end deffn
250 253
251@deffn Command treesit-inspect-mode 254@deffn Command treesit-inspect-mode