From b892a48740eef7a505bfbe2213c42c71e87f0bea Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 22 Mar 2020 00:40:07 +0200 Subject: Code review fixes Co-Authored-By: Veetaha --- editors/code/src/client.ts | 2 +- editors/code/src/inlay_hints.ts | 10 ++++++---- editors/code/src/main.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'editors/code') diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index 34965e2fb..d72ecc58f 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 98663e0e3..6a8bd942e 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 63d145db0..a46dbde33 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, ); } -- cgit v1.2.3