You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When working with go code, it is quite common to import packages by path, however I found there were no quick way to do this. I must go to the dir of the package I want to import, copy it's relative path, and concatenate that with the go module path to form a package path. It's just so painful how many times I needed to do this, and it's also too ineffective!
Describe the solution you'd like
Add a quick action in vscode-go plugin to copy the go package path with one click.
Describe alternatives you've considered
As described above, previously I manually concatenate strings together.
Additional context
I actually have made a vscode plugin that already does this, want to check here if it is generally needed by the community. If so, we may add it to vscode-go.
Good to develop and share the extension. I think it's good to have it a separate extension.
Ideally, users shouldn't worry about imports - users just start to use the package, and the language server should be able to auto-import the package (especially those already in the workspace). For example, in the following example, I didn't import counter package yet, but the language server recognizes the package and includes suggestions based on the API of the package. As I accept one of them, the language server provides the extra edit for the import block. This is the workflow we want to support.
We understand that currently some bugs in package imports sometimes prevent this ideal workflow. The gopls team is actively working on fixing and improving the import logic.
Is your feature request related to a problem? Please describe.
When working with go code, it is quite common to import packages by path, however I found there were no quick way to do this. I must go to the dir of the package I want to import, copy it's relative path, and concatenate that with the go module path to form a package path. It's just so painful how many times I needed to do this, and it's also too ineffective!
Describe the solution you'd like
Add a quick action in vscode-go plugin to copy the go package path with one click.
Describe alternatives you've considered
As described above, previously I manually concatenate strings together.
Additional context
I actually have made a vscode plugin that already does this, want to check here if it is generally needed by the community. If so, we may add it to vscode-go.
Step 1: copy
Step 2: paste
The repository is at https://github.com/xhd2015/VSCode-Ext-Copy-Go-Package-Path .
I'll later propose a PR for reviewing purpose.
Thanks.
The text was updated successfully, but these errors were encountered: