# Clip invalid edits from LSP instead of reporting an error · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/45eb0e788986a988392f6044ca80b496225babdf)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 45eb0e788986a988392f6044ca80b496225babdf

Requested commit: 45eb0e788986a988392f6044ca80b496225babdf

Commit: 45eb0e788986a988392f6044ca80b496225babdf

Tree: 3c1ddccacf6a264bb85320fc54199704005e00a6

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Clip invalid edits from LSP instead of reporting an error

This fixes an issue with the Go language server, which reports invalid
formatting ranges when there's a missing newline at the end of the file.
Specifically, if the buffer is `N` lines long, it will try to insert the
newline at `Point(N + 1, 0)`.

I confirmed the behavior is the same in VS Code, and they indeed clip the
LSP ranges as well.

```

## Parents

- [9cefeb08e1c3650e7c81150b6ffb4569345f1ba8](https://git.cafe/gitcafe/zed/commit/9cefeb08e1c3650e7c81150b6ffb4569345f1ba8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/45eb0e788986a988392f6044ca80b496225babdf?format=markdown)
