@@ -22,6 +22,8 @@ import (
2222 "path/filepath"
2323 "strconv"
2424 "strings"
25+
26+ "github.com/cloudwego/abcoder/version"
2527)
2628
2729type Language string
@@ -83,11 +85,14 @@ type NodeGraph map[string]*Node
8385
8486// Repository
8587type Repository struct {
88+ // ASTVersion is 'ABCoder Specification Version'
8689 ASTVersion string
87- Name string `json:"id"` // module name
88- Path string // repo path
89- Modules map [string ]* Module // module name => module
90- Graph NodeGraph // node id => node
90+ // ABCoderToolVersion is 'ABCoder Tool Version'
91+ ABCoderToolVersion string
92+ Name string `json:"id"` // module name
93+ Path string // repo path
94+ Modules map [string ]* Module // module name => module
95+ Graph NodeGraph // node id => node
9196}
9297
9398func (r Repository ) ID () string {
@@ -107,11 +112,12 @@ func (r Repository) InternalModules() []*Module {
107112// NOTICE: Repository.Path is set as name by default, if th name isn't a path, set path somewhere
108113func NewRepository (name string ) Repository {
109114 ret := Repository {
110- Name : name ,
111- Path : name ,
112- Modules : map [string ]* Module {},
113- Graph : map [string ]* Node {},
114- ASTVersion : Version ,
115+ Name : name ,
116+ Path : name ,
117+ Modules : map [string ]* Module {},
118+ Graph : map [string ]* Node {},
119+ ASTVersion : ABCoderSpecificationVersion ,
120+ ABCoderToolVersion : version .ABCoderToolVersion ,
115121 }
116122 return ret
117123}
0 commit comments