From 8280cee9780cb48bc72c2a313e2f635e8e733032 Mon Sep 17 00:00:00 2001 From: isc-bsaviano Date: Tue, 2 Nov 2021 09:23:56 -0400 Subject: [PATCH] Add `onEnterRules` for ObjectScript --- src/languageConfiguration.ts | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/languageConfiguration.ts b/src/languageConfiguration.ts index 0ed74d59..42a4c801 100644 --- a/src/languageConfiguration.ts +++ b/src/languageConfiguration.ts @@ -19,10 +19,34 @@ export function getLanguageConfiguration(lang: string): LanguageConfiguration { ? [ { beforeText: /^\/\/\//, - afterText: /.*/, action: { indentAction: IndentAction.None, appendText: "/// " }, }, ] - : [], + : [ + { + beforeText: /^\s\/\/\//, + action: { indentAction: IndentAction.None, appendText: "/// " }, + }, + { + beforeText: /^\s\/\/[^/]?/, + action: { indentAction: IndentAction.None, appendText: "// " }, + }, + { + beforeText: /^\s;;/, + action: { indentAction: IndentAction.None, appendText: ";; " }, + }, + { + beforeText: /^\s;[^;]?/, + action: { indentAction: IndentAction.None, appendText: "; " }, + }, + { + beforeText: /^\s#;/, + action: { indentAction: IndentAction.None, appendText: "#; " }, + }, + { + beforeText: /^\s##;/, + action: { indentAction: IndentAction.None, appendText: "##; " }, + }, + ], }; }