aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/client.ts4
-rw-r--r--editors/code/src/ctx.ts4
-rw-r--r--editors/code/src/inlay_hints.ts4
3 files changed, 7 insertions, 5 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index 0d0832c44..34965e2fb 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 configToOptions(config: Config): object { 8export function configToServerOptions(config: Config): object {
9 return { 9 return {
10 publishDecorations: !config.highlightingSemanticTokens, 10 publishDecorations: !config.highlightingSemanticTokens,
11 lruCapacity: config.lruCapacity, 11 lruCapacity: config.lruCapacity,
@@ -50,7 +50,7 @@ export async function createClient(config: Config, serverPath: string): Promise<
50 50
51 const clientOptions: lc.LanguageClientOptions = { 51 const clientOptions: lc.LanguageClientOptions = {
52 documentSelector: [{ scheme: 'file', language: 'rust' }], 52 documentSelector: [{ scheme: 'file', language: 'rust' }],
53 initializationOptions: configToOptions(config), 53 initializationOptions: configToServerOptions(config),
54 traceOutputChannel, 54 traceOutputChannel,
55 middleware: { 55 middleware: {
56 // Workaround for https://github.com/microsoft/vscode-languageserver-node/issues/576 56 // Workaround for https://github.com/microsoft/vscode-languageserver-node/issues/576
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 934638c6d..d2f49cd23 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -2,7 +2,7 @@ import * as vscode from 'vscode';
2import * as lc from 'vscode-languageclient'; 2import * as lc from 'vscode-languageclient';
3 3
4import { Config } from './config'; 4import { Config } from './config';
5import { createClient, configToOptions } from './client'; 5import { createClient, configToServerOptions } from './client';
6import { isRustEditor, RustEditor } from './util'; 6import { isRustEditor, RustEditor } from './util';
7 7
8export class Ctx { 8export class Ctx {
@@ -20,7 +20,7 @@ export class Ctx {
20 const res = new Ctx(config, extCtx, client, serverPath); 20 const res = new Ctx(config, extCtx, client, serverPath);
21 res.pushCleanup(client.start()); 21 res.pushCleanup(client.start());
22 await client.onReady(); 22 await client.onReady();
23 client.onRequest('workspace/configuration', _ => [configToOptions(config)]); 23 client.onRequest('workspace/configuration', _ => [configToServerOptions(config)]);
24 return res; 24 return res;
25 } 25 }
26 26
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts
index 542d1f367..98663e0e3 100644
--- a/editors/code/src/inlay_hints.ts
+++ b/editors/code/src/inlay_hints.ts
@@ -18,6 +18,8 @@ export function activateInlayHints(ctx: Ctx) {
18 return this.dispose(); 18 return this.dispose();
19 } 19 }
20 if (!this.updater) this.updater = new HintsUpdater(ctx); 20 if (!this.updater) this.updater = new HintsUpdater(ctx);
21
22 this.updater.syncCacheAndRenderHints();
21 }, 23 },
22 dispose() { 24 dispose() {
23 this.updater?.dispose(); 25 this.updater?.dispose();
@@ -124,7 +126,7 @@ class HintsUpdater implements Disposable {
124 this.syncCacheAndRenderHints(); 126 this.syncCacheAndRenderHints();
125 } 127 }
126 128
127 private syncCacheAndRenderHints() { 129 public syncCacheAndRenderHints() {
128 // FIXME: make inlayHints request pass an array of files? 130 // FIXME: make inlayHints request pass an array of files?
129 this.sourceFiles.forEach((file, uri) => this.fetchHints(file).then(hints => { 131 this.sourceFiles.forEach((file, uri) => this.fetchHints(file).then(hints => {
130 if (!hints) return; 132 if (!hints) return;