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/ValidationService.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'language-web/src/main/js/xtext/ValidationService.ts') diff --git a/language-web/src/main/js/xtext/ValidationService.ts b/language-web/src/main/js/xtext/ValidationService.ts index 163b5535..31c8f716 100644 --- a/language-web/src/main/js/xtext/ValidationService.ts +++ b/language-web/src/main/js/xtext/ValidationService.ts @@ -24,15 +24,20 @@ export class ValidationService { } const allChanges = this.updateService.computeChangesSinceLastUpdate(); const diagnostics: Diagnostic[] = []; - push.issues.forEach((issue) => { - if (issue.severity === 'ignore') { + push.issues.forEach(({ + offset, + length, + severity, + description, + }) => { + if (severity === 'ignore') { return; } diagnostics.push({ - from: allChanges.mapPos(issue.offset), - to: allChanges.mapPos(issue.offset + issue.length), - severity: issue.severity, - message: issue.description, + from: allChanges.mapPos(offset), + to: allChanges.mapPos(offset + length), + severity, + message: description, }); }); this.store.updateDiagnostics(diagnostics); -- cgit v1.2.3-70-g09d2