-
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: automated issue report (crash): file not found for pos = 1 (-) #66790
Comments
A couple things going on here: (1) we should repair the AST in gopls if it records any positions outside of the file, but also (2) I'm not sure go/types should panic here. Simply using the default version seems acceptable. |
Alan points out that this may be related to #66683. @nobelsmith can you share anything about the structure of the code you were editing when this occurred? |
This error I was doing work on a fiber api, but it was the first time I was trying live server within vs code with another dev. Running live server is the only thing that was out of the ordinary for me otherwise just go installed through brew and working in vscode. @findleyr |
There are two problems here:
For example:
I was hoping we can repair the tree to achieve these invariants: But I'm not so sure it's feasible. A consequence of (a) is that all computed End positions must be more careful not to report the suffix of fake tokens. For example, given |
To answer @hyangah questions from the duplicate ticket I opened.
Yes, I was hosting the remote session in vscode insiders and this is the crash/stack that automatically opened on my machine.
I'll try it out next week and see. We saw the crash a couple of times in about 2 hours so we'll have to see how lucky we are. |
Realistically, any fix for this will involve changes to go/ast, go/parser, and go/types, which are in the pre-go1.23 freeze right now. Pushing this off to gopls 0.17, assuming the tree opens by then. |
gopls version: v0.15.2/go1.22.1
gopls flags:
update flags: proxy
extension version: 0.41.2
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Fri, 05 Apr 2024 20:02:00 GMT
restart history:
Thu, 04 Apr 2024 19:08:50 GMT: activation (enabled: true)
Fri, 05 Apr 2024 17:57:26 GMT: manual (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
gopls stats -anon
{ "DirStats": { "Files": 805, "TestdataFiles": 0, "GoFiles": 41, "ModFiles": 1, "Dirs": 322 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.1", "GoplsVersion": "v0.15.2", "InitialWorkspaceLoadDuration": "708.152041ms", "MemStats": { "HeapAlloc": 33689896, "HeapInUse": 51576832, "TotalAlloc": 551701312 }, "WorkspaceStats": { "Files": { "Total": 1850, "Largest": 935931, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.1", "AllPackages": { "Packages": 307, "LargestPackage": 155, "CompiledGoFiles": 1846, "Modules": 42 }, "WorkspacePackages": { "Packages": 16, "LargestPackage": 12, "CompiledGoFiles": 41, "Modules": 1 }, "Diagnostics": 1 } ] } }OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.
NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.
<OPTIONAL: ATTACH LOGS HERE>
The text was updated successfully, but these errors were encountered: