mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 11:29:25 +00:00
Use proper anchors for remote LSP queries
This commit is contained in:
parent
cb4b92aa61
commit
c61de29c11
1 changed files with 11 additions and 14 deletions
|
@ -6764,22 +6764,19 @@ impl Project {
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let buffer_hints = this
|
let start = envelope
|
||||||
.update(&mut cx, |project, cx| {
|
|
||||||
let buffer_end = buffer.read(cx).len();
|
|
||||||
// TODO kb use cache before querying?
|
|
||||||
project.inlay_hints(
|
|
||||||
buffer,
|
|
||||||
envelope
|
|
||||||
.payload
|
.payload
|
||||||
.start
|
.start
|
||||||
.map_or(0, |anchor| anchor.offset as usize)
|
.and_then(deserialize_anchor)
|
||||||
..envelope
|
.context("missing range start")?;
|
||||||
|
let end = envelope
|
||||||
.payload
|
.payload
|
||||||
.end
|
.end
|
||||||
.map_or(buffer_end, |anchor| anchor.offset as usize),
|
.and_then(deserialize_anchor)
|
||||||
cx,
|
.context("missing range end")?;
|
||||||
)
|
let buffer_hints = this
|
||||||
|
.update(&mut cx, |project, cx| {
|
||||||
|
project.inlay_hints(buffer, start..end, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.context("inlay hints fetch")?
|
.context("inlay hints fetch")?
|
||||||
|
|
Loading…
Reference in a new issue