From cbf442d8fd9f72c567ebf9f036a219a9ff100487 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sat, 30 Oct 2021 20:14:50 +0200 Subject: feat(web): semantic highlighting --- language-web/src/main/js/xtext/XtextClient.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'language-web/src/main/js/xtext/XtextClient.ts') diff --git a/language-web/src/main/js/xtext/XtextClient.ts b/language-web/src/main/js/xtext/XtextClient.ts index 7683a8ef..ccb58ab4 100644 --- a/language-web/src/main/js/xtext/XtextClient.ts +++ b/language-web/src/main/js/xtext/XtextClient.ts @@ -6,6 +6,7 @@ import type { Transaction } from '@codemirror/state'; import type { EditorStore } from '../editor/EditorStore'; import { ContentAssistService } from './ContentAssistService'; +import { HighlightingService } from './HighlightingService'; import { UpdateService } from './UpdateService'; import { getLogger } from '../utils/logger'; import { ValidationService } from './ValidationService'; @@ -20,6 +21,8 @@ export class XtextClient { private contentAssistService: ContentAssistService; + private highlightingService: HighlightingService; + private validationService: ValidationService; constructor(store: EditorStore) { @@ -29,6 +32,7 @@ export class XtextClient { ); this.updateService = new UpdateService(store, this.webSocketClient); this.contentAssistService = new ContentAssistService(this.updateService); + this.highlightingService = new HighlightingService(store, this.updateService); this.validationService = new ValidationService(store, this.updateService); } @@ -50,12 +54,12 @@ export class XtextClient { await this.updateService.updateFullText(); } switch (service) { + case 'highlight': + this.highlightingService.onPush(push); + return; case 'validate': this.validationService.onPush(push); return; - case 'highlight': - // TODO - return; default: log.error('Unknown push service:', service); break; -- cgit v1.2.3-54-g00ecf