We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 683a2f7 commit 6690b4dCopy full SHA for 6690b4d
1 file changed
lang/golang/parser/ctx.go
@@ -146,6 +146,15 @@ func (ctx *fileContext) GetMod(impt string) (string, error) {
146
if ims == impt {
147
return ctx.module.Name, nil
148
}
149
+ // fileContext 中的 import 信息只有**当前文件的引用路径**,但是存在一种场景就是实际调用的节点在另外的一个Package,导致漏解析
150
+ // 常见于"链式调用"、"另一个 pkg 的全局变量的类型在另外一个 pkg下"
151
+ if dep, exist := ctx.deps[ims]; exist {
152
+ for pkgName, _ := range dep.Imports {
153
+ if pkgName == impt {
154
+ return ctx.module.Name, nil
155
+ }
156
157
158
159
for _, ims := range ctx.imports.ThirdPartyImports {
160
if ims[1] == impt {
0 commit comments