Skip to content

Commit

Permalink
replicate vshaxe onEnterRules since codedox overwrites them
Browse files Browse the repository at this point in the history
  • Loading branch information
wiggin77 committed Jan 1, 2020
1 parent 309775e commit 5256987
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Codedox change log

## 1.3.1

* replicate vshaxe onEnter rules as codedox overwrites them

## 1.3.0

* Update hxnodejs and node.js to fix warning "requires node.js version 4.0.0 or higher"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "codedox",
"displayname": "Codedox for Haxe",
"description": "JSDoc-style comments for Haxe. @param and @return tags, plus customizable file header license and copyright comments.",
"version": "1.3.0",
"version": "1.3.1",
"publisher": "wiggin77",
"license": "(MIT) View license in LICENSE.md",
"engines": {
Expand Down
11 changes: 9 additions & 2 deletions src/wiggin/codedox/EnterRules.hx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,15 @@ class EnterRules
// beforeText: ^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$
beforeText: new RegExp("^(\\t|(\\ \\ ))*\\ \\*[^/]*\\*\\/\\s*$"),
action: { indentAction: vscode.IndentAction.None, removeText: 1 }
}
#end
},
#end
{
// from vshaxe; we overwrite any vshaxe rules so any not already handled above
// need to be replicated here.
beforeText: new RegExp("^\\s*(\\bcase\\s.+:|\\bdefault:)\\s*$"),
afterText: new RegExp("^(?!\\s*(\\bcase\\b|\\bdefault\\b))"),
action: {indentAction: vscode.IndentAction.Indent},
}
];
CodeDox.log("onEnter rules for " + settings.strLanguage + ":");
CodeDox.log(onEnterRules);
Expand Down
7 changes: 6 additions & 1 deletion test/Test.hx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ class Test

public function paramInference(foo)
{

switch (true) {
case true: // check indentation when pressing enter `case true:|<enter>`
case false:
}
if (true)
false; // check indentation when pressing enter `false;|<enter>`
}

private function noBraces(i:Int) return switch(i) {
Expand Down

0 comments on commit 5256987

Please sign in to comment.