From deaa0580d952b77cf9e6df024d1f71ed29f53fc0 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Wed, 27 Jul 2022 16:34:14 +0200 Subject: chore: bump dependencies --- subprojects/frontend/src/editor/EditorParent.ts | 32 ++++++++--------- subprojects/frontend/src/editor/EditorStore.ts | 40 +++++++++++++--------- subprojects/frontend/src/editor/findOccurrences.ts | 3 +- .../frontend/src/editor/semanticHighlighting.ts | 5 ++- 4 files changed, 43 insertions(+), 37 deletions(-) (limited to 'subprojects/frontend/src/editor') diff --git a/subprojects/frontend/src/editor/EditorParent.ts b/subprojects/frontend/src/editor/EditorParent.ts index 94ca24ea..9aaf541a 100644 --- a/subprojects/frontend/src/editor/EditorParent.ts +++ b/subprojects/frontend/src/editor/EditorParent.ts @@ -119,48 +119,48 @@ export const EditorParent = styled('div')(({ theme }) => { borderColor: theme.palette.text.disabled, color: theme.palette.text.secondary, }, - '.cmt-comment': { + '.tok-comment': { fontStyle: 'italic', color: theme.palette.text.disabled, }, - '.cmt-number': { + '.tok-number': { color: '#6188a6', }, - '.cmt-string': { + '.tok-string': { color: theme.palette.secondary.dark, }, - '.cmt-keyword': { + '.tok-keyword': { color: theme.palette.primary.main, }, - '.cmt-typeName, .cmt-macroName, .cmt-atom': { + '.tok-typeName, .tok-macroName, .tok-atom': { color: theme.palette.text.primary, }, - '.cmt-variableName': { + '.tok-variableName': { color: '#c8ae9d', }, - '.cmt-problem-node': { - '&, & .cmt-variableName': { + '.tok-problem-node': { + '&, & .tok-variableName': { color: theme.palette.text.secondary, }, }, - '.cmt-problem-individual': { - '&, & .cmt-variableName': { + '.tok-problem-individual': { + '&, & .tok-variableName': { color: theme.palette.text.primary, }, }, - '.cmt-problem-abstract, .cmt-problem-new': { + '.tok-problem-abstract, .tok-problem-new': { fontStyle: 'italic', }, - '.cmt-problem-containment': { + '.tok-problem-containment': { fontWeight: 700, }, - '.cmt-problem-error': { - '&, & .cmt-typeName': { + '.tok-problem-error': { + '&, & .tok-typeName': { color: theme.palette.error.main, }, }, - '.cmt-problem-builtin': { - '&, & .cmt-typeName, & .cmt-atom, & .cmt-variableName': { + '.tok-problem-builtin': { + '&, & .tok-typeName, & .tok-atom, & .tok-variableName': { color: theme.palette.primary.main, fontWeight: 400, fontStyle: 'normal', diff --git a/subprojects/frontend/src/editor/EditorStore.ts b/subprojects/frontend/src/editor/EditorStore.ts index 5760de28..0f4d2936 100644 --- a/subprojects/frontend/src/editor/EditorStore.ts +++ b/subprojects/frontend/src/editor/EditorStore.ts @@ -1,27 +1,32 @@ -import { autocompletion, completionKeymap } from '@codemirror/autocomplete'; -import { closeBrackets, closeBracketsKeymap } from '@codemirror/closebrackets'; -import { defaultKeymap, indentWithTab } from '@codemirror/commands'; -import { commentKeymap } from '@codemirror/comment'; -import { foldGutter, foldKeymap } from '@codemirror/fold'; -import { highlightActiveLineGutter, lineNumbers } from '@codemirror/gutter'; -import { classHighlightStyle } from '@codemirror/highlight'; import { + closeBrackets, + closeBracketsKeymap, + autocompletion, + completionKeymap, +} from '@codemirror/autocomplete'; +import { + defaultKeymap, history, historyKeymap, + indentWithTab, redo, redoDepth, undo, undoDepth, -} from '@codemirror/history'; -import { indentOnInput } from '@codemirror/language'; +} from '@codemirror/commands'; +import { + bracketMatching, + foldGutter, + foldKeymap, + indentOnInput, + syntaxHighlighting, +} from '@codemirror/language'; import { Diagnostic, lintKeymap, setDiagnostics, } from '@codemirror/lint'; -import { bracketMatching } from '@codemirror/matchbrackets'; -import { rectangularSelection } from '@codemirror/rectangular-selection'; -import { searchConfig, searchKeymap } from '@codemirror/search'; +import { search, searchKeymap } from '@codemirror/search'; import { EditorState, StateCommand, @@ -33,9 +38,13 @@ import { drawSelection, EditorView, highlightActiveLine, + highlightActiveLineGutter, highlightSpecialChars, keymap, + lineNumbers, + rectangularSelection, } from '@codemirror/view'; +import { classHighlighter } from '@lezer/highlight'; import { makeAutoObservable, observable, @@ -91,7 +100,6 @@ export class EditorStore { (context) => this.client.contentAssist(context), ], }), - classHighlightStyle.extension, closeBrackets(), bracketMatching(), drawSelection(), @@ -106,10 +114,11 @@ export class EditorStore { history(), indentOnInput(), rectangularSelection(), - searchConfig({ + search({ top: true, - matchCase: true, + caseSensitive: true, }), + syntaxHighlighting(classHighlighter), semanticHighlighting, // We add the gutters to `extensions` in the order we want them to appear. lineNumbers(), @@ -117,7 +126,6 @@ export class EditorStore { keymap.of([ { key: 'Mod-Shift-f', run: () => this.formatText() }, ...closeBracketsKeymap, - ...commentKeymap, ...completionKeymap, ...foldKeymap, ...historyKeymap, diff --git a/subprojects/frontend/src/editor/findOccurrences.ts b/subprojects/frontend/src/editor/findOccurrences.ts index 92102746..c4a4e8ec 100644 --- a/subprojects/frontend/src/editor/findOccurrences.ts +++ b/subprojects/frontend/src/editor/findOccurrences.ts @@ -1,5 +1,4 @@ -import { Range, RangeSet } from '@codemirror/rangeset'; -import type { TransactionSpec } from '@codemirror/state'; +import { Range, RangeSet, type TransactionSpec } from '@codemirror/state'; import { Decoration } from '@codemirror/view'; import { decorationSetExtension } from './decorationSetExtension'; diff --git a/subprojects/frontend/src/editor/semanticHighlighting.ts b/subprojects/frontend/src/editor/semanticHighlighting.ts index 2aed421b..a5d0af7a 100644 --- a/subprojects/frontend/src/editor/semanticHighlighting.ts +++ b/subprojects/frontend/src/editor/semanticHighlighting.ts @@ -1,5 +1,4 @@ -import { RangeSet } from '@codemirror/rangeset'; -import type { TransactionSpec } from '@codemirror/state'; +import { RangeSet, type TransactionSpec } from '@codemirror/state'; import { Decoration } from '@codemirror/view'; import { decorationSetExtension } from './decorationSetExtension'; @@ -16,7 +15,7 @@ const [setSemanticHighlightingInternal, semanticHighlighting] = decorationSetExt export function setSemanticHighlighting(ranges: IHighlightRange[]): TransactionSpec { const rangeSet = RangeSet.of(ranges.map(({ from, to, classes }) => Decoration.mark({ - class: classes.map((c) => `cmt-problem-${c}`).join(' '), + class: classes.map((c) => `tok-problem-${c}`).join(' '), }).range(from, to)), true); return setSemanticHighlightingInternal(rangeSet); } -- cgit v1.2.3-54-g00ecf