-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Oleksii Orel <[email protected]>
- Loading branch information
Showing
8 changed files
with
384 additions
and
157 deletions.
There are no files selected for viewing
236 changes: 118 additions & 118 deletions
236
.yarn/releases/yarn-3.8.3.cjs → .yarn/releases/yarn-3.8.6.cjs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
packages/dashboard-frontend/src/components/DevfileViewer/codemirror.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2018-2024 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
|
||
import { closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete'; | ||
import { defaultKeymap } from '@codemirror/commands'; | ||
import { yaml } from '@codemirror/lang-yaml'; | ||
import { | ||
bracketMatching, | ||
defaultHighlightStyle, | ||
foldGutter, | ||
foldKeymap, | ||
syntaxHighlighting, | ||
} from '@codemirror/language'; | ||
import { highlightSelectionMatches, searchKeymap } from '@codemirror/search'; | ||
import { EditorState, Extension } from '@codemirror/state'; | ||
import { | ||
crosshairCursor, | ||
drawSelection, | ||
dropCursor, | ||
highlightActiveLine, | ||
highlightActiveLineGutter, | ||
highlightSpecialChars, | ||
keymap, | ||
lineNumbers, | ||
rectangularSelection, | ||
} from '@codemirror/view'; | ||
|
||
export const basicSetup: Extension = (() => [ | ||
lineNumbers(), | ||
highlightActiveLineGutter(), | ||
highlightSpecialChars(), | ||
foldGutter(), | ||
drawSelection(), | ||
dropCursor(), | ||
syntaxHighlighting(defaultHighlightStyle, { fallback: true }), | ||
bracketMatching(), | ||
closeBrackets(), | ||
rectangularSelection(), | ||
crosshairCursor(), | ||
highlightActiveLine(), | ||
highlightSelectionMatches(), | ||
keymap.of([...closeBracketsKeymap, ...defaultKeymap, ...searchKeymap, ...foldKeymap]), | ||
EditorState.readOnly.of(true), | ||
yaml(), | ||
])(); | ||
|
||
export { EditorView } from '@codemirror/view'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.