Skip to content

Commit

Permalink
Fix auto-indent regex rules (#562)
Browse files Browse the repository at this point in the history
* Basic tokenizer

* Fixed property names

* Tests, round I

* Tests, round II

* tokenizer test

* Remove temorary change

* Fix merge issue

* Merge conflict

* Merge conflict

* Completion test

* Fix last line

* Fix javascript math

* Make test await for results

* Add license headers

* Rename definitions to types

* License headers

* Fix typo in completion details (typo)

* Fix hover test

* Russian translations

* Update to better translation

* Fix typo

*  #70 How to get all parameter info when filling in a function param list

* Fix #70 How to get all parameter info when filling in a function param list

* Clean up

* Clean imports

* CR feedback

* Trim whitespace for test stability

* More tests

* Better handle no-parameters documentation

* Better handle ellipsis and Python3

* #385 Auto-Indentation doesn't work after comment

* #141 Auto indentation broken when return keyword involved

* Undo changes
  • Loading branch information
Mikhail Arkhipov authored Jan 10, 2018
1 parent d421dd3 commit fb99423
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,17 @@ export async function activate(context: vscode.ExtensionContext) {
vscode.languages.setLanguageConfiguration(PYTHON.language!, {
onEnterRules: [
{
beforeText: /^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,
beforeText: /^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async)\b.*/,
action: { indentAction: vscode.IndentAction.Indent }
},
{
beforeText: /^ *#.*$/,
beforeText: /^\s*#.*/,
afterText: /.+$/,
action: { indentAction: vscode.IndentAction.None, appendText: '# ' }
},
{
beforeText: /^\s+(continue|break|return)\b.*$/,
beforeText: /^\s+(continue|break|return)\b.*/,
afterText: /\s+$/,
action: { indentAction: vscode.IndentAction.Outdent }
}
]
Expand Down

0 comments on commit fb99423

Please sign in to comment.