symbolindex

package module
v0.0.0-...-8e10ec2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatSearchSummary

func FormatSearchSummary(summary SearchSummary) string

FormatSearchSummary renders a SearchSummary in a plain-text format suitable for CLI output.

func Index

func Index(files []SourceFile, opts Options) (Result, []Diagnostic, error)

Index parses caller-provided files and returns a storage-agnostic symbol graph.

Types

type Call

type Call struct {
	CallerID    string
	CalleeID    string
	ContextID   string
	Location    Span
	Candidates  []Candidate
	IsAmbiguous bool
}

Call captures one callable invocation site.

type Candidate

type Candidate struct {
	SymbolID   string
	Confidence float64
}

Candidate is one possible target for an ambiguous link.

type Diagnostic

type Diagnostic struct {
	Level   DiagnosticLevel
	Code    string
	Message string
	Path    string
	Line    int
}

Diagnostic is a non-fatal file or analysis issue.

type DiagnosticLevel

type DiagnosticLevel string

DiagnosticLevel classifies diagnostics emitted during indexing.

const (
	DiagnosticLevelError   DiagnosticLevel = "error"
	DiagnosticLevelWarning DiagnosticLevel = "warning"
)

type Edge

type Edge struct {
	Type      EdgeType
	FromID    string
	ToID      string
	ContextID string
}

Edge connects two symbols with a typed relationship.

type EdgeType

type EdgeType string

EdgeType describes a relationship between two symbols.

const (
	EdgeTypeContains   EdgeType = "contains"
	EdgeTypeDeclares   EdgeType = "declares"
	EdgeTypeReferences EdgeType = "references"
	EdgeTypeCalls      EdgeType = "calls"
	EdgeTypeInherits   EdgeType = "inherits"
	EdgeTypeImplements EdgeType = "implements"
	EdgeTypeImports    EdgeType = "imports"
)

type Language

type Language string

Language identifies the source language for a file or symbol.

const (
	LanguageUnknown Language = "unknown"
	LanguageGo      Language = "go"
	LanguageCSharp  Language = "csharp"
)

type Options

type Options struct {
	LanguageOverrides map[string]Language
	DefaultContextID  string
	IncludeTests      bool
	IncludeGenerated  bool
}

Options controls index behavior.

type Reference

type Reference struct {
	FromID      string
	ToID        string
	ContextID   string
	Location    Span
	Candidates  []Candidate
	IsAmbiguous bool
}

Reference captures one symbol usage site.

type RelevantFile

type RelevantFile struct {
	Path        string
	Symbols     []string
	TextMatches int
}

RelevantFile describes one file in a search summary.

type Result

type Result struct {
	Symbols    []Symbol
	Edges      []Edge
	References []Reference
	Calls      []Call
}

Result is the storage-agnostic index output.

type SearchSummary

type SearchSummary struct {
	Query         string
	RelevantFiles []RelevantFile
	Relationships []SymbolRelationship
}

SearchSummary captures a compact, human-readable view of relevant files and symbol relationships.

func BuildSearchSummary

func BuildSearchSummary(query string, files []SourceFile, index Result) (SearchSummary, error)

BuildSearchSummary builds a report-friendly summary for query-driven symbol exploration.

type SourceFile

type SourceFile struct {
	Path      string
	Content   string
	Language  Language
	ContextID string
}

SourceFile is one caller-provided source unit.

type Span

type Span struct {
	Path      string
	LineStart int
	LineEnd   int
}

Span represents a source location range.

type Symbol

type Symbol struct {
	ID                   string
	StableKey            string
	Language             Language
	Kind                 SymbolKind
	LanguageSpecificKind string
	Name                 string
	FQN                  string
	Signature            string
	ContainerFQN         string
	ContextID            string
	Declarations         []Span
}

Symbol is a canonical symbol record.

type SymbolKind

type SymbolKind string

SymbolKind is a canonical cross-language kind.

const (
	SymbolKindPackage   SymbolKind = "package"
	SymbolKindNamespace SymbolKind = "namespace"
	SymbolKindType      SymbolKind = "type"
	SymbolKindFunction  SymbolKind = "function"
	SymbolKindMethod    SymbolKind = "method"
	SymbolKindProperty  SymbolKind = "property"
	SymbolKindEvent     SymbolKind = "event"
	SymbolKindIndexer   SymbolKind = "indexer"
	SymbolKindField     SymbolKind = "field"
)

type SymbolRelationship

type SymbolRelationship struct {
	From string
	To   string
}

SymbolRelationship captures one directed relationship between symbols.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL