vscode-go
vscode-go copied to clipboard
commands: improve "Go: Add Package to Workspace" in module mode
See the discussion on https://github.com/microsoft/vscode-go/issues/3195. We should improve the error reporting for this command and consider alternative ways for how this could work in module mode.
Are there any updates? This would be very convenient to view the source code of packages imported. Especially when I have to search within imported packages, now I have to launch a new window or use the integrated terminal.
We discussed this in our triage meeting triage. It's a little unclear how to make this work: imported packages could be in GOCACHE.
@simon0-o how would you like this feature to behave, particularly if the package is in the module cache?
@findleyr How bad can it be if we add the folders in the module cache as workspace folders? I think that can help https://github.com/golang/vscode-go/issues/2080 (ability to search code in dependency) or https://stackoverflow.com/questions/71523201/how-to-view-external-go-module-dependencies-in-vscode.
I don't want though those folders to be diagnosed or cause to bloat gopls's memory usage footprint too much, etc
even though I appreciate analysis like reference, implemented-by, go-to-definition, documentation, ...
And, some modules in the module cache may not have go.mod
file (the implicit module the go command creates to handle pre-module-time packages)
Does current gopls's data model (Session/View) handle this use case - folders in the workspace are not independent?