1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2025-01-29 01:28:45 +00:00
code-server-2/lib/vscode/extensions/python/src/pythonMain.ts

17 lines
716 B
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ExtensionContext, languages, IndentAction } from 'vscode';
export function activate(_context: ExtensionContext): any {
languages.setLanguageConfiguration('python', {
onEnterRules: [
{
beforeText: /^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,
action: { indentAction: IndentAction.Indent }
}
]
});
}