go - 在 VS Code (Golang) 中查找符号的所有引用返回 0 结果

标签 go visual-studio-code

想知道是否有人得到 find all references使用 Golang 为 VS Code 工作。

使用 VS 代码版本:1.23.1 .

似乎它具有所需的所有必要扩展,例如(go-langserver,guru)。尽管如此,find all references不返回任何结果。

最佳答案

我对带有模块的项目(在 GOPATH 之外)有同样的问题。
guru不支持模块。

(见:https://github.com/golang/go/issues/24661)

安装后gopls并通过设置 go.useLanguageServer 在 VS Code 中启用它find all references确实又工作了。

(VS Code Go 扩展默认不使用 gopls。)

见:https://github.com/golang/vscode-go#language-server

关于go - 在 VS Code (Golang) 中查找符号的所有引用返回 0 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58668035/

相关文章:

go - 在 golang 中获取发布请求失败

golang 应用程序的 Docker 临时图像找不到二进制 "no such file or directory"

reflection - 使用 gorm 库进行反射(reflect)

c++ - 无法在 VS 代码中使用 gcc 查看 std::vector 的元素

javascript - 使用 Beautify.js 在 VSCode 中导入和导出行间距

c - 在 vs code 中哪里添加 -g 标志以进行调试

git - 是否有可能 git diff 等同于 go-git

go - 在 for 循环中使用 int64 作为迭代器

visual-studio-code - 在 Visual Studio Code 上保存后如何保留撤消历史记录

c++ - 使用 LLDB 检查 VSCode 中的 C++ std::set