-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
pkg:corepackages/core - indexer, scanner, vectorpackages/core - indexer, scanner, vectortype:featureNew functionalityNew functionality
Description
Summary
Implement core Go language scanner using tree-sitter WASM, establishing reusable infrastructure for future language support.
Background
Part of Epic #128: Go Language Support
Tasks
Tree-sitter Infrastructure
- Add
web-tree-sitterdependency - Add
tree-sitter-goWASM grammar - Create tree-sitter utility module for query execution
- Handle grammar loading and caching
Go Scanner Core
- Implement
GoScannerclass implementingScannerinterface - Extract top-level functions with signatures
- Extract struct definitions
- Extract interface definitions
- Extract type aliases
- Extract exported constants and variables
- Detect exported status (capital letter convention)
Basic Testing
- Unit tests for each extraction type
- Integration test with sample Go files
- Test error handling for malformed Go files
Technical Notes
Dependencies:
{
"web-tree-sitter": "^0.22.x",
"tree-sitter-go": "^0.21.x"
}File Extensions: .go
Scanner Interface:
class GoScanner implements Scanner {
readonly language = "go";
readonly capabilities: ScannerCapabilities = {
syntax: true,
types: true,
documentation: true,
};
canHandle(filePath: string): boolean;
async scan(files: string[], repoRoot: string): Promise<Document[]>;
}Acceptance Criteria
-
GoScannerextracts functions, structs, interfaces, types from.gofiles - Tree-sitter infrastructure is modular and reusable
- Basic test coverage for core extraction
- Scanner can be instantiated and used standalone
References
- Scanner types:
packages/core/src/scanner/types.ts - TypeScript scanner example:
packages/core/src/scanner/typescript.ts
Metadata
Metadata
Assignees
Labels
pkg:corepackages/core - indexer, scanner, vectorpackages/core - indexer, scanner, vectortype:featureNew functionalityNew functionality