aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands/inlay_hints.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/commands/inlay_hints.ts')
-rw-r--r--editors/code/src/commands/inlay_hints.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts
index 0ce3edcbf..ba9966161 100644
--- a/editors/code/src/commands/inlay_hints.ts
+++ b/editors/code/src/commands/inlay_hints.ts
@@ -1,9 +1,5 @@
1import * as vscode from 'vscode'; 1import * as vscode from 'vscode';
2import { 2import { Range, TextDocumentChangeEvent, TextEditor } from 'vscode';
3 Range,
4 TextDocumentChangeEvent,
5 TextEditor
6} from 'vscode';
7import { TextDocumentIdentifier } from 'vscode-languageclient'; 3import { TextDocumentIdentifier } from 'vscode-languageclient';
8import { Server } from '../server'; 4import { Server } from '../server';
9 5
@@ -29,7 +25,7 @@ export class HintsUpdater {
29 public async loadHints( 25 public async loadHints(
30 editor: vscode.TextEditor | undefined 26 editor: vscode.TextEditor | undefined
31 ): Promise<void> { 27 ): Promise<void> {
32 if (this.displayHints && editor !== undefined) { 28 if (this.displayHints && editor !== undefined && this.isRustDocument(editor.document)) {
33 await this.updateDecorationsFromServer( 29 await this.updateDecorationsFromServer(
34 editor.document.uri.toString(), 30 editor.document.uri.toString(),
35 editor 31 editor
@@ -61,7 +57,7 @@ export class HintsUpdater {
61 return; 57 return;
62 } 58 }
63 const document = cause == null ? editor.document : cause.document; 59 const document = cause == null ? editor.document : cause.document;
64 if (document.languageId !== 'rust') { 60 if (!this.isRustDocument(document)) {
65 return; 61 return;
66 } 62 }
67 63
@@ -71,6 +67,10 @@ export class HintsUpdater {
71 ); 67 );
72 } 68 }
73 69
70 private isRustDocument(document: vscode.TextDocument): boolean {
71 return document && document.languageId === 'rust';
72 }
73
74 private async updateDecorationsFromServer( 74 private async updateDecorationsFromServer(
75 documentUri: string, 75 documentUri: string,
76 editor: TextEditor 76 editor: TextEditor