; Add some shortdoc examples for treesit entry
* lisp/treesit.el: Add some shortdoc examples.
This commit is contained in:
parent
251b4c8c39
commit
833494d4b0
1 changed files with 25 additions and 1 deletions
|
@ -4376,6 +4376,22 @@ generated by \"git describe\". It only works when
|
|||
:eval (treesit-pattern-expand '(identifier))
|
||||
:eval (treesit-pattern-expand :equal))
|
||||
|
||||
"Tree-sitter things and navigation"
|
||||
(treesit-thing-defined-p
|
||||
:no-eval (treesit-thing-defined-p 'sexp)
|
||||
:eg-result nil)
|
||||
(treesit-thing-definition
|
||||
:no-eval (treesit-thing-defined 'sexp)
|
||||
:eg-result (not ,(rx (or "{" "}" "[" "]" "(" ")" ","))))
|
||||
(treesit-thing-at
|
||||
:no-eval (treesit-thing-at 3943)
|
||||
:eg-result-string "#<treesit-node (identifier) in 3941-3949>")
|
||||
(treesit-thing-next
|
||||
:no-eval (treesit-thing-next 3943 'sexp))
|
||||
(treesit-navigate-thing
|
||||
:no-eval (treesit-navigate-thing 3943 1 'beg 'sexp))
|
||||
(treesit-beginning-of-thing
|
||||
:no-eval (treesit-beginning-of-thing 'defun 1 'nested))
|
||||
|
||||
"Parsing a string"
|
||||
(treesit-parse-string
|
||||
|
@ -4388,7 +4404,15 @@ generated by \"git describe\". It only works when
|
|||
"Misc"
|
||||
(treesit-subtree-stat
|
||||
:no-eval (treesit-subtree-stat node)
|
||||
:eg-result (6 33 487)))
|
||||
:eg-result (6 33 487))
|
||||
(treesit-language-abi-version
|
||||
:no-eval (treesit-language-abi-version 'c)
|
||||
:eg-result 14)
|
||||
(treesit-grammar-location
|
||||
:no-eval (treesit-language-abi-version 'c))
|
||||
(treesit-language-display-name
|
||||
:no-eval (treesit-language-display-name 'cpp)
|
||||
:eg-result "C++"))
|
||||
|
||||
(provide 'treesit)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue