diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2021-11-16 17:09:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 17:09:58 +0100 |
commit | b4ba1dc1fec50a8114d49879dcb30891b8a8107e (patch) | |
tree | c40e4af57988becdcf7d363a2fb7107f668b8ba0 /language-web/src/main/js/xtext/ValidationService.ts | |
parent | chore(lang): fix Sonar issue (diff) | |
parent | feat(web): xtext formatter client (diff) | |
download | refinery-b4ba1dc1fec50a8114d49879dcb30891b8a8107e.tar.gz refinery-b4ba1dc1fec50a8114d49879dcb30891b8a8107e.tar.zst refinery-b4ba1dc1fec50a8114d49879dcb30891b8a8107e.zip |
Merge pull request #13 from kris7t/xtext-formatter
Xtext formatter support
Diffstat (limited to 'language-web/src/main/js/xtext/ValidationService.ts')
-rw-r--r-- | language-web/src/main/js/xtext/ValidationService.ts | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/language-web/src/main/js/xtext/ValidationService.ts b/language-web/src/main/js/xtext/ValidationService.ts index 8e4934ac..c7f6ac7f 100644 --- a/language-web/src/main/js/xtext/ValidationService.ts +++ b/language-web/src/main/js/xtext/ValidationService.ts | |||
@@ -3,9 +3,7 @@ import type { Diagnostic } from '@codemirror/lint'; | |||
3 | import type { EditorStore } from '../editor/EditorStore'; | 3 | import type { EditorStore } from '../editor/EditorStore'; |
4 | import type { UpdateService } from './UpdateService'; | 4 | import type { UpdateService } from './UpdateService'; |
5 | import { getLogger } from '../utils/logger'; | 5 | import { getLogger } from '../utils/logger'; |
6 | import { isValidationResult } from './xtextServiceResults'; | 6 | import { validationResult } from './xtextServiceResults'; |
7 | |||
8 | const log = getLogger('xtext.ValidationService'); | ||
9 | 7 | ||
10 | export class ValidationService { | 8 | export class ValidationService { |
11 | private readonly store: EditorStore; | 9 | private readonly store: EditorStore; |
@@ -18,13 +16,10 @@ export class ValidationService { | |||
18 | } | 16 | } |
19 | 17 | ||
20 | onPush(push: unknown): void { | 18 | onPush(push: unknown): void { |
21 | if (!isValidationResult(push)) { | 19 | const { issues } = validationResult.parse(push); |
22 | log.error('Invalid validation result', push); | ||
23 | return; | ||
24 | } | ||
25 | const allChanges = this.updateService.computeChangesSinceLastUpdate(); | 20 | const allChanges = this.updateService.computeChangesSinceLastUpdate(); |
26 | const diagnostics: Diagnostic[] = []; | 21 | const diagnostics: Diagnostic[] = []; |
27 | push.issues.forEach(({ | 22 | issues.forEach(({ |
28 | offset, | 23 | offset, |
29 | length, | 24 | length, |
30 | severity, | 25 | severity, |