-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: add a regression test for adding a new function to a replace target #40712
Comments
This is actually a known issue which should be resolved at master (https://golang.org/cl/245327). |
Trying with (Installed using the provided command):
It's even worse, it's now not finding the module replaced module at all, complaining with:
While
|
It looks like you're opening the |
Oh wait... Dammit... VS Code opened the folder instead of the workspace file in it... (Maybe I forgot to save the workspace file) It looks like the original problem still persists now that I opened the project under a workspace correctly. Log[Trace - 19:14:02.104 PM] Sending request 'initialize - (0)'. Params: {"processId":76458,"clientInfo":{"name":"vscode","version":"1.47.3"},"rootPath":"/Users/segev/junk/gopls-issue2/foo","rootUri":"file:///Users/segev/junk/gopls-issue2/foo","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"off","workspaceFolders":[{"uri":"file:///Users/segev/junk/gopls-issue2/foo","name":"foo"},{"uri":"file:///Users/segev/junk/gopls-issue2/bar","name":"bar"}]} |
To clarify, how are you adding the |
In that case, I already had the Will try it later. |
Thanks for the clarification. We can certainly add a regression test for that case. |
Still happening with:
|
What version of Go are you using (
go version
)?VS Code version v1.47.3
vscode-go v0.16.1
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
code foo bar
replace github.com/segevfiner/bar => ../bar
to modulefoo
's go.mod.foo
asmain.go
:bar
asbar1.go
:foo.Bar1()
tofoo
'smain.go
, it would work and also auto complete it. (Might need to manually add the import statement)bar
asbar2.go
:foo.Bar2()
tofoo
'smain.go
, it would not autocomplete and will fail to compile until you restart the language server.What did you expect to see?
Adding new files to replaced packages should work seamlessly, auto-completing, compiling correctly, without requiring a restart of the language server.
What did you see instead?
It fails to auto-complete, compile etc. (While working correctly with
go build
) until you restart the language server.The text was updated successfully, but these errors were encountered: