# search: Add LSP location pickers for references, definitions, and diagnostics \(\#59838\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 63692b8b4724357fa63d6318b45f3c3fee6f672a

Requested commit: 63692b8b4724357fa63d6318b45f3c3fee6f672a

Commit: 63692b8b4724357fa63d6318b45f3c3fee6f672a

Tree: 3748ec0093fd17dad57503fcfad79a12ee5509e0

Author: David

Committer: GitHub

## Message

```
search: Add LSP location pickers for references, definitions, and diagnostics (#59838)

# Objective

Closes #59829

Provide a filterable, preview-backed picker for LSP results as an
alternative to the multi-buffer view, for references, definitions,
implementations.

## Solution

Update the 3 existing LSP actions (definitions, implementations, find
all references) to add a `open_results_in` parameter which accepts
either `multi_buffer` (default) or `picker` to show the results in a
filterable picker with preview. This behavior can be configured globally
in the settings via `lsp_results_location`.

UX:

- The 3 existing LSP actions each accept a `open_results_in` parameter
so that each action can be configuring individually with a custom
keybind
- The `lsp_results_location` global setting can be used to set a default
behavior with `open_results_in == None`
- Go to definition falls back to find all references (if configured) on
empty results which is consistent with the non-picker path
- Results are grouped by file; each row shows the line number and the
syntax-highlighted source line with the match emphasized.
- Typing filters by line text or path; the preview updates with the
selection.
- Enter/click opens the selection, `cmd/ctrl-enter` opens it in a split,
and re-invoking the command toggles the picker closed.
- Empty results show a toast so the command never silently does nothing.
- Note: the new pickers do not open on cmd-click, only when invoked via
the command palette or keybind

## Testing

- No automated tests yet — holding for first-round feedback on the
approach and UX before adding tests.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

## Showcase


https://github.com/user-attachments/assets/41538f23-9b54-4dfc-bfa7-a61564a675a8

---

Release Notes:

- The find all references, go to definitions, and go to implementations
LSP actions can be configured to open results in a picker with preview
instead of a multibuffer.
```

## Parents

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

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