mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Add VarDecl/VarAssignment/Switch/Case cases to alignSyntax
This commit is contained in:
parent
21b7b5255c
commit
8bb9f23035
@ -76,6 +76,14 @@ alignSyntax toJoinThese toNode getRange sources (infos :< syntax) = case syntax
|
||||
catMaybes $ wrapInBranch Indexed <$> alignBranch getRange (targetId <> methodId <> args) bothRanges
|
||||
Syntax.Args children ->
|
||||
catMaybes $ wrapInBranch Indexed <$> alignBranch getRange (join children) bothRanges
|
||||
Syntax.VarDecl decl ->
|
||||
catMaybes $ wrapInBranch Indexed <$> alignBranch getRange decl bothRanges
|
||||
Syntax.VarAssignment id value ->
|
||||
catMaybes $ wrapInBranch Indexed <$> alignBranch getRange (id <> value) bothRanges
|
||||
Switch expr cases ->
|
||||
catMaybes $ wrapInBranch Indexed <$> alignBranch getRange (expr <> join cases) bothRanges
|
||||
Case expr body ->
|
||||
catMaybes $ wrapInBranch Indexed <$> alignBranch getRange (expr <> body) bothRanges
|
||||
Fixed children -> catMaybes $ wrapInBranch Fixed <$> alignBranch getRange (join children) bothRanges
|
||||
Keyed children -> catMaybes $ wrapInBranch (Keyed . Map.fromList) <$> alignBranch (getRange . Prologue.snd) (Map.toList children >>= pairWithKey) bothRanges
|
||||
where bothRanges = modifyJoin (fromThese [] []) lineRanges
|
||||
|
Loading…
Reference in New Issue
Block a user