This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

TreeSitterOptions Pennington.TreeSitter

Configuration for the Pennington tree-sitter integration.

Properties

ContentRoot string
Base directory that :symbol file references resolve against. When null or empty, AddTreeSitter registers only these options and no services.
LanguageConfigs Dictionary<string, LanguageDeclarationConfig>
Maps a fence base-language id (e.g. python, cs) to the declaration config used to resolve member name paths. Seeded with built-in defaults; callers may add or replace entries.
WatchFilePatterns ISet<string>
File globs watched (recursively) under ContentRoot for live-reload. Defaults to the source extensions of the built-in languages plus common markup/data formats (HTML, CSS, JSON, Razor) that are embedded whole-file — those need no LanguageConfigs entry because a bare :symbol reference returns the file as-is. Watching by extension keeps most build output from triggering reloads; note *.json and *.cs can still match files under bin//obj/, so prefer a focused content root (a dedicated snippets folder) when pointing at a source tree. Add or remove globs to customize.

Methods

ResolveConfig

#
public LanguageDeclarationConfig ResolveConfig(string languageId)

Returns the declaration config registered for languageId, or null when none is configured.

Parameters

languageId string

Returns

LanguageDeclarationConfig

Pennington.TreeSitter.TreeSitterOptions

namespace Pennington.TreeSitter;

/// Configuration for the Pennington tree-sitter integration.
public class TreeSitterOptions
{
    /// Base directory that :symbol file references resolve against. When null or empty, AddTreeSitter registers only these options and no services.
    
public string ContentRoot { get; set; }
/// Maps a fence base-language id (e.g. python, cs) to the declaration config used to resolve member name paths. Seeded with built-in defaults; callers may add or replace entries.
public Dictionary<string, LanguageDeclarationConfig> LanguageConfigs { get; }
/// Returns the declaration config registered for languageId, or null when none is configured.
public LanguageDeclarationConfig ResolveConfig(string languageId)
; /// File globs watched (recursively) under ContentRoot for live-reload. Defaults to the source extensions of the built-in languages plus common markup/data formats (HTML, CSS, JSON, Razor) that are embedded whole-file — those need no LanguageConfigs entry because a bare :symbol reference returns the file as-is. Watching by extension keeps most build output from triggering reloads; note *.json and *.cs can still match files under bin//obj/, so prefer a focused content root (a dedicated snippets folder) when pointing at a source tree. Add or remove globs to customize.
public ISet<string> WatchFilePatterns { get; }
}