Skip to content

feat: Go Language Support for Axon #45

@ajeetrix

Description

@ajeetrix

Feature

Go Language Support for Axon

Proposed Solution

The Go parser will utilize tree-sitter-go to
extract the following constructs:

  1. Core Symbols:
    • function_declaration → FUNCTION
    • method_declaration → METHOD (associated with receiver type)
    • type_spec (struct) → CLASS
    • type_spec (interface) → INTERFACE
    • type_spec (other) → TYPE_ALIAS
  2. Heritage (Embedding & Implementation):
    • Struct Embedding: Extract anonymous fields in structs as EXTENDS relationships (e.g., type B struct { A } → (B, "extends", "A")). Because ofcourse go supports composition instead of inheritance
    • Interface Embedding: Extract embedded interfaces as EXTENDS relationships.
    • Interface Implementation: While Go is implicit, we will extract explicit type references that suggest intended implementation where possible, though the core focus is structural embedding which maps directly to Axon's heritage model.
  3. Type References (TypeRef):
    • Extraction of parameter and return types for functions/methods to enable cross-file type-aware search and coupling analysis.
  4. Imports: Support for both single and grouped imports, including handling of aliases and module paths.
  5. Call Expressions: Extraction of standard function calls and selector expressions (method calls).
  6. Exported Symbols: Automatic identification of public symbols based on Go's casing rules (Uppercase = Exported).

Scope

This would touch codebases related to parsers module, ingestion, add test cases as well. This new tree-sitter-go will be added to toml file and hence be utilised using that.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions