Skip to content

Commit

Permalink
Fixed not increasing indent for one line if
Browse files Browse the repository at this point in the history
Fixed #34
  • Loading branch information
JustusAdam committed Jun 29, 2017
1 parent 0eb32a1 commit 28eab26
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.2.3 - unreleased

- Adapted increaseIndentPattern to skip keywords followed by `'`
- Fixed terminating type signatures on `else`, `then` etc.
- Fixed not increasing indent for one line `if`

## 2.2.2 - 27.06.2017

- Fixed highlighting for `where` keyword in GADT definition
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function activate(context: vscode.ExtensionContext) {

indentationRules: {
// ^.*\{[^}"']*$
increaseIndentPattern: /(\bif\b(?!').*|\b(then|else|m?do|of|let|in|where)\b(?!')|=|->|>>=|>=>|=<<|(^(data)( |\t)+(\w|')+( |\t)*))( |\t)*$/,
increaseIndentPattern: /(\bif\b(?!')(.(?!then))*|\b(then|else|m?do|of|let|in|where)\b(?!')|=|->|>>=|>=>|=<<|(^(data)( |\t)+(\w|')+( |\t)*))( |\t)*$/,
decreaseIndentPattern: null
},
wordPattern: /([\w'_][\w'_\d]*)|([0-9]+\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)/
Expand Down
8 changes: 5 additions & 3 deletions test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ someFunc = do
a `func` b
a :: Bool <- something
if a then b :: Int else g
case a :: Bool of
Nothing -> b
case (a :: Bool) of
Nothing -> b
return 6
where
ident = 4
Expand All @@ -61,7 +61,9 @@ explicitRecDo = do

anotherFunc :: MyData -> Int
anotherFunc arg =
let something = "hello" :: String in expression
let something = "hello" :: String
in case a :: B of
Just _ -> g

where
expression argument = arg + 7
Expand Down

0 comments on commit 28eab26

Please sign in to comment.