Skip to content

Commit

Permalink
Trigger a reparse after loading the initial options
Browse files Browse the repository at this point in the history
  • Loading branch information
pfoerster committed Feb 26, 2020
1 parent 3ef01bb commit 4c57289
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ impl<C: LspClient + Send + Sync + 'static> LatexLspServer<C> {
#[jsonrpc_method("initialized", kind = "notification")]
pub async fn initialized(&self, _params: InitializedParams) {
self.action_manager.push(Action::RegisterCapabilities);
self.action_manager.push(Action::LoadConfiguration);
self.action_manager.push(Action::PublishDiagnostics);
self.action_manager.push(Action::LoadDistribution);
self.action_manager.push(Action::LoadConfiguration);
}

#[jsonrpc_method("shutdown", kind = "request")]
Expand Down Expand Up @@ -653,7 +653,13 @@ impl<C: LspClient + Send + Sync + 'static> Middleware for LatexLspServer<C> {
};
}
Action::LoadConfiguration => {
self.configuration(true).await;
let options = self.configuration(true).await;
let workspace = self.workspace_manager.get();
for document in &workspace.documents {
if let Ok(path) = document.uri.to_file_path() {
let _ = self.workspace_manager.load(&path, &options);
}
}
}
Action::UpdateConfiguration(settings) => {
self.config_strategy.get().unwrap().set(settings).await;
Expand Down

0 comments on commit 4c57289

Please sign in to comment.