Add yaml indent action
If a line ends with `:` and a user presses Enter, they are probably defining an object, which requires indentation. This rule is taken from `monaco-yaml`, but I intend to remove basic language support there, since that’s already part of `monaco-editor`.pull/3058/head
parent
55edb3fc58
commit
8e34418a64
|
@ -1,4 +1,4 @@
|
|||
import type { languages } from '../../fillers/monaco-editor-core';
|
||||
import { languages } from '../../fillers/monaco-editor-core';
|
||||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
comments: {
|
||||
|
@ -25,7 +25,15 @@ export const conf: languages.LanguageConfiguration = {
|
|||
],
|
||||
folding: {
|
||||
offSide: true
|
||||
}
|
||||
},
|
||||
onEnterRules: [
|
||||
{
|
||||
beforeText: /:\s*$/,
|
||||
action: {
|
||||
indentAction: languages.IndentAction.Indent
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const language = <languages.IMonarchLanguage>{
|
||||
|
|
Loading…
Reference in New Issue