vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

commands: improve "Go: Add Package to Workspace" in module mode

Open stamblerre opened this issue 4 years ago • 3 comments

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.

stamblerre avatar Jun 03 '20 21:06 stamblerre

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.

simon0-o avatar Jan 19 '22 09:01 simon0-o

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 avatar Feb 07 '22 14:02 findleyr

@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?

hyangah avatar Mar 25 '22 19:03 hyangah