New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: doesn't handle replace directive #40836
Comments
Can you please provide the |
@stamblerre I can not post logs of my private project. But I have completed some investigation for this issue. Primary, I have a big workspace for over 10 repos. Some of them is not yet updated to the latest dependencies versions and gopls logs contains errors just the same as |
gopls currently requires that each workspace folder be in a single module. If you're opening a directory that contains multiple modules, you will see strange results like those you're describing. Instead, you can use the Add Folder to Workspace option in VS Code to add new folders that each are in a single module. |
@heschik I know. In my case, I worked only on "main" module inside the multi-module repo. The code of sub-module was updated before by adding it folder as workspace root. After updating was done the sub-module root was removed from workspace. |
OK. In that case I'm not sure what the problem is, and without logs it's going to be difficult to investigate any further. If you can put together a reproducer we'll be happy to take a look. |
Closing as this is in the WaitingForInfo state and |
go version go1.15 windows/amd64
Version: 1.48.0 (user setup)
Commit: db40434f562994116e5b21c24015a2e40b2504e6
Date: 2020-08-13T07:50:42.600Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041
Go extension 0.16.1
gopls version
I have a project with sub-module. The main repo contains api folder, so the main go.mod contain
replace
directive like:And I can not understand several things how to make extension to work as expected:
If I do not fix the api version manually, the go-command makes it version v0.0.0-00010101000000-000000000000, after
go mod tidy
. But vscode-go despite ofreplace
and "special" module version value, opens old api-version references (ctrl+click) from globalpkg/mod/
folder. Restarting the language server does not help to force using local api-folder.If I run
go get -u
in module context to update api to latest available version (v0.2.0-pre
in my case) then the go.mod file is properly modified. BUT vscode-go continue to use old module version which is not required and is not exists in go.mod. Restarting the gopls, reloading vscode does not help - an older version of api-module is opened by ctrl+click on api-references.What do I need to do to force extension work in this simple case? Who of them the vscode-go OR the gopls is ignoring the replace-directive?
The text was updated successfully, but these errors were encountered: