在VSCode中如何搜索已安装的包?

huangapple go评论76阅读模式
英文:

vscode: How to search in installed package?

问题

我想在go-git包中进行搜索。

ctrl+shift+f只在我的模块中搜索。

在VSCode中如何搜索已安装的包?

英文:

I want to search in the go pkg go-git.

ctrl+shift+f searches only in my module.

在VSCode中如何搜索已安装的包?

答案1

得分: 1

可能这不是直接的答案,但这是一个我个人喜欢的解决方法:

在VS Code中,将鼠标悬停在来自外部包的函数上,VS Code会显示godoc描述。通常会有一个指向pkg.go.dev的链接(这个链接是针对PlainClone示例的):

在VSCode中如何搜索已安装的包?

点击链接后,你会直接跳转到GO的包网站。在那里已经有一个很好的模块函数列表。

如果你想深入了解:
在仓库的顶部有一个指向仓库托管站点的链接。

在VSCode中如何搜索已安装的包?

经验表明,这通常是GitHub。虽然GitHub的搜索曾经是被禁止的,但现在它可以成为一个强大的工具:

https://docs.github.com/en/search-github/searching-on-github/searching-code#search-within-a-users-or-organizations-repositories

再次提醒,这是非常主观的,但GO在本地存储模块的复杂方式以及它的许多环境变量等等,让我觉得使用互联网更加方便舒适 =)

英文:

Probably this will not directly answer, but it's an workaround, that I personally prefer:

Hovering over a function, that is from a foreign package, VS Code shows the godoc description. There is always a link to pkg.go.dev (This link is for the PlainClone example):

在VSCode中如何搜索已安装的包?

Following it you are redirected directly to GO's package website.
Here is already a nice list with the module's functions.

if you want to dive deeper:
On the top of the repository there is the link to the repo host.

在VSCode中如何搜索已安装的包?

Experiences show, that this is mostly Github. While GitHub's search used to be proscribed, it can nowadays be a mightful tool:

https://docs.github.com/en/search-github/searching-on-github/searching-code#search-within-a-users-or-organizations-repositories

Again I mention that is very subjective, but GO's complex way of storing modules locally with it's many env variables and stuff made me feel using the internet is more comfortable =)

huangapple
  • 本文由 发表于 2022年7月1日 14:35:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/72825229.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定