From 0b6354c6678b9204ce9a1fe6c362e2763269f336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20F=C3=B6rster?= Date: Wed, 26 Feb 2020 19:17:30 +0100 Subject: [PATCH] Fetch configuration on startup --- src/action.rs | 1 + src/server.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/action.rs b/src/action.rs index cb57853fb..e81cf72fd 100644 --- a/src/action.rs +++ b/src/action.rs @@ -12,6 +12,7 @@ pub enum LintReason { pub enum Action { RegisterCapabilities, LoadDistribution, + LoadConfiguration, UpdateConfiguration(serde_json::Value), DetectRoot(Uri), PublishDiagnostics, diff --git a/src/server.rs b/src/server.rs index 97d66bed8..c8a63f4be 100644 --- a/src/server.rs +++ b/src/server.rs @@ -153,6 +153,7 @@ impl LatexLspServer { #[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); } @@ -651,6 +652,9 @@ impl Middleware for LatexLspServer { self.client.show_message(params).await; }; } + Action::LoadConfiguration => { + self.configuration(true).await; + } Action::UpdateConfiguration(settings) => { self.config_strategy.get().unwrap().set(settings).await; }