From dcbfeece5e559b60a615f0aa9b933b202d34bf8b Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Mon, 25 Oct 2021 00:29:37 +0200 Subject: feat(web): add xtext websocket client --- language-web/src/main/js/editor/EditorStore.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'language-web/src/main/js/editor/EditorStore.ts') diff --git a/language-web/src/main/js/editor/EditorStore.ts b/language-web/src/main/js/editor/EditorStore.ts index eb358338..31bb0a11 100644 --- a/language-web/src/main/js/editor/EditorStore.ts +++ b/language-web/src/main/js/editor/EditorStore.ts @@ -41,6 +41,7 @@ import { import { getLogger } from '../logging'; import { problemLanguageSupport } from './problemLanguageSupport'; import type { ThemeStore } from '../theme/ThemeStore'; +import { XtextClient } from './XtextClient'; const log = getLogger('EditorStore'); @@ -49,7 +50,7 @@ export class EditorStore { state: EditorState; - emptyHistory: unknown; + client: XtextClient; showLineNumbers = false; @@ -109,6 +110,7 @@ export class EditorStore { problemLanguageSupport(), ], }); + this.client = new XtextClient(this); reaction( () => this.themeStore.darkMode, (darkMode) => { @@ -137,6 +139,7 @@ export class EditorStore { onTransaction(tr: Transaction): void { log.trace('Editor transaction', tr); this.state = tr.state; + this.client.onTransaction(tr); } dispatch(...specs: readonly TransactionSpec[]): void { -- cgit v1.2.3-70-g09d2