2021-12-13 15:46:35 +00:00
|
|
|
[package]
|
|
|
|
name = "diagnostics"
|
|
|
|
version = "0.1.0"
|
|
|
|
edition = "2021"
|
2023-01-18 20:28:02 +00:00
|
|
|
publish = false
|
2021-12-13 15:46:35 +00:00
|
|
|
|
|
|
|
[lib]
|
|
|
|
path = "src/diagnostics.rs"
|
2022-03-04 00:15:56 +00:00
|
|
|
doctest = false
|
2021-12-13 15:46:35 +00:00
|
|
|
|
|
|
|
[dependencies]
|
2021-12-14 01:44:20 +00:00
|
|
|
collections = { path = "../collections" }
|
2021-12-13 15:46:35 +00:00
|
|
|
editor = { path = "../editor" }
|
2023-04-25 00:41:55 +00:00
|
|
|
gpui = { path = "../gpui" }
|
2021-12-14 01:44:20 +00:00
|
|
|
language = { path = "../language" }
|
2023-04-20 00:37:28 +00:00
|
|
|
lsp = { path = "../lsp" }
|
2021-12-13 15:46:35 +00:00
|
|
|
project = { path = "../project" }
|
2022-04-06 00:10:17 +00:00
|
|
|
settings = { path = "../settings" }
|
2022-01-12 01:23:11 +00:00
|
|
|
theme = { path = "../theme" }
|
2021-12-22 00:39:23 +00:00
|
|
|
util = { path = "../util" }
|
2021-12-13 15:46:35 +00:00
|
|
|
workspace = { path = "../workspace" }
|
2023-04-25 00:41:55 +00:00
|
|
|
|
Refresh diagnostics inside the tab (#3225)
r-a now has 2 different types of diagnostics:
* "disk-based" ones that come from `cargo check` and related, that emit
`project::Event::DiskBasedDiagnosticsStarted` and
`DiskBasedDiagnosticsFinished`
* "flycheck" diagnostics from r-a itself, that it tries to dynamically
apply to every buffer open, that come with `DiagnosticsUpdated` event.
Latter diagnostics update frequently, on every file close and open, but
`diagnostics.rs` logic had never polled for new diagnostics after
registering the `DiagnosticsUpdated` event, so the only way we could
have newer diagnostics was to re-open the whole panel.
The PR fixes that, and also adds more debug logging to the module.
The logic of the fix looks very familiar to previous related fix:
https://github.com/zed-industries/zed/pull/3128
One notable thing after the fix: "flycheck" diagnostics stay forever if
the diagnostics panel is opened: excerpts in that panel do not allow the
buffer to get dropped (hence, closed in terms of r-a) and get the
updated, zero diagnostics.
If the diagnostics panel is opened and closed multiple times, those
errors gradually disappear.
Release Notes:
- Fixed diagnostics panel not refreshing its contents properly
2023-11-03 20:03:05 +00:00
|
|
|
log.workspace = true
|
2023-04-25 00:41:55 +00:00
|
|
|
anyhow.workspace = true
|
More heuristics for diagnostics updates (#3236)
Follow-up of https://github.com/zed-industries/zed/pull/3225
That PR enabled every `project::Event::DiskBasedDiagnosticsFinished` to
update the diagnostics, which turned out to be bad, Zed does query for
more diagnostics after every excerpt update, and that seems to be due to
`Event::Edited` emitted by the multibuffers created in the diagnostics
panel.
* now, instead of eagerly updating the diagnostics every time, only do
that if the panel has 0 or 1 caret placed and no changes were made in
the panel yet.
Otherwise, use previous approach and register the updated paths to defer
their update later.
* on every `update_excerpts` in the diagnostics panel, query the entire
diagnostics summary (and store it for the future comparisons), compare
old and new summaries and re-query diagnostics for every path that's not
in both summaries.
Also, query every path that was registered during the
`DiskBasedDiagnosticsFinished` updates that were not eagerly updated
before.
This way we're supposed to get all new diagnostics (for new paths added)
and re-check all old paths that might have stale diagnostics now.
* do diagnostics rechecks concurrently for every path now, speeding the
overall process
Release Notes:
- Fixed diagnostics triggering too eagerly during multicaret edits and
certain stale diagnostics not being removed in time
2023-11-05 14:17:38 +00:00
|
|
|
futures.workspace = true
|
2023-09-28 00:08:08 +00:00
|
|
|
schemars.workspace = true
|
|
|
|
serde.workspace = true
|
|
|
|
serde_derive.workspace = true
|
2023-04-25 00:41:55 +00:00
|
|
|
smallvec.workspace = true
|
|
|
|
postage.workspace = true
|
2021-12-17 02:09:12 +00:00
|
|
|
|
|
|
|
[dev-dependencies]
|
2021-12-22 00:39:23 +00:00
|
|
|
client = { path = "../client", features = ["test-support"] }
|
2021-12-17 02:09:12 +00:00
|
|
|
editor = { path = "../editor", features = ["test-support"] }
|
|
|
|
language = { path = "../language", features = ["test-support"] }
|
2023-04-20 00:37:28 +00:00
|
|
|
lsp = { path = "../lsp", features = ["test-support"] }
|
2021-12-17 02:09:12 +00:00
|
|
|
gpui = { path = "../gpui", features = ["test-support"] }
|
|
|
|
workspace = { path = "../workspace", features = ["test-support"] }
|
2023-05-17 21:44:55 +00:00
|
|
|
theme = { path = "../theme", features = ["test-support"] }
|
2023-04-25 00:41:55 +00:00
|
|
|
|
|
|
|
serde_json.workspace = true
|
|
|
|
unindent.workspace = true
|