看了下 vscode python 的
languages.setLanguageConfiguration(PYTHON_LANGUAGE, {
onEnterRules: [
{
beforeText: /^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async)\b.*:\s*/,
action: { indentAction: IndentAction.Indent }
},
{
beforeText: /^(?!\s+\\)[^#\n]+\\\s*/,
action: { indentAction: IndentAction.Indent }
},
{
beforeText: /^\s*#.*/,
afterText: /.+$/,
action: { indentAction: IndentAction.None, appendText: '# ' }
},
{
beforeText: /^\s+(continue|break|return)\b.*/,
afterText: /\s+$/,
action: { indentAction: IndentAction.Outdent }
}
]
});
感觉有点问题呀,
比如def __init__(self, name=None,
按 enter 之后没有缩进?没有办法直接缩进到(
这里吗?
而且他这个东西怎么处理多行 def 呢
def __init__(self, method=None,
uri=None,
version=None,
headers=None):
这个样子缩进有问题呀