about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crates/rust-analyzer/src/main_loop.rs21
-rw-r--r--crates/rust-analyzer/src/world.rs1
-rw-r--r--editors/code/src/client.ts2
-rw-r--r--editors/code/src/inlay_hints.ts10
-rw-r--r--editors/code/src/main.ts2
5 files changed, 18 insertions, 18 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index e1fcae136fe..7e96be31923 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -417,22 +417,19 @@ fn loop_turn(
                 if Some(resp.id) == loop_state.configuration_request_id {
                     loop_state.configuration_request_id = None;
                     if let Some(err) = resp.error {
-                        log::error!("failed fetch the server settings: {:?}", err)
-                    } else if resp.result.is_none() {
-                        log::error!("received empty server settings response from the client")
-                    } else {
-                        let new_config =
-                            serde_json::from_value::<Vec<ServerConfig>>(resp.result.unwrap())?
-                                .first()
-                                .expect(
-                                    "The client is expected to always send a non-empty config data",
-                                )
-                                .to_owned();
+                        log::error!("failed to fetch the server settings: {:?}", err)
+                    } else if let Some(result) = resp.result {
+                        let new_config = serde_json::from_value::<Vec<ServerConfig>>(result)?
+                            .first()
+                            .expect("The client is expected to always send a non-empty config data")
+                            .to_owned();
                         world_state.update_configuration(
                             new_config.lru_capacity,
                             get_options(&new_config, text_document_caps),
                             get_feature_flags(&new_config, connection),
                         );
+                    } else {
+                        log::error!("received empty server settings response from the client")
                     }
                 }
             }
@@ -673,7 +670,7 @@ fn on_notification(
                 ConfigurationParams::default(),
             );
             msg_sender.send(request.into())?;
-            loop_state.configuration_request_id.replace(request_id);
+            loop_state.configuration_request_id = Some(request_id);
 
             return Ok(());
         }
diff --git a/crates/rust-analyzer/src/world.rs b/crates/rust-analyzer/src/world.rs
index 2b5878ed905..01084f81868 100644
--- a/crates/rust-analyzer/src/world.rs
+++ b/crates/rust-analyzer/src/world.rs
@@ -32,6 +32,7 @@ use ra_db::ExternSourceId;
 use rustc_hash::{FxHashMap, FxHashSet};
 
 fn create_watcher(workspaces: &[ProjectWorkspace], options: &Options) -> CheckWatcher {
+    // FIXME: Figure out the multi-workspace situation
     workspaces
         .iter()
         .find_map(|w| match w {
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index 34965e2fbcf..d72ecc58fc2 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -5,7 +5,7 @@ import { Config } from './config';
 import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
 import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed';
 
-export function configToServerOptions(config: Config): object {
+export function configToServerOptions(config: Config) {
     return {
         publishDecorations: !config.highlightingSemanticTokens,
         lruCapacity: config.lruCapacity,
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts
index 98663e0e326..6a8bd942e16 100644
--- a/editors/code/src/inlay_hints.ts
+++ b/editors/code/src/inlay_hints.ts
@@ -17,9 +17,11 @@ export function activateInlayHints(ctx: Ctx) {
             ) {
                 return this.dispose();
             }
-            if (!this.updater) this.updater = new HintsUpdater(ctx);
-
-            this.updater.syncCacheAndRenderHints();
+            if (this.updater) {
+                this.updater.syncCacheAndRenderHints();
+            } else {
+                this.updater = new HintsUpdater(ctx);
+            }
         },
         dispose() {
             this.updater?.dispose();
@@ -126,7 +128,7 @@ class HintsUpdater implements Disposable {
         this.syncCacheAndRenderHints();
     }
 
-    public syncCacheAndRenderHints() {
+    syncCacheAndRenderHints() {
         // FIXME: make inlayHints request pass an array of files?
         this.sourceFiles.forEach((file, uri) => this.fetchHints(file).then(hints => {
             if (!hints) return;
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 63d145db091..a46dbde33ce 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -95,7 +95,7 @@ export async function activate(context: vscode.ExtensionContext) {
     vscode.workspace.onDidChangeConfiguration(
         _ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }),
         null,
-        ctx?.subscriptions,
+        ctx.subscriptions,
     );
 }