Skip to content

Commit

Permalink
trying to fix: fails to respond
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLee18 committed Sep 17, 2024
1 parent 30cc54e commit 27e8a02
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ impl LanguageServer for Backend {
diagnostic_provider: Some(DiagnosticServerCapabilities::Options(
DiagnosticOptions::default(),
)),
workspace: Some(WorkspaceServerCapabilities {
workspace_folders: Some(WorkspaceFoldersServerCapabilities {
supported: Some(true),
change_notifications: None,
}),
file_operations: None,
}),
..Default::default()
},
})
Expand Down Expand Up @@ -78,10 +85,12 @@ impl LanguageServer for Backend {

async fn did_save(&self, p: DidSaveTextDocumentParams) {
self.client
.log_message(MessageType::INFO, "file saved!")
.log_message(MessageType::INFO, format!("file saved: {:?}", p.text))
.await;
let diags = read_norminette(&Path::new(p.text_document.uri.as_str()))
.expect("norminette read failed");
let diags = read_norminette(&Path::new(p.text_document.uri.as_str())).expect(&format!(
"norminette read failed of {}",
p.text_document.uri
));
self.client
.publish_diagnostics(p.text_document.uri, diags, None)
.await
Expand Down

0 comments on commit 27e8a02

Please sign in to comment.