-
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: handle line directives to .y files #34433
Comments
Thanks for reporting this. Looks like we aren't correctly handling code with line directives. This will require some work, but we can at least prevent the crash from occurring. |
Change https://golang.org/cl/196662 mentions this issue: |
This might not be necessary after we fix handling for line directives, but it's always better to avoid the panic here. Updates golang/go#34433 Change-Id: Ica4fb571dff6753fb15bf8d397c55f713284aa27 Reviewed-on: https://go-review.googlesource.com/c/tools/+/196662 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
This might not be necessary after we fix handling for line directives, but it's always better to avoid the panic here. Updates golang/go#34433 Change-Id: Ica4fb571dff6753fb15bf8d397c55f713284aa27 Reviewed-on: https://go-review.googlesource.com/c/tools/+/196662 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
The work I'm doing for #35720 is a good start on this one, but we're not tracking .y files so I don't think it'll actually fix it. We'd have to be able to get a ColumnMapper for an arbitrary non-Go file. |
Change https://golang.org/cl/227770 mentions this issue: |
A nil pointer was reported to the golang-tools group (see https://groups.google.com/g/golang-tools/c/JrNTz8I6ifo/m/tcJRpek-AAAJ). I think this bounds check should address it. Updates golang/go#34433 Change-Id: I87352c269c65c844c86ebe9ee3fd2d041cc49ee9 Reviewed-on: https://go-review.googlesource.com/c/tools/+/227770 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
This no longer crashes, instead writing an error message Failed to compute document links: must supply Converter for file ".../foof.go" containing lines from ".../expr.y" My personal opinion is that it will be almost impossible to get //line processing right, although maybe a few special cases could be done (after 1.0 is released). |
I agree that handling line directives is not a critical priority for v1.0. Moving this out of the 1.0 milestone. |
What version of Go are you using (
go version
)?go version go1.13 linux/amd64
And gopls...
golang.org/x/tools/gopls v0.1.7
golang.org/x/tools/gopls@v0.1.7 h1:YwKf8t9h69++qCtVmc2q6fVuetFXmmu9LKoPMYLZid4=
Does this issue reproduce with the latest release?
Yes
What did you do?
Open https://play.golang.org/p/-QfVqDKxsFI in VSCode.
What did you expect to see?
No crashing.
What did you see instead?
"The gopls server crashed 5 times in the last 3 minutes. The server will not be restarted."
The text was updated successfully, but these errors were encountered: