aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/highlighting.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/highlighting.ts')
-rw-r--r--editors/code/src/highlighting.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts
index d7d0e910b..ea2dfc0e3 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -4,7 +4,7 @@ import * as ra from './rust-analyzer-api';
4import { ColorTheme, TextMateRuleSettings } from './color_theme'; 4import { ColorTheme, TextMateRuleSettings } from './color_theme';
5 5
6import { Ctx } from './ctx'; 6import { Ctx } from './ctx';
7import { sendRequestWithRetry } from './util'; 7import { sendRequestWithRetry, isRustDocument } from './util';
8 8
9export function activateHighlighting(ctx: Ctx) { 9export function activateHighlighting(ctx: Ctx) {
10 const highlighter = new Highlighter(ctx); 10 const highlighter = new Highlighter(ctx);
@@ -36,7 +36,7 @@ export function activateHighlighting(ctx: Ctx) {
36 36
37 vscode.window.onDidChangeActiveTextEditor( 37 vscode.window.onDidChangeActiveTextEditor(
38 async (editor: vscode.TextEditor | undefined) => { 38 async (editor: vscode.TextEditor | undefined) => {
39 if (!editor || editor.document.languageId !== 'rust') return; 39 if (!editor || !isRustDocument(editor.document)) return;
40 if (!ctx.config.highlightingOn) return; 40 if (!ctx.config.highlightingOn) return;
41 const client = ctx.client; 41 const client = ctx.client;
42 if (!client) return; 42 if (!client) return;