import { ExtensionContext , languages , IndentAction } from 'vscode' ; export function activate ( _context ) { languages . setLanguageConfiguration ( 'python' , { onEnterRules : [ { beforeText : /^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/ , action : { indentAction : IndentAction . Indent } } ] } ) ; }