Skip to content

Commit

Permalink
Fetch configuration on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
pfoerster committed Feb 26, 2020
1 parent 54d0651 commit 0b6354c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub enum LintReason {
pub enum Action {
RegisterCapabilities,
LoadDistribution,
LoadConfiguration,
UpdateConfiguration(serde_json::Value),
DetectRoot(Uri),
PublishDiagnostics,
Expand Down
4 changes: 4 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ 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);
}
Expand Down Expand Up @@ -651,6 +652,9 @@ impl<C: LspClient + Send + Sync + 'static> Middleware for LatexLspServer<C> {
self.client.show_message(params).await;
};
}
Action::LoadConfiguration => {
self.configuration(true).await;
}
Action::UpdateConfiguration(settings) => {
self.config_strategy.get().unwrap().set(settings).await;
}
Expand Down

0 comments on commit 0b6354c

Please sign in to comment.