Refresh diagnostics inside the tab

This commit is contained in:
Kirill Bulatov 2023-11-03 18:33:17 +02:00
parent c529343ba1
commit 9cb8ce172d
5 changed files with 10 additions and 3 deletions

1
Cargo.lock generated
View file

@ -2461,6 +2461,7 @@ dependencies = [
"editor",
"gpui",
"language",
"log",
"lsp",
"postage",
"project",

View file

@ -20,6 +20,7 @@ theme = { path = "../theme" }
util = { path = "../util" }
workspace = { path = "../workspace" }
log.workspace = true
anyhow.workspace = true
schemars.workspace = true
serde.workspace = true

View file

@ -151,6 +151,7 @@ impl ProjectDiagnosticsEditor {
) -> Self {
cx.subscribe(&project_handle, |this, _, event, cx| match event {
project::Event::DiskBasedDiagnosticsFinished { language_server_id } => {
log::debug!("Disk based diagnostics finished for server {language_server_id}");
this.update_excerpts(Some(*language_server_id), cx);
this.update_title(cx);
}
@ -158,8 +159,11 @@ impl ProjectDiagnosticsEditor {
language_server_id,
path,
} => {
log::debug!("Adding path {path:?} to update for server {language_server_id}");
this.paths_to_update
.insert((path.clone(), *language_server_id));
this.update_excerpts(Some(*language_server_id), cx);
this.update_title(cx);
}
_ => {}
})
@ -229,6 +233,7 @@ impl ProjectDiagnosticsEditor {
language_server_id: Option<LanguageServerId>,
cx: &mut ViewContext<Self>,
) {
log::debug!("Updating excerpts for server {language_server_id:?}");
let mut paths = Vec::new();
self.paths_to_update.retain(|(path, server_id)| {
if language_server_id

View file

@ -34,7 +34,7 @@ use util::{
test::{marked_text_ranges, marked_text_ranges_by, sample_text, TextRangeMarker},
};
use workspace::{
item::{FollowableItem, Item, ItemHandle},
item::{FollowableItem, Item},
NavigationEntry, ViewId,
};

View file

@ -33,9 +33,9 @@ use util::{
paths::{PathExt, FILE_ROW_COLUMN_DELIMITER},
ResultExt, TryFutureExt,
};
use workspace::item::{BreadcrumbText, FollowableItemHandle};
use workspace::item::{BreadcrumbText, FollowableItemHandle, ItemHandle};
use workspace::{
item::{FollowableItem, Item, ItemEvent, ItemHandle, ProjectItem},
item::{FollowableItem, Item, ItemEvent, ProjectItem},
searchable::{Direction, SearchEvent, SearchableItem, SearchableItemHandle},
ItemId, ItemNavHistory, Pane, StatusItemView, ToolbarItemLocation, ViewId, Workspace,
WorkspaceId,