# editor: Stop re-requesting hover and definitions for the same position \(\#58244\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f8cfad3420ad0847b9793a1d4ad1f637212bd44a

Requested commit: f8cfad3420ad0847b9793a1d4ad1f637212bd44a

Commit: f8cfad3420ad0847b9793a1d4ad1f637212bd44a

Tree: e6a91e4cd93a84f7caf7e515d42680053fdc7b07

Author: Veesh Goldman

Committer: GitHub

## Message

```
editor: Stop re-requesting hover and definitions for the same position (#58244)

Holding the go-to-definition modifier (`cmd`/`ctrl`) and moving the
mouse re-issued a `textDocument/definition` request on every mouse-move
event for the same cursor position, because the request deduplication
guard had gone stale, namely:

* `HoveredLinkState::last_trigger_point` was only set when the state was
first created, so the guard for the checking the same position stopped
matching after the first request. It's now refreshed whenever a
definition request is issued, so keeping the mouse on a symbol queries
once instead of on every move. This matters for servers that return a
bare `Location` without an `originSelectionRange` (e.g. phpactor), where
the other guard (`symbol_range`) stays empty and deduplication relies
entirely on `last_trigger_point`.
* The `HoverState::triggered_from` field was dead code, as it was never
written to, so these changes also remove it. The hover-popover path is
already throttled by its show delay, so each mouse move cancels the
pending request before it is sent, with no extra guard needed.

Closes #56193

Release Notes:

- Fixed go to definition repeatedly querying the language server for the
same cursor position

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
```

## Parents

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

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