-
Notifications
You must be signed in to change notification settings - Fork 830
Closed
Description
Is your feature request related to a problem? Please describe.
Consider the following code:
let examineData x =
match data with
| OnePartData( // foo
part1 = p1
(* bar *) ) -> p1
| TwoPartData(part1 = p1; part2=p2) -> p1 + p2and relevant AST:
NamePatPairs
([(part1, tmp.fsx (4,14--4,15),
Named
(SynIdent (p1, None), false, None,
tmp.fsx (4,16--4,18)))], tmp.fsx (4,8--5,17))It would be nice if we had the ranges of the parentheses as trivia.
Describe the solution you'd like
Add SynArgPatsNamePatPairsTrivia that contains both ranges.
We might also want to consider updating the range of SynArgPats.NamePatPairs to include the parentheses.
Although I'm not hellbent on that specifically.
Describe alternatives you've considered
There is no real way of detecting the parentheses.
Additional context
related: #11481
Surfaced in fsprojects/fantomas#2541
//cc @dsyme, @auduchinok