aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/xtext/XtextClient.ts
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/xtext/XtextClient.ts')
-rw-r--r--subprojects/frontend/src/xtext/XtextClient.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/subprojects/frontend/src/xtext/XtextClient.ts b/subprojects/frontend/src/xtext/XtextClient.ts
index 6351c9fd..c02afb3b 100644
--- a/subprojects/frontend/src/xtext/XtextClient.ts
+++ b/subprojects/frontend/src/xtext/XtextClient.ts
@@ -18,7 +18,7 @@ import type { XtextWebPushService } from './xtextMessages';
18const log = getLogger('xtext.XtextClient'); 18const log = getLogger('xtext.XtextClient');
19 19
20export default class XtextClient { 20export default class XtextClient {
21 private readonly webSocketClient: XtextWebSocketClient; 21 readonly webSocketClient: XtextWebSocketClient;
22 22
23 private readonly updateService: UpdateService; 23 private readonly updateService: UpdateService;
24 24
@@ -32,7 +32,8 @@ export default class XtextClient {
32 32
33 constructor(store: EditorStore) { 33 constructor(store: EditorStore) {
34 this.webSocketClient = new XtextWebSocketClient( 34 this.webSocketClient = new XtextWebSocketClient(
35 () => this.updateService.onReconnect(), 35 () => this.onReconnect(),
36 () => this.onDisconnect(),
36 (resource, stateId, service, push) => 37 (resource, stateId, service, push) =>
37 this.onPush(resource, stateId, service, push), 38 this.onPush(resource, stateId, service, push),
38 ); 39 );
@@ -46,6 +47,17 @@ export default class XtextClient {
46 this.occurrencesService = new OccurrencesService(store, this.updateService); 47 this.occurrencesService = new OccurrencesService(store, this.updateService);
47 } 48 }
48 49
50 private onReconnect(): void {
51 this.updateService.onReconnect();
52 this.occurrencesService.onReconnect();
53 }
54
55 private onDisconnect(): void {
56 this.highlightingService.onDisconnect();
57 this.validationService.onDisconnect();
58 this.occurrencesService.onDisconnect();
59 }
60
49 onTransaction(transaction: Transaction): void { 61 onTransaction(transaction: Transaction): void {
50 // `ContentAssistService.prototype.onTransaction` needs the dirty change desc 62 // `ContentAssistService.prototype.onTransaction` needs the dirty change desc
51 // _before_ the current edit, so we call it before `updateService`. 63 // _before_ the current edit, so we call it before `updateService`.