# Fix ESLint linebreak-style errors by preserving line endings in LSP communication \(\#38773\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 435eab68968fa11f8a476c78845b13df45498f25

Requested commit: 435eab68968fa11f8a476c78845b13df45498f25

Commit: 435eab68968fa11f8a476c78845b13df45498f25

Tree: 4b0a7ff0662aaa39274c78edfc7d63fa425695f2

Author: Devdatta Talele

Committer: GitHub

## Message

```
Fix ESLint linebreak-style errors by preserving line endings in LSP communication (#38773)

Closes https://github.com/zed-industries/zed/issues/38453

Current `Buffer` API only allows getting buffer text with `\n` line
breaks — even if the `\r\n` was used in the original file's text.

This it not correct in certain cases like LSP formatting, where language
servers need to have original document context for e.g. formatting
purposes.

Added new `Buffer` API, replaced all buffer LSP registration places with
the new one and added more tests.

Release Notes: 

- Fixed ESLint linebreak-style errors by preserving line endings in LSP
communication

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
```

## Parents

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

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