You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
(however, I'm running gopls built for amd64)
What did you do?
Request completions with gopls at the very end of a document which as a last line of:
}Å
Note that there is no newline at the end.
What did you expect to see?
I expected to get completions referencing a location of 2 on this line
What did you see instead?
Got back completions with locations of 3
This looks like a potential latent character encoding issue, but because these kinds of things are really tricky to work out, so it could end up being an issue on my end. However, I am consistently getting back what I believe are invalid character ranges when a multi-byte (but still single UTF16) character is at the very end of the document. Figured it was worth a report.
The text was updated successfully, but these errors were encountered:
cherrymui
changed the title
incorrect completion ranges for multi-byte character at the end of a document
x/tools/gopls: incorrect completion ranges for multi-byte character at the end of a document
Apr 30, 2021
gopherbot
added
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls
Issues related to the Go language server, gopls.
labels
Apr 30, 2021
Thank you for responding to it so quickly! It was causing me a little grief, because I was using very strict range validation for my application. I would prefer to keep it that way, especially since this is quite the edge-case. Please don't feel pressure to prioritize this any more highly because of my report.
Can I ask, is this only an issue for the last character, or could this come up in other situations too?
This is only an issue for the last character: many of our internal functions don't differentiate between newline-terminated and non-newline-terminated files, so fixing this would require some non-trivial refactoring.
I don't think we can prioritize this now, but we should address it at some point. Thank you for reporting.
What version of Go are you using (
go version
)?go version go1.16.3 darwin/arm64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOHOSTARCH="arm64"
GOHOSTOS="darwin"
(however, I'm running gopls built for amd64)
What did you do?
Request completions with gopls at the very end of a document which as a last line of:
Note that there is no newline at the end.
What did you expect to see?
I expected to get completions referencing a location of 2 on this line
What did you see instead?
Got back completions with locations of 3
This looks like a potential latent character encoding issue, but because these kinds of things are really tricky to work out, so it could end up being an issue on my end. However, I am consistently getting back what I believe are invalid character ranges when a multi-byte (but still single UTF16) character is at the very end of the document. Figured it was worth a report.
The text was updated successfully, but these errors were encountered: