Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/lsp: fix formatting bug that keeps adding extra newlines
If a file ends with an empty newline, go/token treats the newline as the final character of the previous line. VSCode, however, treats this as a final line with no characters. We handle this by determining if the file we are formatting ends with a newline character and updating the protocol ranges accordingly. Change-Id: Id8be0fd776ae65c8f0f937f3e718825e407cb217 Reviewed-on: https://go-review.googlesource.com/c/150338 Reviewed-by: Ian Cottrell <[email protected]> Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
- Loading branch information