aboutsummaryrefslogtreecommitdiffstats
path: root/language-web/src/main/js/editor/semanticHighlighting.ts
diff options
context:
space:
mode:
Diffstat (limited to 'language-web/src/main/js/editor/semanticHighlighting.ts')
-rw-r--r--language-web/src/main/js/editor/semanticHighlighting.ts24
1 files changed, 0 insertions, 24 deletions
diff --git a/language-web/src/main/js/editor/semanticHighlighting.ts b/language-web/src/main/js/editor/semanticHighlighting.ts
deleted file mode 100644
index 2aed421b..00000000
--- a/language-web/src/main/js/editor/semanticHighlighting.ts
+++ /dev/null
@@ -1,24 +0,0 @@
1import { RangeSet } from '@codemirror/rangeset';
2import type { TransactionSpec } from '@codemirror/state';
3import { Decoration } from '@codemirror/view';
4
5import { decorationSetExtension } from './decorationSetExtension';
6
7export interface IHighlightRange {
8 from: number;
9
10 to: number;
11
12 classes: string[];
13}
14
15const [setSemanticHighlightingInternal, semanticHighlighting] = decorationSetExtension();
16
17export function setSemanticHighlighting(ranges: IHighlightRange[]): TransactionSpec {
18 const rangeSet = RangeSet.of(ranges.map(({ from, to, classes }) => Decoration.mark({
19 class: classes.map((c) => `cmt-problem-${c}`).join(' '),
20 }).range(from, to)), true);
21 return setSemanticHighlightingInternal(rangeSet);
22}
23
24export { semanticHighlighting };