Skip to content

Commit

Permalink
fix: lsp adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jan 4, 2022
1 parent e5605ee commit 67233f2
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/lsp/clarity_language_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,19 +332,21 @@ impl ClarityLanguageBackend {
self.client.publish_diagnostics(url, vec![], None).await;
}

if !diagnostics.is_empty() {
let erroring_files = diagnostics
.iter()
.map(|(url, _)| {
url.to_file_path()
.unwrap()
.file_name()
.unwrap()
.to_str()
.unwrap()
.to_string()
})
.collect::<Vec<_>>();
let mut erroring_files = vec![];
for (url, diagnostic) in diagnostics.into_iter() {
if !diagnostic.is_empty() {
erroring_files.push(url.to_file_path()
.unwrap()
.file_name()
.unwrap()
.to_str()
.unwrap()
.to_string()
);
}
self.client.publish_diagnostics(url, diagnostic, None).await;
}
if !erroring_files.is_empty() {
self.client
.show_message(
MessageType::Error,
Expand All @@ -355,9 +357,6 @@ impl ClarityLanguageBackend {
)
.await;
}
for (url, diagnostic) in diagnostics.into_iter() {
self.client.publish_diagnostics(url, diagnostic, None).await;
}
}
}
}
Expand Down

0 comments on commit 67233f2

Please sign in to comment.