diff options
Diffstat (limited to 'language-web/src/main/js/xtext/HighlightingService.ts')
-rw-r--r-- | language-web/src/main/js/xtext/HighlightingService.ts | 12 |
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 @@ | |||
1 | import type { EditorStore } from '../editor/EditorStore'; | 1 | import type { EditorStore } from '../editor/EditorStore'; |
2 | import type { IHighlightRange } from '../editor/semanticHighlighting'; | 2 | import type { IHighlightRange } from '../editor/semanticHighlighting'; |
3 | import type { UpdateService } from './UpdateService'; | 3 | import type { UpdateService } from './UpdateService'; |
4 | import { getLogger } from '../utils/logger'; | 4 | import { highlightingResult } from './xtextServiceResults'; |
5 | import { isHighlightingResult } from './xtextServiceResults'; | ||
6 | |||
7 | const log = getLogger('xtext.ValidationService'); | ||
8 | 5 | ||
9 | export class HighlightingService { | 6 | export 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 | } |