Skip to content

TreeSitterOptions

type TreeSitterOptions =
    {
        Grammars: TreeSitterGrammar list
        RuntimePath: string option
        RuntimeSource: string
        UseBundledGrammars: bool
        AutoBuild: bool
        CliSource: string
        WasiSdkSource: string
        Browser: string list
    }
AssemblyNacara.Plugin.Highlight.TreeSitter

Options of the tree-sitter highlighter.

Fields

Grammars: TreeSitterGrammar list

The grammars to load, one per language.

RuntimePath: string option

Where the two native libraries are: tree-sitter and wasmtime.

Left unset, they are fetched once into a cache under the user's profile - the pair for this platform, and no other. Set it to run against a build of your own, and nothing is downloaded.

RuntimeSource: string

Where that pair is published, with {version} and {rid} in it.

Point it at a mirror for a build that cannot reach the npm registry.

UseBundledGrammars: bool

Fall back to the grammars this package ships.

A language named in Grammars is used ahead of a shipped one, so a site overrides F# without giving up the rest.

AutoBuild: bool

Build a grammar named by repository when it is not already built.

Turned off, a grammar missing from the cache is an error saying where it was looked for, which is what an offline or locked-down build wants.

CliSource: string

Where the tree-sitter CLI is published, with {version} and {platform} in it.

WasiSdkSource: string

Where the wasi-sdk is published, with {major}, {version} and {platform} in it.

Browser: string list

The languages <nacara-highlight> can colour in the browser.

Empty, nothing is emitted for the browser and a page carries no wasm. A build cannot know what language a runtime string is, so a site says it here.