aboutsummaryrefslogtreecommitdiffstats
path: root/language-web/src/main/js/editor/EditorStore.ts
diff options
context:
space:
mode:
Diffstat (limited to 'language-web/src/main/js/editor/EditorStore.ts')
-rw-r--r--language-web/src/main/js/editor/EditorStore.ts5
1 files changed, 4 insertions, 1 deletions
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 {
41import { getLogger } from '../logging'; 41import { getLogger } from '../logging';
42import { problemLanguageSupport } from './problemLanguageSupport'; 42import { problemLanguageSupport } from './problemLanguageSupport';
43import type { ThemeStore } from '../theme/ThemeStore'; 43import type { ThemeStore } from '../theme/ThemeStore';
44import { XtextClient } from './XtextClient';
44 45
45const log = getLogger('EditorStore'); 46const log = getLogger('EditorStore');
46 47
@@ -49,7 +50,7 @@ export class EditorStore {
49 50
50 state: EditorState; 51 state: EditorState;
51 52
52 emptyHistory: unknown; 53 client: XtextClient;
53 54
54 showLineNumbers = false; 55 showLineNumbers = false;
55 56
@@ -109,6 +110,7 @@ export class EditorStore {
109 problemLanguageSupport(), 110 problemLanguageSupport(),
110 ], 111 ],
111 }); 112 });
113 this.client = new XtextClient(this);
112 reaction( 114 reaction(
113 () => this.themeStore.darkMode, 115 () => this.themeStore.darkMode,
114 (darkMode) => { 116 (darkMode) => {
@@ -137,6 +139,7 @@ export class EditorStore {
137 onTransaction(tr: Transaction): void { 139 onTransaction(tr: Transaction): void {
138 log.trace('Editor transaction', tr); 140 log.trace('Editor transaction', tr);
139 this.state = tr.state; 141 this.state = tr.state;
142 this.client.onTransaction(tr);
140 } 143 }
141 144
142 dispatch(...specs: readonly TransactionSpec[]): void { 145 dispatch(...specs: readonly TransactionSpec[]): void {