From e0363f908b91e0d8f5adea2c481098e76b42b5e1 Mon Sep 17 00:00:00 2001 From: "lilong.21" Date: Tue, 31 Mar 2026 15:37:06 +0800 Subject: [PATCH] feat: support cpp merge --- lang/collect/export.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lang/collect/export.go b/lang/collect/export.go index a8f19b2e..6a830d33 100644 --- a/lang/collect/export.go +++ b/lang/collect/export.go @@ -464,6 +464,19 @@ func (c *Collector) exportSymbol(repo *uniast.Repository, symbol *DocumentSymbol // Name: rid.Name, } obj.IsMethod = true + + if c.Language == uniast.Cpp { + id.ModPath = rid.ModPath + id.PkgPath = rid.PkgPath + if repo.Modules[id.ModPath] == nil { + repo.Modules[id.ModPath] = newModule(id.ModPath, "", c.Language) + } + if repo.Modules[id.ModPath].Packages[id.PkgPath] == nil { + repo.Modules[id.ModPath].Packages[id.PkgPath] = uniast.NewPackage(id.PkgPath) + } + pkg = repo.Modules[id.ModPath].Packages[id.PkgPath] + } + id.Name = rid.Name // NOTICE: check if the method is a trait method // if true, type = trait