-
Notifications
You must be signed in to change notification settings - Fork 791
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: renaming a file breaks code completion when letter capitalization changes #3414
Comments
@hinst , can you close all the files and restart to check if issues persists? |
I got the same problem in my repository, after I try to re-name my folder and package case, half of my file showing case-insensitive import collision, when I trying to switch back to old name, the other half showing the same error, I need to re-init entire mod to fix the problem . |
Having this exact issue. Three other files finally got fixed and are no longer erroring. One file is stuck in this state. I even tried uninstalling/reinstalling go on my windows 11 installation. Have also restarted vscode, my whole pc, renaming the file multiple times, and deleting go.mod+go.sum and reinstalling all packages from scratch, updating go version. The project does build fine. Will probably have to just rename the file to something else thats less descriptive/accurate. |
not the best solution , but you can delete your go.mod and go.sum, rerun |
This happens to me aswell. It makes renaming files very annoying.... |
After testing, this is the best solution to the problem. You can even paste the original |
Same Issue. It's really unbelievable to dismantle the entire project's infrastructure just to rename a file. I found two methods based on the same principle: Method 1:
Method 2:
Both methods clear the workspace cache of incorrect file names, but you'll need to reconfigure your workspace-specific settings and enabled extensions afterward. This finding indicates it's a vscode/vscode-go issue. However, due to limited details from the extension, we can't address the bug directly without examining the source code. As users, our only option is to reset all of the workspace data to its initial state. |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.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 the
go.
or["go"]
orgopls
prefixes.Describe the bug
Renaming golang source file in the project breaks code completion in that file, in cases when only letter capitalization got changed.
Expected behavior: there are no errors
Actual behavior: there are errors
Steps to reproduce the behavior:
main.go
package main
func main() {}
6.
Main.go
7.
maiN.go
8.
application.go
9.
Application.go
10.
aPplication.go
11. ...and so on
Screenshots or recordings
The text was updated successfully, but these errors were encountered: