diff options
| author | Yuan Fu | 2024-12-23 21:20:18 -0800 |
|---|---|---|
| committer | Yuan Fu | 2024-12-24 13:52:39 -0800 |
| commit | 833494d4b00a837be8ceaa09b37f54ce17d0a062 (patch) | |
| tree | 79d002f9bd097893304783125560c138f13a5df4 | |
| parent | 251b4c8c39535fee9f6da89420483304274ac03e (diff) | |
| download | emacs-833494d4b00a837be8ceaa09b37f54ce17d0a062.tar.gz emacs-833494d4b00a837be8ceaa09b37f54ce17d0a062.zip | |
; Add some shortdoc examples for treesit entry
* lisp/treesit.el: Add some shortdoc examples.
| -rw-r--r-- | lisp/treesit.el | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lisp/treesit.el b/lisp/treesit.el index be264b4292a..2cf7bccdeed 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el | |||
| @@ -4376,6 +4376,22 @@ generated by \"git describe\". It only works when | |||
| 4376 | :eval (treesit-pattern-expand '(identifier)) | 4376 | :eval (treesit-pattern-expand '(identifier)) |
| 4377 | :eval (treesit-pattern-expand :equal)) | 4377 | :eval (treesit-pattern-expand :equal)) |
| 4378 | 4378 | ||
| 4379 | "Tree-sitter things and navigation" | ||
| 4380 | (treesit-thing-defined-p | ||
| 4381 | :no-eval (treesit-thing-defined-p 'sexp) | ||
| 4382 | :eg-result nil) | ||
| 4383 | (treesit-thing-definition | ||
| 4384 | :no-eval (treesit-thing-defined 'sexp) | ||
| 4385 | :eg-result (not ,(rx (or "{" "}" "[" "]" "(" ")" ",")))) | ||
| 4386 | (treesit-thing-at | ||
| 4387 | :no-eval (treesit-thing-at 3943) | ||
| 4388 | :eg-result-string "#<treesit-node (identifier) in 3941-3949>") | ||
| 4389 | (treesit-thing-next | ||
| 4390 | :no-eval (treesit-thing-next 3943 'sexp)) | ||
| 4391 | (treesit-navigate-thing | ||
| 4392 | :no-eval (treesit-navigate-thing 3943 1 'beg 'sexp)) | ||
| 4393 | (treesit-beginning-of-thing | ||
| 4394 | :no-eval (treesit-beginning-of-thing 'defun 1 'nested)) | ||
| 4379 | 4395 | ||
| 4380 | "Parsing a string" | 4396 | "Parsing a string" |
| 4381 | (treesit-parse-string | 4397 | (treesit-parse-string |
| @@ -4388,7 +4404,15 @@ generated by \"git describe\". It only works when | |||
| 4388 | "Misc" | 4404 | "Misc" |
| 4389 | (treesit-subtree-stat | 4405 | (treesit-subtree-stat |
| 4390 | :no-eval (treesit-subtree-stat node) | 4406 | :no-eval (treesit-subtree-stat node) |
| 4391 | :eg-result (6 33 487))) | 4407 | :eg-result (6 33 487)) |
| 4408 | (treesit-language-abi-version | ||
| 4409 | :no-eval (treesit-language-abi-version 'c) | ||
| 4410 | :eg-result 14) | ||
| 4411 | (treesit-grammar-location | ||
| 4412 | :no-eval (treesit-language-abi-version 'c)) | ||
| 4413 | (treesit-language-display-name | ||
| 4414 | :no-eval (treesit-language-display-name 'cpp) | ||
| 4415 | :eg-result "C++")) | ||
| 4392 | 4416 | ||
| 4393 | (provide 'treesit) | 4417 | (provide 'treesit) |
| 4394 | 4418 | ||