@@ -48,8 +48,8 @@ func (c *Collector) fileLine(loc Location) uniast.FileLine {
48
48
}
49
49
}
50
50
51
- func newModule (name string , dir string ) * uniast.Module {
52
- ret := uniast .NewModule (name , dir , uniast . Rust )
51
+ func newModule (name string , dir string , lang uniast. Language ) * uniast.Module {
52
+ ret := uniast .NewModule (name , dir , lang )
53
53
return ret
54
54
}
55
55
@@ -67,7 +67,7 @@ func (c *Collector) Export(ctx context.Context) (*uniast.Repository, error) {
67
67
if err != nil {
68
68
return nil , err
69
69
}
70
- repo .Modules [name ] = newModule (name , rel )
70
+ repo .Modules [name ] = newModule (name , rel , c . Language )
71
71
}
72
72
73
73
// not allow local symbols inside another symbol
@@ -83,11 +83,13 @@ func (c *Collector) Export(ctx context.Context) (*uniast.Repository, error) {
83
83
}
84
84
85
85
// patch module
86
- for p , m := range repo .Modules {
87
- if p == "" || strings .Contains (p , "@" ) {
88
- continue
86
+ if c .modPatcher != nil {
87
+ for p , m := range repo .Modules {
88
+ if p == "" || strings .Contains (p , "@" ) {
89
+ continue
90
+ }
91
+ c .modPatcher .Patch (m )
89
92
}
90
- c .modPatcher .Patch (m )
91
93
}
92
94
93
95
return & repo , nil
@@ -140,7 +142,7 @@ func (c *Collector) exportSymbol(repo *uniast.Repository, symbol *DocumentSymbol
140
142
}
141
143
142
144
if repo .Modules [mod ] == nil {
143
- repo .Modules [mod ] = newModule (mod , "" )
145
+ repo .Modules [mod ] = newModule (mod , "" , c . Language )
144
146
}
145
147
module := repo .Modules [mod ]
146
148
if repo .Modules [mod ].Packages [path ] == nil {
0 commit comments