From 7646dc046eb562276231de8ec6a4df1bc691cafc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 30 Dec 2019 20:29:21 +0100 Subject: Encapsulate highlighting activation --- .../code/src/events/change_active_text_editor.ts | 25 ---------------------- editors/code/src/events/index.ts | 3 --- 2 files changed, 28 deletions(-) delete mode 100644 editors/code/src/events/change_active_text_editor.ts delete mode 100644 editors/code/src/events/index.ts (limited to 'editors/code/src/events') diff --git a/editors/code/src/events/change_active_text_editor.ts b/editors/code/src/events/change_active_text_editor.ts deleted file mode 100644 index 4384ee567..000000000 --- a/editors/code/src/events/change_active_text_editor.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { TextEditor } from 'vscode'; -import { TextDocumentIdentifier } from 'vscode-languageclient'; -import { Decoration } from '../highlighting'; -import { Server } from '../server'; - -export function makeHandler() { - return async function handle(editor: TextEditor | undefined) { - if (!editor || editor.document.languageId !== 'rust') { - return; - } - - if (!Server.config.highlightingOn) { - return; - } - - const params: TextDocumentIdentifier = { - uri: editor.document.uri.toString(), - }; - const decorations = await Server.client.sendRequest( - 'rust-analyzer/decorationsRequest', - params, - ); - Server.highlighter.setHighlights(editor, decorations); - }; -} diff --git a/editors/code/src/events/index.ts b/editors/code/src/events/index.ts deleted file mode 100644 index be135474d..000000000 --- a/editors/code/src/events/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as changeActiveTextEditor from './change_active_text_editor'; - -export { changeActiveTextEditor }; -- cgit v1.2.3