Expand description
Load and configure parsers written with tree-sitter.
Structsยง
- Exceeded
Byte ๐Limit - Highlighted
Node ๐Ids - Tree
Sitter ๐Config 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ยง
- OCAML_
ATOM_ ๐NODES
Functionsยง
- Convert all the tree-sitter nodes at this level to difftastic syntax nodes.
- atom_
from_ ๐cursor Convert the tree-sitter node atcursorto a difftastic atom. - child_
tokens ๐ - comment_
positions ๐ - find_
delim_ ๐positions Are any of the children of the node atcursordelimiters? Return their indexes if so. - from_
language ๐ - list_
from_ ๐cursor Convert the tree-sitter node atcursorto a difftastic list node. - parse ๐Parse
srcwith tree-sitter and convert to difftastic Syntax. - parse_
subtrees ๐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_
cursor ๐ - print_
tree ๐ - Does
nodematch the ignorable trailing tokens configuration for this language? - syntax_
from_ ๐cursor Convert the tree-sitter node atcursorto a difftastic syntax node. - to_
syntax ๐ - to_
syntax_ ๐with_ limit - to_tree ๐Parse
srcwith tree-sitter. - to_
tree_ ๐with_ limit - tree_
highlights ๐Calculate which tree-sitter node IDs should have which syntax highlighting. - tree_
sitter_ ๐ โelvish - tree_
sitter_ ๐ โhare - tree_
sitter_ ๐ โjanet_ simple - tree_
sitter_ ๐ โkotlin - tree_
sitter_ ๐ โlatex - tree_
sitter_ ๐ โscss - tree_
sitter_ ๐ โsmali