Documentation
¶
Index ¶
- Constants
- func ExtractSymbolInfo(symbolID string) (symbolType, name, file string, line, column int, err error)
- func GetEntityType(entityID string) string
- func IsValidEntityID(entityID string) bool
- func NormalizeSymbolType(symbolType string) string
- func ParseEntityID(entityID string) (entityType, identifier, location string, err error)
- type EntityIDGenerator
- func (g *EntityIDGenerator) GetCallsiteID(symbolName, file string, line, column int) string
- func (g *EntityIDGenerator) GetFileID(absPath string) string
- func (g *EntityIDGenerator) GetModuleID(name, absPath string) string
- func (g *EntityIDGenerator) GetReferenceID(refType, symbolID, file string, line, column int) string
- func (g *EntityIDGenerator) GetSymbolID(symbolType, name, file string, line, column int) string
- func (g *EntityIDGenerator) GetUsageID(symbolName, file string, line, column int) string
Constants ¶
const ( EntityTypeModule = "module" EntityTypeFile = "file" EntityTypeSymbol = "symbol" EntityTypeReference = "reference" // Symbol subtypes SymbolTypeFunction = "func" SymbolTypeMethod = "method" SymbolTypeStruct = "struct" SymbolTypeInterface = "interface" SymbolTypeVariable = "var" SymbolTypeConstant = "const" SymbolTypeEnum = "enum" SymbolTypeType = "type" // Reference subtypes ReferenceTypeCall = "call" ReferenceTypeUse = "use" ReferenceTypeImpl = "impl" ReferenceTypeOverride = "override" )
EntityType constants for consistent usage
Variables ¶
This section is empty.
Functions ¶
func ExtractSymbolInfo ¶
func ExtractSymbolInfo(symbolID string) (symbolType, name, file string, line, column int, err error)
ExtractSymbolInfo extracts symbol information from a symbol ID
func GetEntityType ¶
GetEntityType extracts the entity type from an ID
func IsValidEntityID ¶
IsValidEntityID validates an entity ID format
func NormalizeSymbolType ¶
NormalizeSymbolType converts a symbol type string to entity ID format. This provides a single source of truth for symbol type normalization. Returns empty string for unknown/invalid types.
This function ensures consistency between the types package EntityID methods and the tools package EntityIDGenerator.
func ParseEntityID ¶
ParseEntityID extracts components from an entity ID
Types ¶
type EntityIDGenerator ¶
type EntityIDGenerator struct {
// contains filtered or unexported fields
}
EntityIDGenerator creates stable, reproducible entity IDs for all code entities Format: {entity_type}:{identifier}:{location_info}
func NewEntityIDGenerator ¶
func NewEntityIDGenerator(rootPath string) *EntityIDGenerator
NewEntityIDGenerator creates a new ID generator with the repository root path
func (*EntityIDGenerator) GetCallsiteID ¶
func (g *EntityIDGenerator) GetCallsiteID(symbolName, file string, line, column int) string
GetCallsiteID creates a callsite ID: reference:call_<symbol_name>:<file>:<line>:<column>
func (*EntityIDGenerator) GetFileID ¶
func (g *EntityIDGenerator) GetFileID(absPath string) string
GetFileID creates a file ID: file:<filename>:<relative_path>
func (*EntityIDGenerator) GetModuleID ¶
func (g *EntityIDGenerator) GetModuleID(name, absPath string) string
GetModuleID creates a module ID: module:<name>:<relative_path>
func (*EntityIDGenerator) GetReferenceID ¶
func (g *EntityIDGenerator) GetReferenceID(refType, symbolID, file string, line, column int) string
GetReferenceID creates a reference ID: reference:<type>_<symbol_id>:<file>:<line>:<column>
func (*EntityIDGenerator) GetSymbolID ¶
func (g *EntityIDGenerator) GetSymbolID(symbolType, name, file string, line, column int) string
GetSymbolID creates a symbol ID based on symbol type: symbol:<type>_<name>:<file>:<line>:<column>
func (*EntityIDGenerator) GetUsageID ¶
func (g *EntityIDGenerator) GetUsageID(symbolName, file string, line, column int) string
GetUsageID creates a usage ID: reference:use_<symbol_name>:<file>:<line>:<column>