# Normalize ranges returned by language servers in more cases \(\#63372\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a61e2609c18d459a8f236cbbd0ce5a04a06d28da

Requested commit: a61e2609c18d459a8f236cbbd0ce5a04a06d28da

Commit: a61e2609c18d459a8f236cbbd0ce5a04a06d28da

Tree: a41b9adcfe8c886cfaf6b070a4fe3855a2c94dd1

Author: Cole Miller

Committer: GitHub

## Message

```
Normalize ranges returned by language servers in more cases (#63372)

Previously, we'd panic when constructing multibuffer excerpts in
response to "find all references" if a language server returned a
reversed range. This PR makes it so we normalize those ranges using the
existing `range_from_lsp` helper before passing them to
`set_excerpts_for_path`. It also replaces several other places where we
were calling `point_from_lsp` on each endpoint of a range separately
with `range_from_lsp`.

Closes ZED-79W

Co-authored-by: Mikayla <mikayla@zed.dev>

Release Notes:
- Fixed a crash with some languages servers when handling
`editor::FindAllReferences`.
```

## Parents

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

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