ソースを参照

Merge pull request #3058 from remcohaszing/yaml-indent-action

Add yaml indent action
Henning Dieterichs 3 年 前
コミット
e57709f4d9
1 ファイル変更10 行追加2 行削除
  1. 10 2
      src/basic-languages/yaml/yaml.ts

+ 10 - 2
src/basic-languages/yaml/yaml.ts

@@ -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>{