ISourceFragmentService
Pennington.TreeSitter.Fragments
Resolves a source file plus an optional member name path to its source text using tree-sitter.
Methods
GetFragment
#public FragmentResult GetFragment(string languageId, string relativeFilePath, string namePath, FragmentOptions options)
Returns the source text of namePath within relativeFilePath, or a failure. An empty namePath returns the whole file. options select body-only extraction, an elided-body outline, and whether the file's imports are prepended.
Parameters
languageIdstringrelativeFilePathstringnamePathstringoptionsFragmentOptions
Returns
FragmentResultPennington.TreeSitter.Fragments.ISourceFragmentService
namespace Pennington.TreeSitter.Fragments;
/// Resolves a source file plus an optional member name path to its source text using tree-sitter.
public interface ISourceFragmentService
{
/// Returns the source text of namePath within relativeFilePath, or a failure. An empty namePath returns the whole file. options select body-only extraction, an elided-body outline, and whether the file's imports are prepended.
public FragmentResult GetFragment(string languageId, string relativeFilePath, string namePath, FragmentOptions options)
;
}