@singapor/tree-sitter
v0.1.1
Published
Tree-sitter syntax runtime for `@singapor/core`.
Readme
@singapor/tree-sitter
Tree-sitter syntax runtime for @singapor/core.
This package provides the syntax provider, language registry, worker client, source adapter, and
structural selection helpers. Pair it with @singapor/tree-sitter-languages for bundled language
contributions.
Install
npm install @singapor/core @singapor/tree-sitterUsage
import { createTreeSitterSyntaxProvider } from '@singapor/tree-sitter'
const syntaxProvider = createTreeSitterSyntaxProvider()Register the provider with an editor plugin context, or use createTreeSitterLanguagePlugin when
you already have language contributions to install.
Exports
createTreeSitterSyntaxProvidercreates a syntax provider backed by a Tree-sitter worker.createTreeSitterLanguagePluginregisters language contributions with the default provider.TreeSitterWorkerClientandcreateTreeSitterWorkerBackendexpose the worker transport.expandTreeSitterSelection,shrinkTreeSitterSelection, andselectTreeSitterTokenprovide structural selection helpers.
