Skip to content

Commit 369eac4

Browse files
authored
Parser: fix range for computed binding expressions (#18903)
1 parent 0f9436d commit 369eac4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+44
-43
lines changed

docs/release-notes/.FSharp.Compiler.Service/10.0.100.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* Fix Show XML doc for enum fields in external metadata ([Issue #17939](https://github.com/dotnet/fsharp/issues/17939#issuecomment-3137410105), [PR #18800](https://github.com/dotnet/fsharp/pull/18800))
2525
* Fix nullable types formatting in `FSharpType.Format` and tooltips to include parentheses. ([PR #18842](https://github.com/dotnet/fsharp/pull/18842))
2626
* TypeMismatchDiagnosticExtendedData: fix expected and actual types calculation. ([Issue ](https://github.com/dotnet/fsharp/pull/18851))
27+
* Parser: fix range for computed binding expressions ([PR #18903](https://github.com/dotnet/fsharp/pull/18903))
2728

2829
### Changed
2930
* Use `errorR` instead of `error` in `CheckDeclarations.fs` when possible. ([PR #18645](https://github.com/dotnet/fsharp/pull/18645))

src/Compiler/SyntaxTree/ParseHelpers.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ let mkLetExpression
11051105
headPat = pat,
11061106
returnInfo = None,
11071107
expr = rhs,
1108-
range = mWhole,
1108+
range = unionRanges mKeyword rhs.Range,
11091109
debugPoint = spBind,
11101110
trivia = trivia
11111111
)

tests/service/data/SyntaxTree/ComputationExpression/MultipleSynExprAndBangHaveRangeThatStartsAtAndAndEndsAfterExpression.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ImplFile
2626
App
2727
(NonAtomic, false, Ident getBar,
2828
Const (Unit, (3,22--3,24)), (3,15--3,24)),
29-
(3,4--6,14), Yes (3,4--3,24),
29+
(3,4--3,24), Yes (3,4--3,24),
3030
{ LeadingKeyword = Let (3,4--3,8)
3131
InlineKeyword = None
3232
EqualsRange = Some (3,13--3,14) });

tests/service/data/SyntaxTree/ComputationExpression/SynExprAndBangRangeStartsAtAndAndEndsAfterExpression.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ImplFile
2626
App
2727
(NonAtomic, false, Ident getBar,
2828
Const (Unit, (3,22--3,24)), (3,15--3,24)),
29-
(3,4--7,14), Yes (3,4--3,24),
29+
(3,4--3,24), Yes (3,4--3,24),
3030
{ LeadingKeyword = Let (3,4--3,8)
3131
InlineKeyword = None
3232
EqualsRange = Some (3,13--3,14) });

tests/service/data/SyntaxTree/Expression/SynExprLetOrUseBangContainsTheRangeOfTheEqualsSign.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ImplFile
2020
SynValInfo ([], SynArgInfo ([], false, None)),
2121
None),
2222
Named (SynIdent (x, None), false, None, (3,9--3,10)),
23-
None, Ident y, (3,4--5,13), Yes (3,4--3,14),
23+
None, Ident y, (3,4--3,14), Yes (3,4--3,14),
2424
{ LeadingKeyword = Let (3,4--3,8)
2525
InlineKeyword = None
2626
EqualsRange = Some (3,11--3,12) });

tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ImplFile
2929
((false, true), Const (Int32 1, (4,35--4,36)),
3030
(4,28--4,36),
3131
{ YieldOrReturnKeyword = (4,28--4,34) }),
32-
(4,26--4,38)), (4,20--4,38)), (4,4--5,14),
32+
(4,26--4,38)), (4,20--4,38)), (4,4--4,38),
3333
Yes (4,4--4,38), { LeadingKeyword = Let (4,4--4,8)
3434
InlineKeyword = None
3535
EqualsRange = Some (4,18--4,19) })],

tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ImplFile
3131
((false, true), Const (Int32 1, (4,37--4,38)),
3232
(4,30--4,38),
3333
{ YieldOrReturnKeyword = (4,30--4,36) }),
34-
(4,28--4,40)), (4,22--4,40)), (4,4--5,14),
34+
(4,28--4,40)), (4,22--4,40)), (4,4--4,40),
3535
Yes (4,4--4,40), { LeadingKeyword = Let (4,4--4,8)
3636
InlineKeyword = None
3737
EqualsRange = Some (4,20--4,21) })],

tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ImplFile
8282
[(5,44--5,45)], (5,43--5,47)),
8383
(5,36--5,47),
8484
{ YieldOrReturnKeyword = (5,36--5,42) }),
85-
(5,34--5,49)), (5,28--5,49)), (5,4--6,24),
85+
(5,34--5,49)), (5,28--5,49)), (5,4--5,49),
8686
Yes (5,4--5,49),
8787
{ LeadingKeyword = Let (5,4--5,8)
8888
InlineKeyword = None

tests/service/data/SyntaxTree/SynType/Typed LetBang 05.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ImplFile
2323
((false, true), Const (Int32 1, (2,28--2,29)),
2424
(2,21--2,29),
2525
{ YieldOrReturnKeyword = (2,21--2,27) }),
26-
(2,19--2,31)), (2,13--2,31)), (2,0--3,33),
26+
(2,19--2,31)), (2,13--2,31)), (2,0--2,31),
2727
Yes (2,0--2,31), { LeadingKeyword = Let (2,0--2,4)
2828
InlineKeyword = None
2929
EqualsRange = Some (2,11--2,12) })],

tests/service/data/SyntaxTree/SynType/Typed LetBang 06.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ImplFile
2323
((false, true), Const (Int32 1, (2,28--2,29)),
2424
(2,21--2,29),
2525
{ YieldOrReturnKeyword = (2,21--2,27) }),
26-
(2,19--2,31)), (2,13--2,31)), (2,0--3,33),
26+
(2,19--2,31)), (2,13--2,31)), (2,0--2,31),
2727
Yes (2,0--2,31), { LeadingKeyword = Let (2,0--2,4)
2828
InlineKeyword = None
2929
EqualsRange = Some (2,11--2,12) })],

0 commit comments

Comments
 (0)