Documentation
¶
Index ¶
- Variables
- func CustomErrorPattern(pattern string) string
- func ImportExternSymbols(externFs fs.ReadFileFS) (map[string]*SymbolTree, error)
- func ParseFiles(contextData *ContextData, defaultLanguage *Language, files fs.ReadFileFS, ...) error
- func ParseFromStackTrace(contextData *ContextData, defaultLanguage *Language, files fs.ReadFileFS) error
- func SetTemplateStackTraceRegex(lang *Language, pattern *regexp.Regexp)
- func TemplateKey(language, name string) string
- func WithSymbolTree(tree *SymbolTree) context.Context
- type AssignmentSymbol
- type BugFixGenerator
- type BugFixStep
- type BugFixSuggestion
- type BuiltinSymbol
- type Changeset
- type CompiledErrorTemplate
- type ContextData
- func (store *ContextData) AddDocument(doc *Document) *Document
- func (data *ContextData) AddVariable(name string, value string)
- func (data *ContextData) AddVariables(vars map[string]string)
- func (data *ContextData) FindSymbol(name string, pos int) Symbol
- func (data *ContextData) MainDocumentPath() string
- type DepGraph
- type DepNode
- type Document
- func (doc *Document) BytesContentEquals(cnt []byte) bool
- func (doc *Document) Editable() *EditableDocument
- func (doc *Document) LineAt(idx int) string
- func (doc *Document) Lines() []string
- func (doc *Document) LinesAt(from int, to int) []string
- func (doc *Document) RootNode() SyntaxNode
- func (doc *Document) StringContentEquals(str string) bool
- func (doc *Document) TotalLines() int
- type EditableDocument
- func (doc *EditableDocument) Apply(changeset Changeset) Position
- func (doc *EditableDocument) Copy() *EditableDocument
- func (doc *EditableDocument) FillIndex(pos Position) Position
- func (doc *EditableDocument) ModifiedLineAt(idx int) string
- func (doc *EditableDocument) ModifiedLinesAt(from int, to int) []string
- func (doc *EditableDocument) Reset()
- func (doc *EditableDocument) String() string
- type ErrgoEngine
- type ErrorTemplate
- type ErrorTemplates
- func (tmps *ErrorTemplates) Add(language *Language, template ErrorTemplate) (*CompiledErrorTemplate, error)
- func (tmps ErrorTemplates) Find(language, name string) *CompiledErrorTemplate
- func (tmps ErrorTemplates) Match(msg string) *CompiledErrorTemplate
- func (tmps ErrorTemplates) MustAdd(language *Language, template ErrorTemplate) *CompiledErrorTemplate
- type ExplainGenerator
- type ExternFile
- type ExternSymbol
- type FixSuggestion
- type IChildrenSymbol
- type ICollectionTypeSymbol
- type IReturnableSymbol
- type ImportParams
- type ImportSymbol
- type Language
- type LanguageAnalyzer
- type Location
- type LocationConverterContext
- type LocationConverterFunc
- type MainError
- type MultiReadFileFS
- func (mfs *MultiReadFileFS) Attach(instance fs.ReadFileFS, idx int)
- func (mfs *MultiReadFileFS) AttachOrReplace(fs fs.ReadFileFS, idx int)
- func (mfs *MultiReadFileFS) LastAttachedIdx() int
- func (mfs *MultiReadFileFS) Open(name string) (fs.File, error)
- func (mfs *MultiReadFileFS) ReadFile(name string) ([]byte, error)
- type NodeValueAnalyzer
- type OutputGenerator
- func (gen *OutputGenerator) Break()
- func (gen *OutputGenerator) FromExplanation(level int, explain *ExplainGenerator)
- func (gen *OutputGenerator) Generate(explain *ExplainGenerator, bugFix *BugFixGenerator) string
- func (gen *OutputGenerator) Heading(level int, text string)
- func (gen *OutputGenerator) Reset()
- func (gen *OutputGenerator) Write(str string, d ...any)
- func (gen *OutputGenerator) WriteLines(lines ...string)
- func (gen *OutputGenerator) Writeln(str string, d ...any)
- type Position
- func (pos Position) Add(pos2 Position) Position
- func (pos Position) AddUnsafe(pos2 Position) Position
- func (a Position) Eq(b Position) bool
- func (a Position) Eq2(b Position) bool
- func (pos Position) IsInBetween(loc Location) bool
- func (pos Position) Point() sitter.Point
- func (pos Position) String() string
- type QueryMatchIterator
- type QueryNodeCtx
- type QueryNodeCursor
- func (c *QueryNodeCursor) CurrentNode() SyntaxNode
- func (c *QueryNodeCursor) CurrentTagName() string
- func (c *QueryNodeCursor) Len() int
- func (c *QueryNodeCursor) Match() *QueryMatchIterator
- func (c *QueryNodeCursor) Next() bool
- func (c *QueryNodeCursor) NextMatch() bool
- func (c *QueryNodeCursor) Query() *sitter.Query
- type RawFS
- type ResolvedImport
- type StackTraceEntry
- type Store
- type Symbol
- type SymbolAnalyzer
- type SymbolKind
- type SymbolTree
- func (tree *SymbolTree) Add(sym Symbol)
- func (tree *SymbolTree) CreateChildFromNode(n SyntaxNode) *SymbolTree
- func (tree *SymbolTree) Find(name string) Symbol
- func (tree *SymbolTree) FindSymbolsByClause(findFn func(sym Symbol) bool) []Symbol
- func (tree *SymbolTree) GetNearestScopedTree(index int) *SymbolTree
- func (tree *SymbolTree) GetSymbolByNode(node SyntaxNode) Symbol
- type SyntaxNode
- func (n SyntaxNode) Child(idx int) SyntaxNode
- func (n SyntaxNode) ChildByFieldName(field string) SyntaxNode
- func (n SyntaxNode) Debug()
- func (n SyntaxNode) EndPosition() Position
- func (n SyntaxNode) FirstNamedChild() SyntaxNode
- func (n SyntaxNode) IsNull() bool
- func (n SyntaxNode) LastNamedChild() SyntaxNode
- func (n SyntaxNode) Location() Location
- func (n SyntaxNode) NamedChild(idx int) SyntaxNode
- func (n SyntaxNode) NamedDescendantForPointRange(posRange Location) SyntaxNode
- func (n SyntaxNode) NextSibling() SyntaxNode
- func (n SyntaxNode) Parent() SyntaxNode
- func (n SyntaxNode) PrevNamedSibling() SyntaxNode
- func (n SyntaxNode) PrevSibling() SyntaxNode
- func (n SyntaxNode) Query(q string, d ...any) *QueryNodeCursor
- func (n SyntaxNode) RawNode() *sitter.Node
- func (n SyntaxNode) StartPosition() Position
- func (n SyntaxNode) Text() string
- func (n SyntaxNode) TreeCursor() *sitter.TreeCursor
- type TopLevelSymbol
- type TraceStack
- type VariableSymbol
- type VirtualFS
- type VirtualFile
Constants ¶
This section is empty.
Variables ¶
View Source
var FallbackErrorTemplate = &CompiledErrorTemplate{ ErrorTemplate: ErrorTemplate{ Name: "UnknownError", Pattern: `.*`, OnGenExplainFn: func(cd *ContextData, gen *ExplainGenerator) { gen.Add("There are no available error templates for this error.\n") gen.Add("```\n") gen.Add(cd.Variables["message"]) gen.Add("\n```") }, }, Language: &Language{ AnalyzerFactory: func(cd *ContextData) LanguageAnalyzer { return nil }, }, Pattern: nil, StackTracePattern: nil, }
View Source
var TestLanguage = &Language{ Name: "TestLang", FilePatterns: []string{".test"}, SitterLanguage: python.GetLanguage(), StackTracePattern: `\sin (?P<symbol>\S+) at (?P<path>\S+):(?P<position>\d+)`, AnalyzerFactory: func(cd *ContextData) LanguageAnalyzer { return &testAnalyzer{} }, SymbolsToCapture: ` (expression_statement (assignment left: (identifier) @assignment.name right: (identifier) @assignment.content) @assignment) `, }
Functions ¶
func CustomErrorPattern ¶
func ImportExternSymbols ¶
func ImportExternSymbols(externFs fs.ReadFileFS) (map[string]*SymbolTree, error)
func ParseFiles ¶
func ParseFiles(contextData *ContextData, defaultLanguage *Language, files fs.ReadFileFS, fileNames []string) error
func ParseFromStackTrace ¶
func ParseFromStackTrace(contextData *ContextData, defaultLanguage *Language, files fs.ReadFileFS) error
func SetTemplateStackTraceRegex ¶
SetTemplateStackTraceRegex sets the language's regex pattern directly. for testing purposes only
func TemplateKey ¶
func WithSymbolTree ¶
func WithSymbolTree(tree *SymbolTree) context.Context
Types ¶
type AssignmentSymbol ¶
type AssignmentSymbol struct {
Variable Symbol
FallbackName string
Location_ Location
ContentReturnType Symbol
}
func (AssignmentSymbol) Kind ¶
func (sym AssignmentSymbol) Kind() SymbolKind
func (AssignmentSymbol) Location ¶
func (sym AssignmentSymbol) Location() Location
func (AssignmentSymbol) Name ¶
func (sym AssignmentSymbol) Name() string
func (AssignmentSymbol) ReturnType ¶
func (sym AssignmentSymbol) ReturnType() Symbol
type BugFixGenerator ¶
type BugFixGenerator struct {
Document *Document
Suggestions []*BugFixSuggestion
}
func NewBugFixGenerator ¶
func NewBugFixGenerator(doc *Document) *BugFixGenerator
func (*BugFixGenerator) Add ¶
func (gen *BugFixGenerator) Add(title string, makerFn func(s *BugFixSuggestion)) error
type BugFixStep ¶
type BugFixStep struct {
Doc *EditableDocument
StartLine int
AfterLine int
OrigStartLine int
OrigAfterLine int
Content string
DiffPosition Position
Fixes []FixSuggestion
// contains filtered or unexported fields
}
func (*BugFixStep) AddFix ¶
func (step *BugFixStep) AddFix(fix FixSuggestion) *BugFixStep
type BugFixSuggestion ¶
type BugFixSuggestion struct {
Title string
Steps []*BugFixStep
Doc *EditableDocument
// contains filtered or unexported fields
}
func (*BugFixSuggestion) AddStep ¶
func (gen *BugFixSuggestion) AddStep(content string, d ...any) *BugFixStep
type BuiltinSymbol ¶
type BuiltinSymbol struct {
Name_ string
}
func (BuiltinSymbol) Kind ¶
func (sym BuiltinSymbol) Kind() SymbolKind
func (BuiltinSymbol) Location ¶
func (sym BuiltinSymbol) Location() Location
func (BuiltinSymbol) Name ¶
func (sym BuiltinSymbol) Name() string
type CompiledErrorTemplate ¶
type CompiledErrorTemplate struct {
ErrorTemplate
Language *Language
Pattern *regexp.Regexp
StackTracePattern *regexp.Regexp
}
func (*CompiledErrorTemplate) ExtractStackTrace ¶
func (tmp *CompiledErrorTemplate) ExtractStackTrace(cd *ContextData) TraceStack
func (*CompiledErrorTemplate) ExtractVariables ¶
func (tmp *CompiledErrorTemplate) ExtractVariables(msg string) map[string]string
func (*CompiledErrorTemplate) Match ¶
func (tmp *CompiledErrorTemplate) Match(str string) bool
func (*CompiledErrorTemplate) StackTraceRegex ¶
func (tmp *CompiledErrorTemplate) StackTraceRegex() *regexp.Regexp
type ContextData ¶
type ContextData struct {
*Store
Analyzer LanguageAnalyzer
WorkingPath string
CurrentDocumentPath string
Variables map[string]string
TraceStack TraceStack
MainError *MainError
}
func NewContextData ¶
func NewContextData(store *Store, workingPath string) *ContextData
func (*ContextData) AddDocument ¶
func (store *ContextData) AddDocument(doc *Document) *Document
func (*ContextData) AddVariable ¶
func (data *ContextData) AddVariable(name string, value string)
func (*ContextData) AddVariables ¶
func (data *ContextData) AddVariables(vars map[string]string)
func (*ContextData) FindSymbol ¶
func (data *ContextData) FindSymbol(name string, pos int) Symbol
func (*ContextData) MainDocumentPath ¶
func (data *ContextData) MainDocumentPath() string
type DepNode ¶
type DepNode struct {
Graph DepGraph
Path string // path where the module/library/package is located
Dependencies map[string]string // mapped as map[label]depPath
}
func (*DepNode) DependentPaths ¶
func (*DepNode) Dependents ¶
func (*DepNode) GetDependencies ¶
func (*DepNode) HasDependency ¶
type Document ¶
type Document struct {
Version int
Path string
Contents string
Language *Language
Tree *sitter.Tree
// contains filtered or unexported fields
}
func ParseDocument ¶
func (*Document) BytesContentEquals ¶
func (*Document) Editable ¶
func (doc *Document) Editable() *EditableDocument
func (*Document) RootNode ¶
func (doc *Document) RootNode() SyntaxNode
func (*Document) StringContentEquals ¶
func (*Document) TotalLines ¶
type EditableDocument ¶
type EditableDocument struct {
*Document
// contains filtered or unexported fields
}
func NewEditableDocument ¶
func NewEditableDocument(doc *Document) *EditableDocument
func (*EditableDocument) Apply ¶
func (doc *EditableDocument) Apply(changeset Changeset) Position
func (*EditableDocument) Copy ¶
func (doc *EditableDocument) Copy() *EditableDocument
func (*EditableDocument) FillIndex ¶
func (doc *EditableDocument) FillIndex(pos Position) Position
func (*EditableDocument) ModifiedLineAt ¶
func (doc *EditableDocument) ModifiedLineAt(idx int) string
func (*EditableDocument) ModifiedLinesAt ¶
func (doc *EditableDocument) ModifiedLinesAt(from int, to int) []string
func (*EditableDocument) Reset ¶
func (doc *EditableDocument) Reset()
func (*EditableDocument) String ¶
func (doc *EditableDocument) String() string
type ErrgoEngine ¶
type ErrgoEngine struct {
ErrorTemplates ErrorTemplates
FS *MultiReadFileFS
OutputGen *OutputGenerator
IsTesting bool
}
func New ¶
func New() *ErrgoEngine
func (*ErrgoEngine) Analyze ¶
func (e *ErrgoEngine) Analyze(workingPath, msg string) (*CompiledErrorTemplate, *ContextData, error)
func (*ErrgoEngine) AttachMainFS ¶
func (e *ErrgoEngine) AttachMainFS(instance fs.ReadFileFS)
func (*ErrgoEngine) Translate ¶
func (e *ErrgoEngine) Translate(template *CompiledErrorTemplate, contextData *ContextData) (mainExp string, fullExp string)
type ErrorTemplate ¶
type ErrorTemplate struct {
Name string
Pattern string
StackTracePattern string
OnAnalyzeErrorFn func(cd *ContextData, m *MainError)
OnGenExplainFn func(cd *ContextData, gen *ExplainGenerator)
OnGenBugFixFn func(cd *ContextData, gen *BugFixGenerator)
}
type ErrorTemplates ¶
type ErrorTemplates map[string]*CompiledErrorTemplate
func (*ErrorTemplates) Add ¶
func (tmps *ErrorTemplates) Add(language *Language, template ErrorTemplate) (*CompiledErrorTemplate, error)
func (ErrorTemplates) Find ¶
func (tmps ErrorTemplates) Find(language, name string) *CompiledErrorTemplate
func (ErrorTemplates) Match ¶
func (tmps ErrorTemplates) Match(msg string) *CompiledErrorTemplate
func (ErrorTemplates) MustAdd ¶
func (tmps ErrorTemplates) MustAdd(language *Language, template ErrorTemplate) *CompiledErrorTemplate
type ExplainGenerator ¶
type ExplainGenerator struct {
ErrorName string
Builder *strings.Builder
Sections map[string]*ExplainGenerator
}
func NewExplainGeneratorForError ¶
func NewExplainGeneratorForError(name string) *ExplainGenerator
func (*ExplainGenerator) Add ¶
func (gen *ExplainGenerator) Add(text string, data ...any)
func (*ExplainGenerator) CreateSection ¶
func (gen *ExplainGenerator) CreateSection(name string) *ExplainGenerator
type ExternFile ¶
type ExternFile struct {
Name string `json:"name"`
Package string `json:"package"`
Constructors []ExternSymbol `json:"constructors"`
Methods []ExternSymbol `json:"methods"`
}
type ExternSymbol ¶
type ExternSymbol struct {
Name string `json:"name"`
Type string `json:"type"`
ReturnType string `json:"returnType"`
Paremeters []ExternSymbol `json:"parameters"`
}
type FixSuggestion ¶
type IChildrenSymbol ¶
type IChildrenSymbol interface {
Symbol
Children() *SymbolTree
}
func CastChildrenSymbol ¶
func CastChildrenSymbol(sym Symbol) IChildrenSymbol
type ICollectionTypeSymbol ¶
type ICollectionTypeSymbol interface {
IsFixed() bool
}
Collection types
type IReturnableSymbol ¶
func CastSymbolReturnable ¶
func CastSymbolReturnable(sym Symbol) IReturnableSymbol
type ImportParams ¶
type ImportParams struct {
Node SyntaxNode
CurrentDir string
}
type ImportSymbol ¶
func (ImportSymbol) Kind ¶
func (sym ImportSymbol) Kind() SymbolKind
func (ImportSymbol) Location ¶
func (sym ImportSymbol) Location() Location
func (ImportSymbol) Name ¶
func (sym ImportSymbol) Name() string
type Language ¶
type Language struct {
Name string
FilePatterns []string
SitterLanguage *sitter.Language
StackTracePattern string
ErrorPattern string
SymbolsToCapture string
LocationConverter func(ctx LocationConverterContext) Location
AnalyzerFactory func(cd *ContextData) LanguageAnalyzer
ExternFS fs.ReadFileFS
// contains filtered or unexported fields
}
type LanguageAnalyzer ¶
type LanguageAnalyzer interface {
FallbackSymbol() Symbol
FindSymbol(name string) Symbol
AnalyzeNode(context.Context, SyntaxNode) Symbol
AnalyzeImport(ImportParams) ResolvedImport
}
type Location ¶
func DefaultLocationConverter ¶
func DefaultLocationConverter(ctx LocationConverterContext) Location
type LocationConverterContext ¶
type LocationConverterContext struct {
Path string
Pos string
ContextData *ContextData
}
type LocationConverterFunc ¶
type LocationConverterFunc func(ctx LocationConverterContext) Position
type MainError ¶
type MainError struct {
ErrorNode *StackTraceEntry
Document *Document
Nearest SyntaxNode
Context any
}
func (*MainError) DocumentPath ¶
type MultiReadFileFS ¶
type MultiReadFileFS struct {
FSs []fs.ReadFileFS
}
func (*MultiReadFileFS) Attach ¶
func (mfs *MultiReadFileFS) Attach(instance fs.ReadFileFS, idx int)
func (*MultiReadFileFS) AttachOrReplace ¶
func (mfs *MultiReadFileFS) AttachOrReplace(fs fs.ReadFileFS, idx int)
func (*MultiReadFileFS) LastAttachedIdx ¶
func (mfs *MultiReadFileFS) LastAttachedIdx() int
type NodeValueAnalyzer ¶
type NodeValueAnalyzer interface {
FindSymbol(name string, pos int) Symbol
AnalyzeValue(n SyntaxNode) Symbol
}
type OutputGenerator ¶
type OutputGenerator struct {
GenAfterExplain func(*OutputGenerator)
Builder *strings.Builder
}
func (*OutputGenerator) Break ¶
func (gen *OutputGenerator) Break()
func (*OutputGenerator) FromExplanation ¶
func (gen *OutputGenerator) FromExplanation(level int, explain *ExplainGenerator)
func (*OutputGenerator) Generate ¶
func (gen *OutputGenerator) Generate(explain *ExplainGenerator, bugFix *BugFixGenerator) string
func (*OutputGenerator) Heading ¶
func (gen *OutputGenerator) Heading(level int, text string)
func (*OutputGenerator) Reset ¶
func (gen *OutputGenerator) Reset()
func (*OutputGenerator) Write ¶
func (gen *OutputGenerator) Write(str string, d ...any)
func (*OutputGenerator) WriteLines ¶
func (gen *OutputGenerator) WriteLines(lines ...string)
func (*OutputGenerator) Writeln ¶
func (gen *OutputGenerator) Writeln(str string, d ...any)
type Position ¶
func (Position) IsInBetween ¶
type QueryMatchIterator ¶
type QueryMatchIterator struct {
// contains filtered or unexported fields
}
func (*QueryMatchIterator) Captures ¶
func (it *QueryMatchIterator) Captures() []sitter.QueryCapture
func (*QueryMatchIterator) Current ¶
func (it *QueryMatchIterator) Current() sitter.QueryCapture
func (*QueryMatchIterator) Next ¶
func (it *QueryMatchIterator) Next() bool
func (*QueryMatchIterator) ReachedEnd ¶
func (it *QueryMatchIterator) ReachedEnd() bool
type QueryNodeCtx ¶
type QueryNodeCtx struct {
Query *sitter.Query
Cursor *sitter.QueryCursor
}
type QueryNodeCursor ¶
type QueryNodeCursor struct {
// contains filtered or unexported fields
}
func (*QueryNodeCursor) CurrentNode ¶
func (c *QueryNodeCursor) CurrentNode() SyntaxNode
func (*QueryNodeCursor) CurrentTagName ¶
func (c *QueryNodeCursor) CurrentTagName() string
func (*QueryNodeCursor) Len ¶
func (c *QueryNodeCursor) Len() int
func (*QueryNodeCursor) Match ¶
func (c *QueryNodeCursor) Match() *QueryMatchIterator
func (*QueryNodeCursor) Next ¶
func (c *QueryNodeCursor) Next() bool
func (*QueryNodeCursor) NextMatch ¶
func (c *QueryNodeCursor) NextMatch() bool
func (*QueryNodeCursor) Query ¶
func (c *QueryNodeCursor) Query() *sitter.Query
type ResolvedImport ¶
type StackTraceEntry ¶
type Store ¶
type Store struct {
DepGraph DepGraph
Documents map[string]*Document
Symbols map[string]*SymbolTree
FS fs.ReadFileFS
}
func NewEmptyStore ¶
func NewEmptyStore() *Store
func (*Store) FindSymbol ¶
func (*Store) InitOrGetSymbolTree ¶
func (store *Store) InitOrGetSymbolTree(docPath string) *SymbolTree
type Symbol ¶
type Symbol interface {
Name() string
Kind() SymbolKind
Location() Location
}
var UnresolvedSymbol Symbol = unresolvedSymbol{}
func GetFromSymbol ¶
func GetFromSymbol(sym IChildrenSymbol, field string) Symbol
func UnwrapActualReturnType ¶
func UnwrapReturnType ¶
type SymbolAnalyzer ¶
type SymbolAnalyzer struct {
ContextData *ContextData
// contains filtered or unexported fields
}
func (*SymbolAnalyzer) Analyze ¶
func (an *SymbolAnalyzer) Analyze(doc *Document)
type SymbolKind ¶
type SymbolKind int
const ( SymbolKindUnknown SymbolKind = 0 SymbolKindUnresolved SymbolKind = iota SymbolKindBuiltin SymbolKind = iota SymbolKindClass SymbolKind = iota SymbolKindFunction SymbolKind = iota SymbolKindVariable SymbolKind = iota SymbolKindAssignment SymbolKind = iota SymbolKindType SymbolKind = iota SymbolKindImport SymbolKind = iota )
func NewSymbolKindFromString ¶
func NewSymbolKindFromString(str string) SymbolKind
func (SymbolKind) String ¶
func (kind SymbolKind) String() string
type SymbolTree ¶
type SymbolTree struct {
Parent *SymbolTree
StartPos Position
EndPos Position
Symbols map[string]Symbol
Scopes []*SymbolTree
}
func GetSymbolTreeCtx ¶
func GetSymbolTreeCtx(ctx context.Context) *SymbolTree
func (*SymbolTree) Add ¶
func (tree *SymbolTree) Add(sym Symbol)
func (*SymbolTree) CreateChildFromNode ¶
func (tree *SymbolTree) CreateChildFromNode(n SyntaxNode) *SymbolTree
func (*SymbolTree) Find ¶
func (tree *SymbolTree) Find(name string) Symbol
func (*SymbolTree) FindSymbolsByClause ¶
func (tree *SymbolTree) FindSymbolsByClause(findFn func(sym Symbol) bool) []Symbol
func (*SymbolTree) GetNearestScopedTree ¶
func (tree *SymbolTree) GetNearestScopedTree(index int) *SymbolTree
func (*SymbolTree) GetSymbolByNode ¶
func (tree *SymbolTree) GetSymbolByNode(node SyntaxNode) Symbol
type SyntaxNode ¶
func (SyntaxNode) Child ¶
func (n SyntaxNode) Child(idx int) SyntaxNode
func (SyntaxNode) ChildByFieldName ¶
func (n SyntaxNode) ChildByFieldName(field string) SyntaxNode
func (SyntaxNode) Debug ¶
func (n SyntaxNode) Debug()
func (SyntaxNode) EndPosition ¶
func (n SyntaxNode) EndPosition() Position
func (SyntaxNode) FirstNamedChild ¶
func (n SyntaxNode) FirstNamedChild() SyntaxNode
func (SyntaxNode) IsNull ¶
func (n SyntaxNode) IsNull() bool
func (SyntaxNode) LastNamedChild ¶
func (n SyntaxNode) LastNamedChild() SyntaxNode
func (SyntaxNode) Location ¶
func (n SyntaxNode) Location() Location
func (SyntaxNode) NamedChild ¶
func (n SyntaxNode) NamedChild(idx int) SyntaxNode
func (SyntaxNode) NamedDescendantForPointRange ¶
func (n SyntaxNode) NamedDescendantForPointRange(posRange Location) SyntaxNode
func (SyntaxNode) NextSibling ¶
func (n SyntaxNode) NextSibling() SyntaxNode
func (SyntaxNode) Parent ¶
func (n SyntaxNode) Parent() SyntaxNode
func (SyntaxNode) PrevNamedSibling ¶
func (n SyntaxNode) PrevNamedSibling() SyntaxNode
func (SyntaxNode) PrevSibling ¶
func (n SyntaxNode) PrevSibling() SyntaxNode
func (SyntaxNode) Query ¶
func (n SyntaxNode) Query(q string, d ...any) *QueryNodeCursor
func (SyntaxNode) RawNode ¶
func (n SyntaxNode) RawNode() *sitter.Node
func (SyntaxNode) StartPosition ¶
func (n SyntaxNode) StartPosition() Position
func (SyntaxNode) Text ¶
func (n SyntaxNode) Text() string
func (SyntaxNode) TreeCursor ¶
func (n SyntaxNode) TreeCursor() *sitter.TreeCursor
type TopLevelSymbol ¶
type TopLevelSymbol struct {
Name_ string `json:"name"`
Kind_ SymbolKind `json:"kind"`
Location_ Location `json:"location"`
Children_ *SymbolTree `json:"children"`
ReturnType_ Symbol `json:"returnType"`
}
func (TopLevelSymbol) Children ¶
func (sym TopLevelSymbol) Children() *SymbolTree
func (TopLevelSymbol) Kind ¶
func (sym TopLevelSymbol) Kind() SymbolKind
func (TopLevelSymbol) Location ¶
func (sym TopLevelSymbol) Location() Location
func (TopLevelSymbol) Name ¶
func (sym TopLevelSymbol) Name() string
func (TopLevelSymbol) ReturnType ¶
func (sym TopLevelSymbol) ReturnType() Symbol
type TraceStack ¶
type TraceStack []StackTraceEntry
func (*TraceStack) Add ¶
func (st *TraceStack) Add(symbolName string, loc Location)
func (TraceStack) NearestTo ¶
func (st TraceStack) NearestTo(path string) StackTraceEntry
func (TraceStack) Top ¶
func (st TraceStack) Top() StackTraceEntry
type VariableSymbol ¶
type VariableSymbol struct {
Name_ string
Location_ Location
ReturnType_ Symbol
// contains filtered or unexported fields
}
func (VariableSymbol) ContentReturnType ¶
func (sym VariableSymbol) ContentReturnType() Symbol
func (VariableSymbol) IsParam ¶
func (sym VariableSymbol) IsParam() bool
func (VariableSymbol) Kind ¶
func (sym VariableSymbol) Kind() SymbolKind
func (VariableSymbol) Location ¶
func (sym VariableSymbol) Location() Location
func (VariableSymbol) Name ¶
func (sym VariableSymbol) Name() string
func (VariableSymbol) ReturnType ¶
func (sym VariableSymbol) ReturnType() Symbol
type VirtualFS ¶
type VirtualFS struct {
Files []VirtualFile
}
func (*VirtualFS) StubFile ¶
func (vfs *VirtualFS) StubFile(name string) VirtualFile
type VirtualFile ¶
type VirtualFile struct {
Name string
}
func (VirtualFile) Close ¶
func (VirtualFile) Close() error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
utils
|
|
|
levenshtein
Package levenshtein is a Go implementation to calculate Levenshtein Distance.
|
Package levenshtein is a Go implementation to calculate Levenshtein Distance. |
Click to show internal directories.
Click to hide internal directories.