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 contains 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 cursor to a difftastic atom.
Are any of the children of the node at cursor delimiters? Return their indexes if so.
Convert the tree-sitter node at cursor to a difftastic list node.
parse 🔒
Parse src with 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.
print_tree 🔒
Convert the tree-sitter node at cursor to a difftastic syntax node.
to_syntax 🔒
to_tree 🔒
Parse src with tree-sitter.
Calculate which tree-sitter node IDs should have which syntax highlighting.
tree_sitter_ada 🔒
tree_sitter_c 🔒
tree_sitter_cpp 🔒
tree_sitter_css 🔒
tree_sitter_elm 🔒
tree_sitter_go 🔒
tree_sitter_hcl 🔒
tree_sitter_lua 🔒
tree_sitter_nix 🔒
tree_sitter_php 🔒
tree_sitter_r 🔒
tree_sitter_sql 🔒
tree_sitter_tsx 🔒
tree_sitter_xml 🔒
tree_sitter_zig 🔒