Closes https://github.com/zed-industries/zed/issues/40047 Closes https://github.com/zed-industries/zed/issues/24798 Closes https://github.com/zed-industries/zed/issues/24788 Before, each editor, even if it's the same buffer split in 2, was querying for inlay hints separately, and storing the whole inlay hint twice, in `Editor`'s `display_map` and its `inlay_hint_cache` fields. Now, instead of `inlay_hint_cache`, each editor maintains a minimal set of metadata (which area was queried by what task) instead, and all LSP inlay hint data had been moved into `LspStore`, both local and remote flavors store the data. This allows Zed, as long as a buffer is open, to reuse the inlay hint data similar to how document colors and code lens are now stored and reused. Unlike other reused LSP data, inlay hints data is the first one that's possible to query by document ranges and previous version had issue with caching and invalidating such ranges already queried for. The new version re-approaches this by chunking the file into row ranges, which are queried based on the editors' visible area. Among the corresponding refactoring, one notable difference in inlays display are multi buffers: buffers in them are not [registered](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_didOpen) in the language server until a caret/selection is placed inside their excerpts inside the multi buffer. New inlays code does not query language servers for unregistered buffers, as servers usually respond with empty responses or errors in such cases. Release Notes: - Reworked inlay hints to be less error-prone --------- Co-authored-by: Lukas Wirth <lukas@zed.dev> Co-authored-by: dino <dinojoaocosta@gmail.com> Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
54 lines
1.2 KiB
TOML
54 lines
1.2 KiB
TOML
[package]
|
|
name = "search"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[features]
|
|
test-support = [
|
|
"client/test-support",
|
|
"editor/test-support",
|
|
"gpui/test-support",
|
|
"workspace/test-support",
|
|
]
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/search.rs"
|
|
doctest = false
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
any_vec.workspace = true
|
|
bitflags.workspace = true
|
|
collections.workspace = true
|
|
editor.workspace = true
|
|
futures.workspace = true
|
|
gpui.workspace = true
|
|
language.workspace = true
|
|
menu.workspace = true
|
|
project.workspace = true
|
|
schemars.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
settings.workspace = true
|
|
smol.workspace = true
|
|
theme.workspace = true
|
|
ui.workspace = true
|
|
util.workspace = true
|
|
util_macros.workspace = true
|
|
workspace.workspace = true
|
|
zed_actions.workspace = true
|
|
|
|
[dev-dependencies]
|
|
client = { workspace = true, features = ["test-support"] }
|
|
editor = { workspace = true, features = ["test-support"] }
|
|
gpui = { workspace = true, features = ["test-support"] }
|
|
language = { workspace = true, features = ["test-support"] }
|
|
lsp.workspace = true
|
|
unindent.workspace = true
|
|
workspace = { workspace = true, features = ["test-support"] }
|