mirror of https://github.com/portainer/portainer
fix(editor): remove yaml specific highlighting [r8s-441] (#1010)
parent
8fe5eaee29
commit
3ee20863d6
|
@ -46,6 +46,10 @@ export const theme = createTheme({
|
||||||
selectionMatch: 'var(--bg-codemirror-selected-color)',
|
selectionMatch: 'var(--bg-codemirror-selected-color)',
|
||||||
},
|
},
|
||||||
styles: [
|
styles: [
|
||||||
|
{
|
||||||
|
tag: [highlightTags.propertyName, highlightTags.attributeName],
|
||||||
|
color: 'var(--text-cm-default-color)',
|
||||||
|
},
|
||||||
{ tag: highlightTags.atom, color: 'var(--text-cm-default-color)' },
|
{ tag: highlightTags.atom, color: 'var(--text-cm-default-color)' },
|
||||||
{ tag: highlightTags.meta, color: 'var(--text-cm-meta-color)' },
|
{ tag: highlightTags.meta, color: 'var(--text-cm-meta-color)' },
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,16 +2,11 @@ import { useMemo } from 'react';
|
||||||
import {
|
import {
|
||||||
StreamLanguage,
|
StreamLanguage,
|
||||||
LanguageSupport,
|
LanguageSupport,
|
||||||
syntaxHighlighting,
|
|
||||||
indentService,
|
indentService,
|
||||||
} from '@codemirror/language';
|
} from '@codemirror/language';
|
||||||
import { dockerFile } from '@codemirror/legacy-modes/mode/dockerfile';
|
import { dockerFile } from '@codemirror/legacy-modes/mode/dockerfile';
|
||||||
import { shell } from '@codemirror/legacy-modes/mode/shell';
|
import { shell } from '@codemirror/legacy-modes/mode/shell';
|
||||||
import {
|
import { keymap, Extension } from '@uiw/react-codemirror';
|
||||||
oneDarkHighlightStyle,
|
|
||||||
keymap,
|
|
||||||
Extension,
|
|
||||||
} from '@uiw/react-codemirror';
|
|
||||||
import type { JSONSchema7 } from 'json-schema';
|
import type { JSONSchema7 } from 'json-schema';
|
||||||
import { lintKeymap, lintGutter } from '@codemirror/lint';
|
import { lintKeymap, lintGutter } from '@codemirror/lint';
|
||||||
import { defaultKeymap } from '@codemirror/commands';
|
import { defaultKeymap } from '@codemirror/commands';
|
||||||
|
@ -45,7 +40,6 @@ function yamlLanguage(schema?: JSONSchema7) {
|
||||||
linter,
|
linter,
|
||||||
stateExtensions,
|
stateExtensions,
|
||||||
yamlIndentExtension,
|
yamlIndentExtension,
|
||||||
syntaxHighlighting(oneDarkHighlightStyle),
|
|
||||||
// explicitly setting lineNumbers() as an extension ensures that the gutter order is the same between the diff viewer and the code editor
|
// explicitly setting lineNumbers() as an extension ensures that the gutter order is the same between the diff viewer and the code editor
|
||||||
lineNumbers(),
|
lineNumbers(),
|
||||||
!!schema && lintGutter(),
|
!!schema && lintGutter(),
|
||||||
|
|
Loading…
Reference in New Issue