Module difft::parse::tree_sitter_parser
source · Expand description
Load and configure parsers written with tree-sitter.
Structs
- Configuration for a tree-sitter parser.
- A language may contain certain nodes that are in other languages and should be parsed as such (e.g. HTML
<script>nodes containing JavaScript). This struct describes how to identify such nodes, and what languages we should parse them as.
Constants
Functions
- Convert all the tree-sitter nodes at this level to difftastic syntax nodes.
- Convert the tree-sitter node at
cursorto a difftastic atom. - Are any of the children of the node at
cursordelimiters? Return their indexes if so. - Convert the tree-sitter node at
cursorto a difftastic list node. - parse 🔒Parse
srcwith tree-sitter and convert to difftastic Syntax. - Find any nodes that can be parsed as other languages (e.g. JavaScript embedded in HTML), and return a map of their node IDs mapped to parsed trees. Every time we see such a node, we will ignore it and recurse into the root node of the given tree instead.
- Convert the tree-sitter node at
cursorto a difftastic syntax node. - to_tree 🔒Parse
srcwith tree-sitter. - Calculate which tree-sitter node IDs should have which syntax highlighting.
- tree_sitter_hack 🔒 ⚠
- tree_sitter_hare 🔒 ⚠
- tree_sitter_perl 🔒 ⚠
- tree_sitter_scss 🔒 ⚠
- tree_sitter_vhdl 🔒 ⚠