简体   繁体   English

我可以使用 VSCode 查看外部 Go 库吗?

[英]Can I view external Go libraries with VSCode?

I'd like to switch to using VSCode full time, but the one thing keeping me on IntellijIDEA is its ability to view Go standard and all dependency libraries in External Libraries of project which located in $GOROOT or $GOPATH/pkg/mod on the filesystem.我想改用 VSCode 全职,但让我继续使用 IntellijIDEA 的一件事是它能够查看 Go 标准和项目外部库中的所有依赖库,这些库位于 $GOROOT 或 $GOPATH/pkg/mod 上文件系统。 In particular, I'd like it to work with Go.特别是,我希望它与 Go 一起使用。 As of yet, I've been unable to find a suitable solution to view Go standard and all dependency libraries in the Explorer of VSCode.到目前为止,我还没有找到合适的解决方案来查看 VSCode 资源管理器中的 Go 标准和所有依赖库。

You can do this with a few manual steps if you useWorkspaces .如果您使用Workspaces ,您可以通过几个手动步骤来完成此操作。

Once in a workspace (see link above if unfamiliar with the concept), you can use the GUI ( Add folder to workspace ) or, what I prefer, the integrated terminal (see example below).一旦进入工作区(如果不熟悉该概念,请参见上面的链接),您可以使用 GUI(将文件夹添加到工作区)或者我更喜欢的集成终端(参见下面的示例)。

From the integrated terminal:从集成终端:

$ code --add /path/to/"external library"

and the related library will appear in the explorer.并且相关的库将出现在资源管理器中。

The added paths will be remembered by the workspace on vscode close and restart:-)添加的路径将被 vscode 关闭并重新启动的工作区记住:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM