Documentation
¶
Overview ¶
Package extractor defines the interface for language-specific import extraction.
Index ¶
Constants ¶
const MaxSignatureLength = 120
MaxSignatureLength is the maximum length for a signature string before truncation.
Variables ¶
This section is empty.
Functions ¶
func BuildNameSet ¶
BuildNameSet creates a lookup set from a list of symbol names. Returns nil if symbolNames is empty.
func TrimBodyOpener ¶
TrimBodyOpener removes the opening brace " {" from the end of a signature line. Uses substring matching (not character set) to avoid stripping valid trailing characters.
func TruncateSig ¶
TruncateSig truncates a signature string to maxLen, appending "..." if truncated.
Types ¶
type DefinitionExtractor ¶
type DefinitionExtractor interface {
// ExtractDefinitions returns signature strings for the given symbol names
// found in the file content. Only the signature line is returned (not the body).
ExtractDefinitions(content []byte, symbolNames []string) []string
}
DefinitionExtractor extracts code signatures (function/class/type definitions) for named symbols. Extractors that also implement this interface can provide symbol definitions for the --signatures feature.
type Extractor ¶
type Extractor interface {
// Language returns the language this extractor handles (e.g., "python").
Language() string
// Extensions returns file extensions this extractor handles (e.g., [".py"]).
Extensions() []string
// Extract parses a file and returns all import facts.
Extract(filePath string, content []byte) ([]model.ImportFact, error)
// Clone returns a new independent instance for concurrent use.
Clone() Extractor
}
Extractor extracts import facts from a source file.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package golang implements import extraction for Go source files.
|
Package golang implements import extraction for Go source files. |
|
Package java implements import extraction for Java source files.
|
Package java implements import extraction for Java source files. |
|
Package python implements import extraction for Python source files.
|
Package python implements import extraction for Python source files. |
|
Package rust implements import extraction for Rust source files.
|
Package rust implements import extraction for Rust source files. |
|
Package typescript implements import extraction for TypeScript and JavaScript source files.
|
Package typescript implements import extraction for TypeScript and JavaScript source files. |