mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
stale color box when switching languages. Fixes #21108
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
import * as path from 'path';
|
||||
|
||||
import { languages, window, commands, ExtensionContext } from 'vscode';
|
||||
import { languages, window, commands, workspace, ExtensionContext } from 'vscode';
|
||||
import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, Range, TextEdit } from 'vscode-languageclient';
|
||||
import { activateColorDecorations } from './colorDecorators';
|
||||
|
||||
@@ -54,7 +54,10 @@ export function activate(context: ExtensionContext) {
|
||||
let colorRequestor = (uri: string) => {
|
||||
return client.sendRequest(ColorSymbolRequest.type, uri).then(ranges => ranges.map(client.protocol2CodeConverter.asRange));
|
||||
};
|
||||
disposable = activateColorDecorations(colorRequestor, { css: true, scss: true, less: true });
|
||||
let isDecoratorEnabled = (languageId: string) => {
|
||||
return workspace.getConfiguration().get<boolean>(languageId + '.colorDecorators.enable');
|
||||
};
|
||||
disposable = activateColorDecorations(colorRequestor, { css: true, scss: true, less: true }, isDecoratorEnabled);
|
||||
context.subscriptions.push(disposable);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user