aboutsummaryrefslogtreecommitdiffstats
path: root/language-web/src/main/js/xtext/HighlightingService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'language-web/src/main/js/xtext/HighlightingService.ts')
-rw-r--r--language-web/src/main/js/xtext/HighlightingService.ts12
1 files changed, 3 insertions, 9 deletions
diff --git a/language-web/src/main/js/xtext/HighlightingService.ts b/language-web/src/main/js/xtext/HighlightingService.ts
index fc3e9e53..dfbb4a19 100644
--- a/language-web/src/main/js/xtext/HighlightingService.ts
+++ b/language-web/src/main/js/xtext/HighlightingService.ts
@@ -1,10 +1,7 @@
1import type { EditorStore } from '../editor/EditorStore'; 1import type { EditorStore } from '../editor/EditorStore';
2import type { IHighlightRange } from '../editor/semanticHighlighting'; 2import type { IHighlightRange } from '../editor/semanticHighlighting';
3import type { UpdateService } from './UpdateService'; 3import type { UpdateService } from './UpdateService';
4import { getLogger } from '../utils/logger'; 4import { highlightingResult } from './xtextServiceResults';
5import { isHighlightingResult } from './xtextServiceResults';
6
7const log = getLogger('xtext.ValidationService');
8 5
9export class HighlightingService { 6export class HighlightingService {
10 private readonly store: EditorStore; 7 private readonly store: EditorStore;
@@ -17,13 +14,10 @@ export class HighlightingService {
17 } 14 }
18 15
19 onPush(push: unknown): void { 16 onPush(push: unknown): void {
20 if (!isHighlightingResult(push)) { 17 const { regions } = highlightingResult.parse(push);
21 log.error('Invalid highlighting result', push);
22 return;
23 }
24 const allChanges = this.updateService.computeChangesSinceLastUpdate(); 18 const allChanges = this.updateService.computeChangesSinceLastUpdate();
25 const ranges: IHighlightRange[] = []; 19 const ranges: IHighlightRange[] = [];
26 push.regions.forEach(({ offset, length, styleClasses }) => { 20 regions.forEach(({ offset, length, styleClasses }) => {
27 if (styleClasses.length === 0) { 21 if (styleClasses.length === 0) {
28 return; 22 return;
29 } 23 }