diff options
| author | Yuan Fu | 2024-12-02 17:23:08 -0800 |
|---|---|---|
| committer | Yuan Fu | 2024-12-04 22:39:28 -0800 |
| commit | 10b4d3045e1b856009c5ac1e1a1ca257f2d4493f (patch) | |
| tree | 853550194f583449a965fa561fbd082f2822fb21 /doc | |
| parent | 25b4bf7fcd75564f23b2e60e29e8ff7354186371 (diff) | |
| download | emacs-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.texi | 3 |
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 | |||
| 240 | real time. Emacs also comes with an ``inspect mode'', which displays | 240 | real time. Emacs also comes with an ``inspect mode'', which displays |
| 241 | information of the nodes at point in the mode-line. | 241 | information 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 |
| 244 | This command pops up a window displaying the syntax tree of the source in | 245 | This command pops up a window displaying the syntax tree of the source in |
| 245 | the current buffer. Selecting text in the source buffer highlights | 246 | the current buffer. Selecting text in the source buffer highlights |
| 246 | the corresponding nodes in the syntax tree display. Clicking | 247 | the corresponding nodes in the syntax tree display. Clicking |
| 247 | on nodes in the syntax tree highlights the corresponding text in the | 248 | on nodes in the syntax tree highlights the corresponding text in the |
| 248 | source buffer. | 249 | source buffer. |
| 250 | |||
| 251 | To 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 |