/ go Public
x/tools/gopls: fix handling of end of file in internal/span #41029
Issues related to the Go language server, gopls.
Feedback is required from experts, contributors, and/or the community before a change can be made.
This label describes issues relating to any tools in the x/tools repository.
spancurrently treats end of file as start of a new line (https://github.com/golang/tools/blob/c024452afbcdebb4a0fbe1bb0eaea0d2dbff835b/internal/span/token.go#L117), which is inaccurate for files with end of file not being a newline. This affects completion on end of file line and we're currently considering a temporary fix there (https://go-review.googlesource.com/c/tools/+/249706). A better fix should come from
spanitself and the package should check if a final new line is present before converting end of file to start of new line. Just removing this check breaks diff tests and is not a viable fix currently.
The text was updated successfully, but these errors were encountered: