Open distinctdan opened 2 years ago
Thanks for reporting this and providing repro steps. We are probably not correctly invalidating metadata when the file case changes.
I'm experiencing the same issue, but in my case after the restart of VS code the error randomly appears and disappears.
I had this as well. VsCode ended up crashing shortly after by racing to allocate over 30 gigabytes of RAM and going OOM.
The only way I was able to fix the problem was to close VsCode, rename the project folder and the module (go.mod) and then open the project again. That's not a sustainable compromise.
Is there anything better we can do to fix the problem in the meantime? Like, delete a cache or metadata storage that is hidden away somewhere? There are other severe problems caused by this such as save actions chopping away random characters in random places and "go to definition" jumping to completely random symbols.
Got the same issue, still no fix? Why is there no link to this issue within VSCode repo, surely that is the root of the issue?
I tried different solutions including uninstalling the vscode extension but nothing worked until I deleted the file and recreated it (with same name) and pasted the same content.
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Go from the VS Code integrated terminal.go version go1.16.3 darwin/amd64
gopls -v version
to get version of Gopls from the VS Code integrated terminal.Output:
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.zsh: command not found: code
v0.27.1
Go: Locate Configured Go Tools
command.Output:
</details
Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file. Share all the settings with thego.
or["go"]
orgopls
prefixes.Here are my Go and git settings:
Describe the bug
After I changed the casing of the file, VSCode Go has gotten into a bad state and thinks there is a duplicate file. However, the project compiles fine, and only 1 file exists in the filesystem and in git. See the screenshot: if you look at the top, I'm hovering the package name to show the error. I've tried the following steps to fix this:
Clear Editor History
Steps to reproduce the behavior:
emailTemplates.go
toemailtemplates.go
emailTemplates
toemailtemplates
Screenshots or recordings