Documentation
¶
Index ¶
- type AffectedFile
- type Arch
- type AuthorContribution
- type AuthorSeries
- type AuthorStat
- type CallResolver
- type ChangeKind
- type Changes
- type ChurnStat
- type CoChange
- type CoChangesResult
- type ContentHit
- type ContentSearchOpts
- type ContentSearchResult
- type CoverageIssue
- type DepsResult
- type Edge
- type EdgeKind
- type Engine
- func (e *Engine) Architecture(ctx context.Context) (Arch, error)
- func (e *Engine) CoChanges(ctx context.Context, file string, limit int) (CoChangesResult, error)
- func (e *Engine) DeadCode(ctx context.Context, limit int) ([]*Node, error)
- func (e *Engine) Definitions(ctx context.Context, file string, src []byte, line, col int) ([]Location, error)
- func (e *Engine) Deps(ctx context.Context, target string, depth int) (DepsResult, error)
- func (e *Engine) DetectChanges(ctx context.Context, since string) (Changes, error)
- func (e *Engine) EdgeStats() map[Provenance]int
- func (e *Engine) GitInsights(ctx context.Context) (GitInsightsResult, error)
- func (e *Engine) Hierarchy(ctx context.Context, name, file string) (HierarchyResult, error)
- func (e *Engine) Hover(ctx context.Context, file string, src []byte, line, col int) (*HoverInfo, error)
- func (e *Engine) Implementations(ctx context.Context, file string, src []byte, line, col int) ([]Location, error)
- func (e *Engine) Index(ctx context.Context) (Status, error)
- func (e *Engine) IsStale(ctx context.Context) bool
- func (e *Engine) ModuleGraph(ctx context.Context) (ModuleGraph, error)
- func (e *Engine) ModuleProfiles(ctx context.Context, modules []string, topSymbols int) (map[string]ModuleProfile, error)
- func (e *Engine) Neighborhood(ctx context.Context, id, name, file string) (NeighborhoodResult, error)
- func (e *Engine) References(ctx context.Context, file string, src []byte, line, col int) ([]Location, error)
- func (e *Engine) Search(ctx context.Context, opts SearchOpts) ([]*Node, error)
- func (e *Engine) SearchContent(ctx context.Context, opts ContentSearchOpts) (ContentSearchResult, error)
- func (e *Engine) SearchPage(ctx context.Context, opts SearchOpts) (SearchResult, error)
- func (e *Engine) Similar(ctx context.Context, name, file string, limit int) (SimilarResult, error)
- func (e *Engine) Snippet(ctx context.Context, name, file string) (Snippet, error)
- func (e *Engine) Status() Status
- func (e *Engine) StatusOrLoad() Status
- func (e *Engine) Tests(ctx context.Context, name, file string) (TestsResult, error)
- func (e *Engine) Trace(ctx context.Context, from, to, file string, callers bool, maxDepth int) (TraceResult, error)
- type GitInsightsResult
- type Graph
- type HierarchyResult
- type Hotspot
- type HoverInfo
- type Impact
- type ImplementationResolver
- type Import
- type Kind
- type LangStat
- type Location
- type ModuleActivity
- type ModuleDep
- type ModuleGraph
- type ModuleGraphEdge
- type ModuleProfile
- type ModuleStat
- type NeighborhoodResult
- type Node
- type Option
- type Path
- type Provenance
- type RawContentHit
- type Ref
- type ResolvedLocation
- type SearchOpts
- type SearchResult
- type SearchSort
- type SemanticToken
- type Similar
- type SimilarResult
- type Snippet
- type Status
- type SymRange
- type Symbol
- type TestsResult
- type TraceResult
- type WeekActivity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AffectedFile ¶
type AffectedFile struct {
File string `json:"file"`
Kind ChangeKind `json:"kind"`
Nodes []*Node `json:"nodes"`
}
type Arch ¶
type Arch struct {
Languages []LangStat `json:"languages"`
TotalFiles int `json:"total_files"`
TotalNodes int `json:"total_nodes"`
TotalEdges int `json:"total_edges"`
Layers []ModuleStat `json:"layers"`
Modules []ModuleStat `json:"modules"`
ModuleDeps []ModuleDep `json:"module_deps"`
EntryPoints []*Node `json:"entry_points"`
Hotspots []Hotspot `json:"hotspots"`
}
type AuthorContribution ¶ added in v0.14.9
type AuthorSeries ¶ added in v0.14.9
type AuthorStat ¶ added in v0.14.9
type CallResolver ¶
type ChangeKind ¶
type ChangeKind string
const ( ChangeAdded ChangeKind = "added" ChangeModified ChangeKind = "modified" ChangeDeleted ChangeKind = "deleted" )
type Changes ¶
type Changes struct {
Files []AffectedFile `json:"files"`
Impact []Impact `json:"impact,omitempty"`
}
type ChurnStat ¶ added in v0.14.9
type ChurnStat struct {
File string `json:"file"`
Commits int `json:"commits"`
Authors int `json:"authors"`
RecentAuthors []AuthorContribution `json:"recent_authors"`
}
type CoChangesResult ¶
type ContentHit ¶ added in v0.12.7
type ContentSearchOpts ¶ added in v0.12.7
type ContentSearchResult ¶ added in v0.12.7
type ContentSearchResult struct {
Hits []ContentHit `json:"hits"`
Raw []RawContentHit `json:"raw,omitempty"`
TotalLineHits int `json:"total_line_hits"`
TotalResults int `json:"total_results"`
TotalRawResults int `json:"total_raw_results"`
Offset int `json:"offset"`
HasMore bool `json:"has_more"`
RawHasMore bool `json:"raw_has_more"`
}
type CoverageIssue ¶ added in v0.12.7
CoverageIssue records a source file that discovery found but the structural index could not fully process. Content search still scans these files and returns their hits as raw matches.
type DepsResult ¶
type Edge ¶
type Edge struct {
From string `json:"from"`
To string `json:"to"`
Kind EdgeKind `json:"kind"`
Via Provenance `json:"via,omitempty"`
}
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) Definitions ¶ added in v0.12.21
func (e *Engine) Definitions(ctx context.Context, file string, src []byte, line, col int) ([]Location, error)
Definitions finds declaration sites for the identifier at the given position. src overrides the on-disk content when non-nil.
func (*Engine) DetectChanges ¶
func (*Engine) EdgeStats ¶
func (e *Engine) EdgeStats() map[Provenance]int
func (*Engine) GitInsights ¶ added in v0.14.9
func (e *Engine) GitInsights(ctx context.Context) (GitInsightsResult, error)
func (*Engine) Hover ¶ added in v0.12.21
func (e *Engine) Hover(ctx context.Context, file string, src []byte, line, col int) (*HoverInfo, error)
Hover returns the best-ranked definition for the identifier at the given position with a snippet of its source, or nil when nothing matches.
func (*Engine) Implementations ¶ added in v0.12.21
func (e *Engine) Implementations(ctx context.Context, file string, src []byte, line, col int) ([]Location, error)
Implementations returns implementers and subtypes of the type named at the given position — only relations stated syntactically (extends/implements clauses, superclasses), so structurally-typed languages yield nothing.
func (*Engine) IsStale ¶ added in v0.12.7
IsStale reports whether any file's size/mtime or the file set differs from the workspace, re-walking at most once per staleCheckTTL. False with no graph means "not indexed", not "fresh".
func (*Engine) ModuleGraph ¶ added in v0.14.9
func (e *Engine) ModuleGraph(ctx context.Context) (ModuleGraph, error)
func (*Engine) ModuleProfiles ¶ added in v0.14.9
func (e *Engine) ModuleProfiles(ctx context.Context, modules []string, topSymbols int) (map[string]ModuleProfile, error)
ModuleProfiles indexes once and returns per-module files, most connected symbols, and a structure digest for cache invalidation.
func (*Engine) Neighborhood ¶ added in v0.14.9
func (*Engine) References ¶ added in v0.12.21
func (e *Engine) References(ctx context.Context, file string, src []byte, line, col int) ([]Location, error)
References finds declaration and usage sites for the identifier at the given position. src overrides the on-disk content when non-nil.
func (*Engine) SearchContent ¶ added in v0.12.7
func (e *Engine) SearchContent(ctx context.Context, opts ContentSearchOpts) (ContentSearchResult, error)
SearchContent scans the graph's discovered source-file set, maps each matching line to the tightest containing definition, and deduplicates the result by definition. Matches outside graph coverage remain in Raw.
func (*Engine) SearchPage ¶ added in v0.12.7
func (e *Engine) SearchPage(ctx context.Context, opts SearchOpts) (SearchResult, error)
func (*Engine) StatusOrLoad ¶
type GitInsightsResult ¶ added in v0.14.9
type GitInsightsResult struct {
Commits int `json:"commits"`
TotalAuthors int `json:"total_authors"`
Since time.Time `json:"since"`
Weeks []WeekActivity `json:"weeks"`
AuthorWeeks []AuthorSeries `json:"author_weeks"`
Punch [7][24]int `json:"punch"`
Authors []AuthorStat `json:"authors"`
Modules []ModuleActivity `json:"modules"`
Churn []ChurnStat `json:"churn"`
}
type HierarchyResult ¶
type ImplementationResolver ¶ added in v0.14.9
type ImplementationResolver interface {
ResolveImplementations(ctx context.Context, file string, line, column int) []ResolvedLocation
}
ImplementationResolver is an optional CallResolver capability for edges to concrete implementations of interface call sites.
type Location ¶ added in v0.12.21
Location is an LSP-style position: zero-based line and UTF-16 column in a slash-separated workspace-relative file.
type ModuleActivity ¶ added in v0.14.9
type ModuleGraph ¶ added in v0.14.9
type ModuleGraph struct {
Modules []ModuleStat `json:"modules"`
Edges []ModuleGraphEdge `json:"edges"`
}
type ModuleGraphEdge ¶ added in v0.14.9
type ModuleProfile ¶ added in v0.14.9
type ModuleStat ¶
type NeighborhoodResult ¶ added in v0.14.9
type NeighborhoodResult struct {
Node *Node `json:"node"`
Callers []*Node `json:"callers"`
Callees []*Node `json:"callees"`
Extends []*Node `json:"extends,omitempty"`
Subtypes []*Node `json:"subtypes,omitempty"`
Implements []*Node `json:"implements,omitempty"`
Implementers []*Node `json:"implementers,omitempty"`
Others []*Node `json:"others,omitempty"`
}
type Option ¶
type Option func(*Engine)
func WithResolver ¶
func WithResolver(r CallResolver) Option
type Path ¶
type Path struct {
Nodes []*Node
Via []Provenance
}
type Provenance ¶
type Provenance string
const ( ViaName Provenance = "name" ViaLSP Provenance = "lsp" ViaAmbiguous Provenance = "ambiguous" )
type RawContentHit ¶ added in v0.12.7
type Ref ¶ added in v0.12.21
type Ref struct {
Name string `json:"name"`
File string `json:"file"`
Line int `json:"line"`
Col int `json:"col"`
Kind EdgeKind `json:"kind"`
Lang string `json:"lang"`
}
Ref is a name usage site (call, inherits or implements clause) with an LSP-style zero-based line and UTF-16 column.
type ResolvedLocation ¶ added in v0.14.9
type SearchOpts ¶
type SearchResult ¶ added in v0.12.7
type SearchSort ¶ added in v0.14.9
type SearchSort string
const ( SearchSortRelevance SearchSort = "relevance" SearchSortName SearchSort = "name" SearchSortFile SearchSort = "file" SearchSortConnections SearchSort = "connections" SearchSortMatches SearchSort = "matches" )
type SemanticToken ¶ added in v0.14.0
func SemanticTokens ¶ added in v0.14.0
func SemanticTokens(filename string, src []byte) []SemanticToken
SemanticTokens classifies a buffer with the grammar's highlight query. It is syntactic rather than type-aware, but considerably richer and more accurate than lexical colorization when an LSP server is absent.
type SimilarResult ¶
type SymRange ¶ added in v0.12.21
func DocumentHighlights ¶ added in v0.14.0
DocumentHighlights returns syntax-tree identifier occurrences matching the token at the cursor. It deliberately stays file-local: without type and scope information, highlighting same-spelled identifiers in other files would imply a certainty Tree-sitter does not provide.
func FoldingRanges ¶ added in v0.14.0
FoldingRanges returns conservative declaration-level folds. These are less exhaustive than a language server's ranges but stable across all grammars with tags support and never invent folds from indentation alone.
type Symbol ¶ added in v0.12.21
func FileSymbols ¶ added in v0.12.21
FileSymbols extracts a nested outline from a single buffer without touching the index, so unsaved editor content stays accurate.