Module tree_sitter_stack_graphs::loader
source · [−]Expand description
Defines loader for stack graph languages
The loader is created from a tree-sitter configuration or list of search paths, an optional scope, and a function that may load the tree-sitter-graph file for a language.
The loader is called with a file path and optional file content and tries to find the language for that file. The loader will search for tree-sitter languages in the given search paths, or in current directory and the paths defined in the tree-sitter configuration. If a scope is provided, it will be used to restrict the discovered languages to those with a matching scope. If no languages were found at all, an error is raised. Otherwise, a language matching the file path and content is returned, if it exists among the discovered languages.
Previously loaded languages are cached in the loader, so subsequent loads are fast.