-
Notifications
You must be signed in to change notification settings - Fork 645
Compilation and intellisense for elsewhere declared variables and functions no longer works after a recent update. #2905
Comments
Please share any Go related settings you might have added/edited. You can get these by running the command |
You mentioned that the problem appears only after the recent update. Did you mean recent update of the extension or any of the Go tools? You can get the older versions of the extensions from https://github.com/microsoft/vscode-go/releases
|
I do not understand your reaction. |
here below the requested content of settings.json { |
@StephanVerbeeck: It looks like you are using Are you using Go modules or GOPATH mode? If you are using modules, make sure to open VS Code at the root of the module (the file containing the If none of this fixes the issue, please attach your |
I have temporarily bypassed the problem by not using gopls anymore. -> https://github.com/golang/tools/blob/master/gopls/doc/user.md |
Did not work for me. Intellisense still says "loading ...", go-lint not being picked up on saves, and I have this message: |
This might help ... |
I do not use .mod files. The sources are in the same project because they are in the same directory. That is exactly the beauty of GO (not having to deal with make files and such) |
I can help investigate @KBassford: You mentioned Gopkg files above, but you are also using modules? I would imagine that this might be related to the difficulties you encountered above. |
I generated both for backwards compatibility. I also have vendor folder as well. |
@KBassford: Replied on #2913. I think golang/go#31999 covers handling the types of issues that you encountered. |
This issue has been closed automatically because it needs more information and has not had recent activity. Thank you for your contributions. |
After [open folder] to edit a golang project directory: Variables and functions declare in another *.go source (with the same package in the same directory) are shown as compilation error "undeclared name: ___".
Resulting in +600 "so called" compilation errors while the same unchanged project compiled perfectly before the recent update.
[F12] (goto definition) is also not working because of this
Compilation is only possible by running "go build" in the terminal window or external command shell.
Version: 1.40.1 (user setup)
Commit: 8795a9889db74563ddd43eb0a897a2384129a619
Date: 2019-11-13T16:49:35.976Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18362
expected behavior: variables and functions defined in other *.go sources that are in the same directory and are also "package main" should be visible to the compiler and to intellisense.
Declarations in these other sources should have the same effect as a declaration in the currently being edited *.go source that is also "package main"
The text was updated successfully, but these errors were encountered: