Skip to content

Commit e0363f9

Browse files
committed
feat: support cpp merge
1 parent 0f42164 commit e0363f9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lang/collect/export.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,19 @@ func (c *Collector) exportSymbol(repo *uniast.Repository, symbol *DocumentSymbol
464464
// Name: rid.Name,
465465
}
466466
obj.IsMethod = true
467+
468+
if c.Language == uniast.Cpp {
469+
id.ModPath = rid.ModPath
470+
id.PkgPath = rid.PkgPath
471+
if repo.Modules[id.ModPath] == nil {
472+
repo.Modules[id.ModPath] = newModule(id.ModPath, "", c.Language)
473+
}
474+
if repo.Modules[id.ModPath].Packages[id.PkgPath] == nil {
475+
repo.Modules[id.ModPath].Packages[id.PkgPath] = uniast.NewPackage(id.PkgPath)
476+
}
477+
pkg = repo.Modules[id.ModPath].Packages[id.PkgPath]
478+
}
479+
467480
id.Name = rid.Name
468481
// NOTICE: check if the method is a trait method
469482
// if true, type = trait<receiver>

0 commit comments

Comments
 (0)