diff options
author | Adolfo OchagavĂa <[email protected]> | 2018-10-08 19:55:22 +0100 |
---|---|---|
committer | Adolfo OchagavĂa <[email protected]> | 2018-10-08 19:55:22 +0100 |
commit | bbf38b9e722e8d6455828ff22242c92219da346d (patch) | |
tree | 1b47f5e93e45a22cc20abd1c965dc496ef20bda9 /editors/code/src/notifications/publish_decorations.ts | |
parent | 62b1b05a0d9dd021f98352b6229e48e0d8b94f78 (diff) |
Add some comments
Diffstat (limited to 'editors/code/src/notifications/publish_decorations.ts')
-rw-r--r-- | editors/code/src/notifications/publish_decorations.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/editors/code/src/notifications/publish_decorations.ts b/editors/code/src/notifications/publish_decorations.ts new file mode 100644 index 000000000..d8790386b --- /dev/null +++ b/editors/code/src/notifications/publish_decorations.ts | |||
@@ -0,0 +1,20 @@ | |||
1 | import * as vscode from 'vscode'; | ||
2 | |||
3 | import { Decoration } from '../highlighting'; | ||
4 | import { Server } from '../server'; | ||
5 | |||
6 | export interface PublishDecorationsParams { | ||
7 | uri: string; | ||
8 | decorations: Decoration[]; | ||
9 | } | ||
10 | |||
11 | export function handle(params: PublishDecorationsParams) { | ||
12 | const targetEditor = vscode.window.visibleTextEditors.find( | ||
13 | (editor) => editor.document.uri.toString() === params.uri, | ||
14 | ); | ||
15 | if (!Server.config.highlightingOn || !targetEditor) { return; } | ||
16 | Server.highlighter.setHighlights( | ||
17 | targetEditor, | ||
18 | params.decorations, | ||
19 | ); | ||
20 | } | ||