Documentation
¶
Index ¶
- func FileNode(input Input, language string) graph.Node
- func ModuleName(path string) string
- func ParseTreeSitter(ctx context.Context, p *treesitter.Parser, content []byte) *treesitter.Tree
- func Unquote(text string) string
- func Unsupported(path string) error
- type Builder
- func (b *Builder) AddFact(from string, kind graph.EdgeKind, targetID, target string, ...)
- func (b *Builder) AddNamedSourceFact(source string, sourceKind graph.NodeKind, kind graph.EdgeKind, ...)
- func (b *Builder) AddNode(node graph.Node) string
- func (b *Builder) Declare(parent string, node graph.Node) string
- func (b *Builder) Diagnostic(line int, level, message string)
- func (b *Builder) FileID() string
- func (b *Builder) Finish() graph.ParseResult
- type Input
- type Parser
- type Registry
- func (r *Registry) For(path string) (Parser, bool)
- func (r *Registry) IsSemanticDependency(path string) bool
- func (r *Registry) Languages() []string
- func (r *Registry) SemanticAffectedPaths(root string, paths, changed []string) []string
- func (r *Registry) WorkspaceSemanticEvidenceKeys(ctx context.Context, input Input) (map[string]string, bool, error)
- func (r *Registry) WorkspaceSemanticKeys(ctx context.Context, input Input) (map[string]string, error)
- type SemanticChangeProvider
- type SemanticDependencyProvider
- type SemanticInputProvider
- type SemanticKeyer
- type WorkspaceSemanticEvidenceKeyer
- type WorkspaceSemanticKeyer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModuleName ¶
func ParseTreeSitter ¶
func ParseTreeSitter(ctx context.Context, p *treesitter.Parser, content []byte) *treesitter.Tree
ParseTreeSitter parses UTF-8 source with an already-configured tree-sitter parser and abandons the parse once ctx is done. Tree-sitter has no context aware entry point, so cancellation rides on the progress callback it invokes periodically: returning true there stops parsing and yields a nil tree, which callers must treat as a failed parse rather than an empty file.
func Unsupported ¶
Types ¶
type Builder ¶
type Builder struct {
Input Input
Language string
Result graph.ParseResult
// contains filtered or unexported fields
}
func NewBuilder ¶
func (*Builder) AddNamedSourceFact ¶
func (b *Builder) AddNamedSourceFact(source string, sourceKind graph.NodeKind, kind graph.EdgeKind, targetID, target string, targetKind graph.NodeKind, loc graph.Location, properties map[string]string)
AddNamedSourceFact records an edge whose source declaration is owned by another parse result. Storage resolves the exact source name and optional kind; the parser supplies evidence but never invents the foreign node ID.
func (*Builder) Diagnostic ¶
func (*Builder) Finish ¶
func (b *Builder) Finish() graph.ParseResult
type Input ¶
type Input struct {
Root string
Path string
Content []byte
// SourcePaths is the authoritative repository-relative source membership
// for this indexing run. A nil slice means the caller has no membership
// snapshot and repository-wide parsers must use their deterministic fallback.
SourcePaths []string
Repository string
RepoID string
GoModule string
SemanticKey string
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) IsSemanticDependency ¶
IsSemanticDependency reports whether path is an explicit repository input to any parser's semantic model, even when the parser does not parse that file as a graph source itself.
func (*Registry) SemanticAffectedPaths ¶
func (*Registry) WorkspaceSemanticEvidenceKeys ¶
func (r *Registry) WorkspaceSemanticEvidenceKeys(ctx context.Context, input Input) (map[string]string, bool, error)
WorkspaceSemanticEvidenceKeys returns cheap external/configuration evidence plus whether every workspace semantic key supports safe reuse.
type SemanticChangeProvider ¶
type SemanticChangeProvider interface {
SemanticAffectedPaths(root string, allPaths, changedPaths []string) []string
}
SemanticChangeProvider expands incremental invalidation when a source or configuration edit can change otherwise untouched parser output. Root is the repository root the paths are relative to, so a provider that keeps a per-repository model can look up the right one rather than guess.
type SemanticDependencyProvider ¶
type SemanticDependencyProvider interface {
SemanticDependencies() []string
}
SemanticDependencyProvider identifies repository files whose changes can alter this parser's output for otherwise unchanged source files.
type SemanticInputProvider ¶
SemanticInputProvider recognizes repository files that contribute to a parser's semantic model without necessarily being parsed as graph sources. It covers dynamic dependency names that cannot be expressed as a fixed list.
type SemanticKeyer ¶
SemanticKeyer lets a parser add repository-level configuration to a file's incremental cache key. Parsers that do not depend on such configuration do not need to implement it.
A parser that also implements WorkspaceSemanticKeyer refines that shared key here with the scope-local facts that change how this one file extracts. Callers pass the already computed workspace key as Input.SemanticKey so the repository-wide part is never recomputed per file.
type WorkspaceSemanticEvidenceKeyer ¶
type WorkspaceSemanticEvidenceKeyer interface {
WorkspaceSemanticEvidenceKey(context.Context, Input) (string, error)
}
WorkspaceSemanticEvidenceKeyer provides cheap evidence for semantic inputs outside the repository snapshot. When every workspace keyer implements it, callers may reuse a previously computed workspace key while Git proves all in-repository inputs unchanged and these evidence keys still match.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package calleffect defines the closed, language-neutral vocabulary for repository-declared call effects.
|
Package calleffect defines the closed, language-neutral vocabulary for repository-declared call effects. |
|
Package defaults owns the production parser registry shared by the CLI and deterministic evaluation corpus.
|
Package defaults owns the production parser registry shared by the CLI and deterministic evaluation corpus. |
|
Package godot extracts semantic graph symbols from Godot source formats other than GDScript.
|
Package godot extracts semantic graph symbols from Godot source formats other than GDScript. |
|
godotid
Package godotid is the single source of truth for Godot resource identity and for the project-level declarations that several Godot producers share.
|
Package godotid is the single source of truth for Godot resource identity and for the project-level declarations that several Godot producers share. |
|
Package markdown extracts documentation structure and explicit code references.
|
Package markdown extracts documentation structure and explicit code references. |
|
Package protobuf adapts protobuf source files to Grafo's shared graph model.
|
Package protobuf adapts protobuf source files to Grafo's shared graph model. |
|
Package protobufbinding projects supported generated-language APIs onto canonical Protobuf declarations.
|
Package protobufbinding projects supported generated-language APIs onto canonical Protobuf declarations. |
|
Package sql routes SQL source files to an explicitly selected dialect.
|
Package sql routes SQL source files to an explicitly selected dialect. |
|
sqlite
Package sqlite parses SQLite SQL and extracts schema declarations and relation access.
|
Package sqlite parses SQLite SQL and extracts schema declarations and relation access. |
|
Package transport defines the language-neutral transport extraction contract.
|
Package transport defines the language-neutral transport extraction contract. |