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
There's is a module inside the repository, which is github.com/kidlj/pki-example/demo.
When open the module directory with vscode, which is demo, it works fine.
$ code ~/Code/pki-example/demo
Instead if I open the upper directory, which is pki-example, gopls fails everything.
$ code ~/Code/pki-example
In the second case, gopls logs:
[Error - 2:08:41 AM] Request textDocument/codeAction failed.
Message: no file information for file:///Users/mellon/Code/pki-example/demo/main.go
Code: 0
What did you expect to see?
gopls works with vscode.
What did you see instead?
vscode 'Go To Definition' fails.
The text was updated successfully, but these errors were encountered:
This is working as intended, you need to add any module directories you are using by hand as workspace directories in your vscode project. Until you do, the module is not visible to gopls, even if the files are, and thus it cannot analyze any of the code.
This is not something that gopls can fix, but it is possible in the future that the vscode go extension could either add the directories for you.
@ianthehat do you mean adding directories using Go modules under the "folders" property in the workspace settings JSON file? Because I did this and it's still not working for me.
[Error - 3:16:57 PM] Request textDocument/hover failed.
Message: no file information for file:///Users/dextermiguel/Documents/dev/ss/k2/cmd/lambda/survey-ingest-legacy/survey-ingest-legacy.go
Code: 0
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
What did you do?
Open demo code: https://github.com/kidlj/pki-example in vscode with the latest 0.9.3-beta.7 vscode-go extension and gopls language server on.
There's is a module inside the repository, which is
github.com/kidlj/pki-example/demo
.When open the module directory with vscode, which is
demo
, it works fine.Instead if I open the upper directory, which is
pki-example
, gopls fails everything.In the second case, gopls logs:
What did you expect to see?
gopls works with vscode.
What did you see instead?
vscode 'Go To Definition' fails.
The text was updated successfully, but these errors were encountered: