Skip to content

lsp: project the hover LOCATION before its MARKUP - #27

Closed
mgasner wants to merge 1 commit into
fix/git-show-repo-pathsfrom
fix/lsp-hover
Closed

mgasner wants to merge 1 commit into
fix/git-show-repo-pathsfrom
fix/lsp-hover

Conversation

@mgasner

@mgasner mgasner commented Sep 28, 2026

Copy link
Copy Markdown

Stacked on #26. The diff shows only this change.

Every yas lsp hover failed with Internal: no detail, and hover in the browser editor showed nothing.

Cause

The server family builds a HoverRecord from a native LOCATION followed by its MARKUP (crates/server/src/yas_lsp.rs convert_query_response), and the wire HoverRecord's target is that location. translate::hover pushed the markup first. When the language server gave no range, it pushed no location at all. Every hover therefore failed with "LSP markup has no target location".

Fix

translate::hover now pushes LOCATION then MARKUP as one atomic group. When no range is reported, the location is the empty range at the queried position. PendingQuery now carries the line and column for this.

Testing

  • New test hover_location_precedes_markup covers both the ranged and rangeless cases.
  • cargo test -p yas-lsp passes (60 tests).
  • Checked by hand with rust-analyzer. I did not test browser hover, but it uses the same server code.

View in Indent
Tag @indent to continue the conversation here.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Coverage

Crate Lines Functions Regions
alacritty-driver 85.6% (1081/1263) 89.4% (84/94) 89.3% (1746/1955)
browser 25.5% (309/1212) 30.4% (34/112) 27.7% (605/2183)
cli 34.2% (6797/19877) 36.3% (644/1776) 35.3% (10106/28593)
client 68.3% (5800/8497) 68.5% (708/1033) 66.4% (7526/11331)
composite-transport 96.3% (526/546) 98.4% (60/61) 96.2% (884/919)
compositor 55.0% (11457/20820) 66.3% (839/1265) 54.9% (15870/28909)
desktop 78.4% (4460/5691) 71.6% (393/549) 75.1% (6211/8267)
edge 63.1% (800/1268) 50.9% (82/161) 58.0% (1043/1799)
fonts 77.3% (1257/1626) 82.7% (129/156) 78.9% (2424/3071)
fssync 86.0% (1610/1872) 85.8% (182/212) 87.1% (2834/3255)
git 72.9% (4622/6344) 70.5% (347/492) 70.1% (6590/9407)
guest 67.3% (6829/10148) 67.0% (488/728) 66.6% (8935/13416)
lsp 79.9% (3641/4558) 81.3% (340/418) 77.7% (5489/7068)
proxy 63.1% (1902/3012) 56.3% (184/327) 63.4% (2931/4626)
runtime-dir 93.6% (117/125) 100.0% (14/14) 94.8% (218/230)
sd-notify 73.9% (68/92) 100.0% (6/6) 83.2% (109/131)
server 71.5% (86232/120636) 74.1% (6259/8447) 69.4% (115530/166368)
ssh 67.2% (708/1054) 75.9% (85/112) 67.2% (1105/1645)
terminal-model 49.9% (314/629) 62.3% (38/61) 50.3% (505/1004)
uplink 94.2% (582/618) 92.6% (50/54) 93.1% (1062/1141)
webrtc-forwarder 33.6% (1321/3932) 44.9% (146/325) 36.0% (2279/6336)
webserver 80.7% (1490/1846) 81.1% (193/238) 83.2% (2551/3067)
website 35.1% (355/1012) 34.4% (53/154) 35.8% (607/1694)
xtask 0.0% (0/5149) 0.0% (0/131) 0.0% (0/9157)
yas 89.0% (28039/31522) 94.1% (2152/2286) 84.1% (44039/52388)
Total 67.2% (170317/253349) 70.3% (13510/19212) 65.6% (241199/367960)

@indent
indent Bot force-pushed the fix/git-show-repo-paths branch from 697c73a to 2f03c4d Compare October 14, 2026 19:08
@indent
indent Bot force-pushed the fix/lsp-hover branch from 916da7b to 2385923 Compare October 14, 2026 19:08
@indent
indent Bot force-pushed the fix/git-show-repo-paths branch from 2f03c4d to 710aa95 Compare October 14, 2026 19:32
@indent
indent Bot force-pushed the fix/lsp-hover branch 2 times, most recently from 616645a to 2d484e2 Compare October 14, 2026 19:54
@indent
indent Bot force-pushed the fix/git-show-repo-paths branch from 710aa95 to 0ba0155 Compare October 14, 2026 19:54
The server family pairs a native LOCATION with the MARKUP that follows it
into one HoverRecord, but translate::hover pushed the markup first, so
every hover failed with "LSP markup has no target location" (surfaced as
Internal: no detail). Push the location first, as one group, and fall
back to the empty range at the queried position when the language server
reports no range.
@indent
indent Bot force-pushed the fix/git-show-repo-paths branch from 0ba0155 to 00305f6 Compare October 15, 2026 01:43
@indent
indent Bot force-pushed the fix/lsp-hover branch from 2d484e2 to bd7d77b Compare October 15, 2026 01:43
@indent
indent Bot deleted the branch fix/git-show-repo-paths October 15, 2026 13:07
@indent indent Bot closed this Oct 15, 2026
@indent
indent Bot deleted the fix/lsp-hover branch October 15, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant