aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/editor/DiagnosticValue.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-11-01 12:05:21 -0400
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-11-05 19:41:33 +0100
commitffe5b08149681f51625bdac43c7ab41ccf5f9cc3 (patch)
treef19137f20c73613ed8d4e63a725e4a1d20a00ec2 /subprojects/frontend/src/editor/DiagnosticValue.ts
parentfeat(frontend): overlay scrollbars for editor (diff)
downloadrefinery-ffe5b08149681f51625bdac43c7ab41ccf5f9cc3.tar.gz
refinery-ffe5b08149681f51625bdac43c7ab41ccf5f9cc3.tar.zst
refinery-ffe5b08149681f51625bdac43c7ab41ccf5f9cc3.zip
feat(frontend): scrollbar annotations
Diffstat (limited to 'subprojects/frontend/src/editor/DiagnosticValue.ts')
-rw-r--r--subprojects/frontend/src/editor/DiagnosticValue.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/subprojects/frontend/src/editor/DiagnosticValue.ts b/subprojects/frontend/src/editor/DiagnosticValue.ts
new file mode 100644
index 00000000..ad23c467
--- /dev/null
+++ b/subprojects/frontend/src/editor/DiagnosticValue.ts
@@ -0,0 +1,20 @@
1import type { Diagnostic } from '@codemirror/lint';
2import { RangeValue } from '@codemirror/state';
3
4export default class DiagnosticValue extends RangeValue {
5 static VALUES: Record<Diagnostic['severity'], DiagnosticValue> = {
6 error: new DiagnosticValue('error'),
7 warning: new DiagnosticValue('warning'),
8 info: new DiagnosticValue('info'),
9 };
10
11 private constructor(public readonly severity: Diagnostic['severity']) {
12 super();
13 }
14
15 override point = true;
16
17 override eq(other: RangeValue): boolean {
18 return other instanceof DiagnosticValue && other.severity === this.severity;
19 }
20}