Documentation
¶
Overview ¶
Package parser is Atlas's multi-language code parser. It extracts symbols (functions, methods, types, classes, ...), import edges, and — the keystone Atlas adds over the pulse engine it is ported from — symbol-granular CALL edges that name the enclosing (caller) symbol and the callee reference.
Go is parsed with the native go/parser for compiler-grade fidelity; every other supported language (python, javascript, typescript, java, c, cpp) is parsed with tree-sitter.
Ported and adapted from the original parser service:
- tree_sitter_parser.go (walk*AST / extract*Import)
- code_intelligence_service.go (parseGoFile, parseGoCallEdges, parseTextCallEdges, parseCodeFile, languageForPath, symbolLeadingComments, symbolBodyExcerpts)
Atlas additions over pulse: stable line-independent NodeID (ComputeNodeID), first-class graph.DependencyEdge call/import edges, doc/signature population.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeNodeID ¶
ComputeNodeID derives a content-stable identity for a symbol node. It is the sha256 hex of repoFullName|path|kind|name|signature and — deliberately — does NOT include line numbers, so a symbol keeps the same NodeID across snapshots even when surrounding edits shift its position. This stability is what lets the temporal diff layer compute set differences between snapshots.
func IsDocumentFormat ¶
IsDocumentFormat reports whether a language is one of the binary document formats. The index walk uses this to apply a larger size ceiling — these files carry embedded media so they dwarf the source-file cap, yet only their (small) XML text is read.
func LanguageForPath ¶
LanguageForPath maps a file path to its parser language, or "" when the extension is not one of the supported tree-sitter / native grammars.
Types ¶
type Result ¶
type Result struct {
Symbols []graph.CodeSymbol
Edges []graph.DependencyEdge
Imports []string
}
Result is the parse output for a single file.
func Parse ¶
Parse extracts symbols, import edges, and symbol-granular call edges from a single source file. repoFullName feeds the stable NodeID; repoID stamps each symbol's RepoID. SnapshotID is left empty here — the index layer assigns it when persisting (symbols/edges are snapshot-scoped at save time).
Source Files
¶
- apex_native.go
- astro_native.go
- bash_native.go
- blade_native.go
- byond_native.go
- calls.go
- calls_cpp.go
- calls_java.go
- calls_javascript.go
- calls_python.go
- dart_native.go
- delphi_native.go
- documents.go
- dotnet_native.go
- ejs_native.go
- elixir_native.go
- ets_native.go
- fortran_native.go
- go_parser.go
- groovy_native.go
- helpers.go
- images.go
- julia_native.go
- lightweight.go
- objc_native.go
- p4_native.go
- parser.go
- pascal_native.go
- pdf.go
- powershell_native.go
- r_native.go
- razor_native.go
- sql_native.go
- svelte_native.go
- tagsquery.go
- tagsregistry.go
- terraform_native.go
- treesitter.go
- verilog_native.go
- vue_native.go