-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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: off-by-one in diagnostic results? #35116
Comments
This is likely caused by CL 202542, which probably needs some more review. I will take a look at this soon. |
The second concern will be addressed in the fix for #35139. The issue with the |
With reference to the
to:
FWIW the compiler reports:
So it seems that previously Regarding the function example, I mentioned in CL 203287:
i.e. that the error diagnostic should (in this case) be a zero length diagnostic with a start position where the user can do something to fix it, i.e. just before the final Regarding the following:
CL 202542 caused the position of the returned error to change the returned range from:
to:
But I think the intent of that CL was to in effect "select" the
|
This was fixed in https://go-review.googlesource.com/c/tools/+/204561 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
These might be intentional changes, in which case these issues are just to clarify the changes.
The following file:
results in the following diagnostic:
That's the LSP line reference, which human terms is line 4, position 1. But there is no line 4.
Also the following file:
results in the following diagnostic:
This diagnostic has a start position of the
{
of the function, which I don't think is right? Should this be a zero length diagnostic at the closing}
?What did you expect to see?
Per above
What did you see instead?
Per above
cc @stamblerre
The text was updated successfully, but these errors were encountered: