Skip to content

Commit

Permalink
on open run norminette
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLee18 committed Sep 17, 2024
1 parent 6efc3b0 commit 0e26d18
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,17 @@ impl LanguageServer for Backend {
Err(jsonrpc::Error::method_not_found())
}

async fn did_open(&self, _: DidOpenTextDocumentParams) {
async fn did_open(&self, p: DidOpenTextDocumentParams) {
self.client
.log_message(MessageType::INFO, "file opened!")
.await;
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
}

async fn did_change(&self, p: DidChangeTextDocumentParams) {
Expand Down

0 comments on commit 0e26d18

Please sign in to comment.