1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-11-28 08:48:48 +02:00

Автоотступ после Пока, Цикл, Если, Тогда, Попытка resolves #88

This commit is contained in:
salexdv 2021-05-12 14:53:35 +03:00
parent c5dff61860
commit 3dab1bdca7
2 changed files with 11 additions and 2 deletions

View File

@ -462,6 +462,9 @@ define([], function () {
codeLenses: {
provider: () => {},
resolver: () => {}
},
indentationRules: {
increaseIndentPattern: /^\s*(функция|function|процедура|procedure|если|if|пока|while|для|for|попытка|try|исключение|except).*$/i
}
},
query: {
@ -510,7 +513,8 @@ define([], function () {
codeLenses: {
provider: () => {},
resolver: () => {}
}
},
indentationRules: null
},
dcs: {
languageDef: dcs_language,
@ -556,7 +560,8 @@ define([], function () {
codeLenses: {
provider: () => {},
resolver: () => {}
}
},
indentationRules: null
}
};

View File

@ -1024,6 +1024,9 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
resolveCodeLens: lang.codeLenses.resolver
});
if (lang.indentationRules)
monaco.languages.setLanguageConfiguration(language.id, {indentationRules: lang.indentationRules});
if (!editor) {
for (const [key, value] of Object.entries(language.themes)) {
@ -1039,6 +1042,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
wordBasedSuggestions: false,
scrollBeyondLastLine: false,
insertSpaces: false,
autoIndent: true,
customOptions: true
});