aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-03-21 22:40:07 +0000
committerKirill Bulatov <[email protected]>2020-03-30 11:39:14 +0100
commitb892a48740eef7a505bfbe2213c42c71e87f0bea (patch)
tree8f7115e538c3b21407eb17c604636eb3bb6362c8 /editors
parent590af37bff2b5ec9a692f2468c98acf7f9f492c0 (diff)
Code review fixes
Co-Authored-By: Veetaha <[email protected]>
Diffstat (limited to 'editors')
-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 34965e2fb..d72ecc58f 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -5,7 +5,7 @@ import { Config } from './config';
5import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; 5import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
6import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed'; 6import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed';
7 7
8export function configToServerOptions(config: Config): object { 8export function configToServerOptions(config: Config) {
9 return { 9 return {
10 publishDecorations: !config.highlightingSemanticTokens, 10 publishDecorations: !config.highlightingSemanticTokens,
11 lruCapacity: config.lruCapacity, 11 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) {
17 ) { 17 ) {
18 return this.dispose(); 18 return this.dispose();
19 } 19 }
20 if (!this.updater) this.updater = new HintsUpdater(ctx); 20 if (this.updater) {
21 21 this.updater.syncCacheAndRenderHints();
22 this.updater.syncCacheAndRenderHints(); 22 } else {
23 this.updater = new HintsUpdater(ctx);
24 }
23 }, 25 },
24 dispose() { 26 dispose() {
25 this.updater?.dispose(); 27 this.updater?.dispose();
@@ -126,7 +128,7 @@ class HintsUpdater implements Disposable {
126 this.syncCacheAndRenderHints(); 128 this.syncCacheAndRenderHints();
127 } 129 }
128 130
129 public syncCacheAndRenderHints() { 131 syncCacheAndRenderHints() {
130 // FIXME: make inlayHints request pass an array of files? 132 // FIXME: make inlayHints request pass an array of files?
131 this.sourceFiles.forEach((file, uri) => this.fetchHints(file).then(hints => { 133 this.sourceFiles.forEach((file, uri) => this.fetchHints(file).then(hints => {
132 if (!hints) return; 134 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) {
95 vscode.workspace.onDidChangeConfiguration( 95 vscode.workspace.onDidChangeConfiguration(
96 _ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }), 96 _ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }),
97 null, 97 null,
98 ctx?.subscriptions, 98 ctx.subscriptions,
99 ); 99 );
100} 100}
101 101