about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorKirill Bulatov <mail4score@gmail.com>2020-03-22 00:40:07 +0200
committerKirill Bulatov <mail4score@gmail.com>2020-03-30 13:39:14 +0300
commitb892a48740eef7a505bfbe2213c42c71e87f0bea (patch)
tree8f7115e538c3b21407eb17c604636eb3bb6362c8 /editors/code/src
parent590af37bff2b5ec9a692f2468c98acf7f9f492c0 (diff)
downloadrust-b892a48740eef7a505bfbe2213c42c71e87f0bea.tar.gz
rust-b892a48740eef7a505bfbe2213c42c71e87f0bea.zip
Code review fixes
Co-Authored-By: Veetaha <veetaha2@gmail.com>
Diffstat (limited to 'editors/code/src')
-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
3 files changed, 8 insertions, 6 deletions
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,
     );
 }