Closed
Description
Package span
currently 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 span
itself 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.