aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/events
diff options
context:
space:
mode:
authorDaniel McNab <[email protected]>2018-10-08 22:38:33 +0100
committerDaniel McNab <[email protected]>2018-10-08 22:38:33 +0100
commite26071d96e1ff56289213dbe78415f836de8a70e (patch)
tree0d6d49b2eb40ad161a72adbfbf9874b64540bf74 /editors/code/src/events
parent3a405b65d61a5ad3176c223e4b7226a43fcd186e (diff)
Run prettier on all files
Diffstat (limited to 'editors/code/src/events')
-rw-r--r--editors/code/src/events/change_active_text_editor.ts15
-rw-r--r--editors/code/src/events/change_text_document.ts13
-rw-r--r--editors/code/src/events/index.ts5
3 files changed, 23 insertions, 10 deletions
diff --git a/editors/code/src/events/change_active_text_editor.ts b/editors/code/src/events/change_active_text_editor.ts
index 3440aa0c3..0b7ceb65d 100644
--- a/editors/code/src/events/change_active_text_editor.ts
+++ b/editors/code/src/events/change_active_text_editor.ts
@@ -5,10 +5,19 @@ import { Decoration } from '../highlighting';
5import { Server } from '../server'; 5import { Server } from '../server';
6 6
7export async function handle(editor: TextEditor | undefined) { 7export async function handle(editor: TextEditor | undefined) {
8 if (!Server.config.highlightingOn || !editor || editor.document.languageId !== 'rust') { return; } 8 if (
9 !Server.config.highlightingOn ||
10 !editor ||
11 editor.document.languageId !== 'rust'
12 ) {
13 return;
14 }
9 const params: TextDocumentIdentifier = { 15 const params: TextDocumentIdentifier = {
10 uri: editor.document.uri.toString(), 16 uri: editor.document.uri.toString()
11 }; 17 };
12 const decorations = await Server.client.sendRequest<Decoration[]>('m/decorationsRequest', params); 18 const decorations = await Server.client.sendRequest<Decoration[]>(
19 'm/decorationsRequest',
20 params
21 );
13 Server.highlighter.setHighlights(editor, decorations); 22 Server.highlighter.setHighlights(editor, decorations);
14} 23}
diff --git a/editors/code/src/events/change_text_document.ts b/editors/code/src/events/change_text_document.ts
index b3000e026..6be057245 100644
--- a/editors/code/src/events/change_text_document.ts
+++ b/editors/code/src/events/change_text_document.ts
@@ -1,11 +1,18 @@
1import * as vscode from 'vscode'; 1import * as vscode from 'vscode';
2 2
3import { syntaxTreeUri, TextDocumentContentProvider } from '../commands/syntaxTree'; 3import {
4 syntaxTreeUri,
5 TextDocumentContentProvider
6} from '../commands/syntaxTree';
4 7
5export function createHandler(textDocumentContentProvider: TextDocumentContentProvider) { 8export function createHandler(
9 textDocumentContentProvider: TextDocumentContentProvider
10) {
6 return (event: vscode.TextDocumentChangeEvent) => { 11 return (event: vscode.TextDocumentChangeEvent) => {
7 const doc = event.document; 12 const doc = event.document;
8 if (doc.languageId !== 'rust') { return; } 13 if (doc.languageId !== 'rust') {
14 return;
15 }
9 afterLs(() => { 16 afterLs(() => {
10 textDocumentContentProvider.eventEmitter.fire(syntaxTreeUri); 17 textDocumentContentProvider.eventEmitter.fire(syntaxTreeUri);
11 }); 18 });
diff --git a/editors/code/src/events/index.ts b/editors/code/src/events/index.ts
index b570a7a92..4c154563f 100644
--- a/editors/code/src/events/index.ts
+++ b/editors/code/src/events/index.ts
@@ -1,7 +1,4 @@
1import * as changeActiveTextEditor from './change_active_text_editor'; 1import * as changeActiveTextEditor from './change_active_text_editor';
2import * as changeTextDocument from './change_text_document'; 2import * as changeTextDocument from './change_text_document';
3 3
4export { 4export { changeActiveTextEditor, changeTextDocument };
5 changeActiveTextEditor,
6 changeTextDocument,
7};