From 408765e2346f6ef0b3f105952fd8cc06c9d79186 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Mon, 17 Jun 2024 09:35:03 -0700 Subject: [PATCH] [FUSE] Fix code folding (#10459) * Split trailing whitespace and newlines from block-based directives into their own node * Add extra tests and a doc --- docs/Parsing.md | 61 +++++++++ .../Legacy/CSharpToMarkupSwitchTest.cs | 126 +++++++++++++++++- ..._SingleLineControlFlowStatement.cspans.txt | 14 +- ...s_SingleLineControlFlowStatement.stree.txt | 13 +- ...eLineControlFlowStatement_Error.cspans.txt | 12 +- ...leLineControlFlowStatement_Error.stree.txt | 13 +- ...ionsBlock_CanContainCurlyBraces.cspans.txt | 12 +- ...tionsBlock_CanContainCurlyBraces.stree.txt | 13 +- ...lock_DoesNotParseMarkupInString.cspans.txt | 14 +- ...Block_DoesNotParseMarkupInString.stree.txt | 13 +- ...sNotParseMarkupInVerbatimString.cspans.txt | 14 +- ...esNotParseMarkupInVerbatimString.stree.txt | 13 +- ...ck_DoesNotParseWhenNotSupported.cspans.txt | 14 +- ...ock_DoesNotParseWhenNotSupported.stree.txt | 13 +- ...sBlock_MarkupCanContainTemplate.cspans.txt | 12 +- ...nsBlock_MarkupCanContainTemplate.stree.txt | 13 +- ...sBlock_ParsesMarkupInsideMethod.cspans.txt | 12 +- ...nsBlock_ParsesMarkupInsideMethod.stree.txt | 13 +- ...rsesMarkupWithExpressionsMethod.cspans.txt | 14 +- ...arsesMarkupWithExpressionsMethod.stree.txt | 13 +- ...ordsInFunctionsBlock_WithMarkup.cspans.txt | 12 +- ...wordsInFunctionsBlock_WithMarkup.stree.txt | 13 +- ...CodeBlocksTrailingWhitespace_01.cspans.txt | 8 ++ .../CodeBlocksTrailingWhitespace_01.stree.txt | 24 ++++ ...CodeBlocksTrailingWhitespace_02.cspans.txt | 7 + .../CodeBlocksTrailingWhitespace_02.stree.txt | 23 ++++ ...CodeBlocksTrailingWhitespace_03.cspans.txt | 13 ++ .../CodeBlocksTrailingWhitespace_03.stree.txt | 30 +++++ ...CodeBlocksTrailingWhitespace_04.cspans.txt | 13 ++ .../CodeBlocksTrailingWhitespace_04.stree.txt | 30 +++++ ...CodeBlocksTrailingWhitespace_05.cspans.txt | 16 +++ .../CodeBlocksTrailingWhitespace_05.stree.txt | 45 +++++++ ...CodeBlocksTrailingWhitespace_06.cspans.txt | 12 ++ .../CodeBlocksTrailingWhitespace_06.stree.txt | 38 ++++++ ...CodeBlocksTrailingWhitespace_07.cspans.txt | 11 ++ .../CodeBlocksTrailingWhitespace_07.stree.txt | 38 ++++++ ...CodeBlocksTrailingWhitespace_08.cspans.txt | 11 ++ .../CodeBlocksTrailingWhitespace_08.stree.txt | 38 ++++++ ...CodeBlocksTrailingWhitespace_09.cspans.txt | 10 ++ .../CodeBlocksTrailingWhitespace_09.stree.txt | 36 +++++ .../TagHelpersInSection_Runtime.ir.txt | 2 +- ..._SingleLineControlFlowStatement.cspans.txt | 14 +- ...s_SingleLineControlFlowStatement.stree.txt | 13 +- ...eLineControlFlowStatement_Error.cspans.txt | 12 +- ...leLineControlFlowStatement_Error.stree.txt | 13 +- ...ionsBlock_CanContainCurlyBraces.cspans.txt | 12 +- ...tionsBlock_CanContainCurlyBraces.stree.txt | 13 +- ...lock_DoesNotParseMarkupInString.cspans.txt | 14 +- ...Block_DoesNotParseMarkupInString.stree.txt | 13 +- ...sNotParseMarkupInVerbatimString.cspans.txt | 14 +- ...esNotParseMarkupInVerbatimString.stree.txt | 13 +- ...ck_DoesNotParseWhenNotSupported.cspans.txt | 14 +- ...ock_DoesNotParseWhenNotSupported.stree.txt | 13 +- ...sBlock_MarkupCanContainTemplate.cspans.txt | 12 +- ...nsBlock_MarkupCanContainTemplate.stree.txt | 13 +- ...sBlock_ParsesMarkupInsideMethod.cspans.txt | 12 +- ...nsBlock_ParsesMarkupInsideMethod.stree.txt | 13 +- ...rsesMarkupWithExpressionsMethod.cspans.txt | 14 +- ...arsesMarkupWithExpressionsMethod.stree.txt | 13 +- ...ordsInFunctionsBlock_WithMarkup.cspans.txt | 12 +- ...wordsInFunctionsBlock_WithMarkup.stree.txt | 13 +- .../src/Language/Legacy/CSharpCodeParser.cs | 28 ++-- 62 files changed, 853 insertions(+), 287 deletions(-) create mode 100644 docs/Parsing.md create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_01.cspans.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_01.stree.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_02.cspans.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_02.stree.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_03.cspans.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_03.stree.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_04.cspans.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_04.stree.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_05.cspans.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_05.stree.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_06.cspans.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_06.stree.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_07.cspans.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_07.stree.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_08.cspans.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_08.stree.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_09.cspans.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_09.stree.txt diff --git a/docs/Parsing.md b/docs/Parsing.md new file mode 100644 index 0000000000..a5208c9e52 --- /dev/null +++ b/docs/Parsing.md @@ -0,0 +1,61 @@ +# Introduction + +This doc aims to keep a list of decisions that have been made around how razor syntax is parsed into a syntax tree. + +## Whitespace handling + +Whitespace handling is currently differently parsed depending on the chosen emit strategy (runtime or design time). + +When in DesignTime whitespace between a CSharp and HTML node is generally parsed as an HTML node, whereas in Runtime the whitespace is parsed as part of a CSharp node. This ensures that at runtime arbitrary whitespace isn't incorrectly emitted as part of the HTML, but in design time the editor will only identify the actual code portion as being CSharp. + +An example of this can be seen here: + +As part of the transition to use only runtime code generation, we had to make some subtle changes to the parsing of whitespace to ensure that the existing behavior in the editor continues to function as before. + +Specifically we changed the parsing of trailing whitespace of razor code block directives (i.e. `@code`, `@function` and `@section`). Previously the whitespace was attached to a meta node that included the closing `}` + +Using `^` to indicate whitespace: + +```csharp +@code { + // code +}^^^ + +``` + +This would previously be conceptually parsed as something like: + +```text +CSharpCode + RazorDirective + CSharpTransition + RazorDirectiveBody + RazorMetaCode + Identifier + CSharpCode + ... + RazorMetaCode + Literal: } + Literal: ^^^\r\n +``` + +Thus when looking at the length of the RazorDirective, it includes the `^^^\r\n`. This causes issues with editor features like code folding. The user only want to fold the directive, not the directive and the following new line. (see ) + +Instead, we now break the trailing whitespace into its own RazorMetaCode node, which is not a part of the directive itself. Conceptually something like: + +```text +CSharpCode + RazorDirective + CSharpTransition + RazorDirectiveBody + RazorMetaCode + Identifier + CSharpCode + ... + RazorMetaCode + Literal: } + RazorMetaCode + Literal: ^^^\r\n +``` + +In this way we keep the whitespace as belonging to the overall CSharpCode node, but don't make it part of the directive itself, ensuring the editor sees the correct length for the directive. \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/Legacy/CSharpToMarkupSwitchTest.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/Legacy/CSharpToMarkupSwitchTest.cs index 6801f84416..5ca8a54f47 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/Legacy/CSharpToMarkupSwitchTest.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/Legacy/CSharpToMarkupSwitchTest.cs @@ -3,7 +3,8 @@ #nullable disable -using System; +using Microsoft.AspNetCore.Razor.Language.Components; +using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Legacy; @@ -244,4 +245,127 @@ public class CSharpToMarkupSwitchTest() : ParserTestBase(layer: TestProject.Laye } """); } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_01() + { + ParseDocumentTest(""" + @code { + } + + """, [ComponentCodeDirective.Directive]); + } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_02() + { + ParseDocumentTest(""" + @code{ + } + + """, [ComponentCodeDirective.Directive]); + } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_03() + { + ParseDocumentTest(""" + @code{ + } @* comment *@ + + """, [ComponentCodeDirective.Directive]); + } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_04() + { + ParseDocumentTest(""" + @code{ + } + @* comment *@ + + """, [ComponentCodeDirective.Directive]); + } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_05() + { + ParseDocumentTest(""" + @code { + } + + @code { + } + + """, [ComponentCodeDirective.Directive]); + } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_06() + { + ParseDocumentTest(""" + @code { + } + +
+ + """, [ComponentCodeDirective.Directive]); + } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_07() + { + ParseDocumentTest(""" + @code { + + } +
+ + """, [ComponentCodeDirective.Directive]); + } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_08() + { + ParseDocumentTest(""" + @code { + + }
+ + """, [ComponentCodeDirective.Directive]); + } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_09() + { + ParseDocumentTest(""" + @code { + + }
+ + """, [ComponentCodeDirective.Directive]); + } + + [Fact, WorkItem("https://github.com/dotnet/razor/issues/10358")] + public void CodeBlocksTrailingWhitespace_10() + { + var tree1 = ParseDocument(""" + @code{ + } + + """, + directives: [ComponentCodeDirective.Directive]); + + var codeBlock = tree1.Root.ChildNodes()[0].ChildNodes()[1]; + Assert.Equal("CSharpCodeBlockSyntax at 0::11", codeBlock.ToString()); + + var children = codeBlock.ChildNodes(); + Assert.Equal(2, children.Count); + + var directive = children[0]; + Assert.Equal("RazorDirectiveSyntax at 0::9", directive.ToString()); + + var whitespace = children[1]; + Assert.Equal("RazorMetaCodeSyntax at 9::2", whitespace.ToString()); + } } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.cspans.txt index 1b389ff260..86160ee1cc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [147] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [145] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [145] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [145] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [145] ) -Code span at (14:1,12 [130] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [145] ) -MetaCode span at (144:6,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [145] ) -Markup span at (147:7,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [147] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [143] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [143] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [143] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [143] ) +Code span at (14:1,12 [130] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [143] ) +MetaCode span at (144:6,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [143] ) +MetaCode span at (145:6,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [145] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt index 60d7cd3e58..156cb156d2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..147)::145 - RazorDirective - [2..147)::145 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..145)::143 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..147)::144 + RazorDirectiveBody - [3..145)::142 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..147)::135 + CSharpCodeBlock - [12..145)::133 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -55,9 +55,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [144..147)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [144..145)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [147..147)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [145..147)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.cspans.txt index b4a7753531..29bddd1330 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [408] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [406] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [406] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [406] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [406] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [404] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [404] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [404] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [404] ) Code span at (14:1,12 [88] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [391] ) Markup span at (102:4,32 [3] ) (Accepts:None) - Parent: Tag block at (102:4,32 [3] ) Markup span at (105:4,35 [9] ) (Accepts:Any) - Parent: Markup block at (102:4,32 [26] ) @@ -25,5 +25,5 @@ Markup span at (313:11,33 [6] ) (Accepts:None) - Parent: Markup block at (292:11 Code span at (319:12,0 [31] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [391] ) Code span at (350:13,29 [1] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [391] ) Code span at (351:13,30 [54] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [391] ) -MetaCode span at (405:15,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [406] ) -Markup span at (408:16,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [408] ) +MetaCode span at (405:15,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [404] ) +MetaCode span at (406:15,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [406] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt index 287ce9bd8f..c23a15a0f1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..408)::406 - RazorDirective - [2..408)::406 - Directive:{functions;CodeBlock;Unrestricted} [RZ1008(102:4,32 [1] ), RZ1008(206:8,12 [1] ), RZ1008(292:11,12 [2] ), RZ1008(350:13,29 [2] )] + RazorDirective - [2..406)::404 - Directive:{functions;CodeBlock;Unrestricted} [RZ1008(102:4,32 [1] ), RZ1008(206:8,12 [1] ), RZ1008(292:11,12 [2] ), RZ1008(350:13,29 [2] )] CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..408)::405 + RazorDirectiveBody - [3..406)::403 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..408)::396 + CSharpCodeBlock - [12..406)::394 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -186,9 +186,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [405..408)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [405..406)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [408..408)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [406..408)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.cspans.txt index 94294b20e0..2861a56b7e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [210] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [208] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [208] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [208] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [208] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [206] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [206] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [206] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [206] ) Code span at (14:1,12 [47] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [193] ) Markup span at (61:4,0 [8] ) (Accepts:Any) - Parent: Markup block at (61:4,0 [139] ) Markup span at (69:4,8 [5] ) (Accepts:None) - Parent: Tag block at (69:4,8 [5] ) @@ -22,5 +22,5 @@ Markup span at (184:9,0 [8] ) (Accepts:Any) - Parent: Markup block at (61:4,0 [1 Markup span at (192:9,8 [6] ) (Accepts:None) - Parent: Tag block at (192:9,8 [6] ) Markup span at (198:9,14 [2] ) (Accepts:None) - Parent: Markup block at (61:4,0 [139] ) Code span at (200:10,0 [7] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [193] ) -MetaCode span at (207:11,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [208] ) -Markup span at (210:12,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [210] ) +MetaCode span at (207:11,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [206] ) +MetaCode span at (208:11,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [208] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt index 112ed84cd1..778fa41206 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..210)::208 - RazorDirective - [2..210)::208 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..208)::206 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..210)::207 + RazorDirectiveBody - [3..208)::205 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..210)::198 + CSharpCodeBlock - [12..208)::196 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -105,9 +105,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [207..210)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [207..208)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [210..210)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [208..210)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.cspans.txt index ff72a74afa..009b50934e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [81] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [79] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [79] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [79] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [79] ) -Code span at (14:1,12 [64] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [79] ) -MetaCode span at (78:3,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [79] ) -Markup span at (81:4,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [81] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [77] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [77] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [77] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [77] ) +Code span at (14:1,12 [64] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [77] ) +MetaCode span at (78:3,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [77] ) +MetaCode span at (79:3,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [79] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt index 7107ae3e74..fff3b440cc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..81)::79 - RazorDirective - [2..81)::79 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..79)::77 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..81)::78 + RazorDirectiveBody - [3..79)::76 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..81)::69 + CSharpCodeBlock - [12..79)::67 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -32,9 +32,8 @@ StringLiteral;["

@message

"]; Semicolon;[;]; NewLine;[LF]; - RazorMetaCode - [78..81)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [78..79)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [81..81)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [79..81)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.cspans.txt index 0b5a1010ff..19395d2697 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [82] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [80] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [80] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [80] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [80] ) -Code span at (14:1,12 [65] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [80] ) -MetaCode span at (79:3,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [80] ) -Markup span at (82:4,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [82] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [78] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [78] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [78] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [78] ) +Code span at (14:1,12 [65] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [78] ) +MetaCode span at (79:3,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [78] ) +MetaCode span at (80:3,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [80] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt index e932dff0c3..aa5240fc19 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..82)::80 - RazorDirective - [2..82)::80 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..80)::78 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..82)::79 + RazorDirectiveBody - [3..80)::77 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..82)::70 + CSharpCodeBlock - [12..80)::68 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -32,9 +32,8 @@ StringLiteral;[@"

@message

"]; Semicolon;[;]; NewLine;[LF]; - RazorMetaCode - [79..82)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [79..80)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [82..82)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [80..82)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.cspans.txt index 7391d141b7..b31420bbf4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [98] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [96] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [96] ) -Code span at (14:1,12 [81] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (95:6,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [96] ) -Markup span at (98:7,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [98] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [94] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [94] ) +Code span at (14:1,12 [81] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (95:6,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (96:6,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [96] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt index d31cd03e4a..5785041790 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..98)::96 - RazorDirective - [2..98)::96 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..96)::94 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..98)::95 + RazorDirectiveBody - [3..96)::93 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..98)::86 + CSharpCodeBlock - [12..96)::84 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -44,9 +44,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [95..98)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [95..96)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [98..98)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [96..98)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.cspans.txt index 3c2028fd8a..ce6e2d9622 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [220] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [218] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [218] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [218] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [218] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [216] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [216] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [216] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [216] ) Code span at (14:1,12 [47] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [203] ) Markup span at (61:4,0 [8] ) (Accepts:Any) - Parent: Markup block at (61:4,0 [149] ) Markup span at (69:4,8 [5] ) (Accepts:None) - Parent: Tag block at (69:4,8 [5] ) @@ -21,5 +21,5 @@ Markup span at (194:9,0 [8] ) (Accepts:Any) - Parent: Markup block at (61:4,0 [1 Markup span at (202:9,8 [6] ) (Accepts:None) - Parent: Tag block at (202:9,8 [6] ) Markup span at (208:9,14 [2] ) (Accepts:None) - Parent: Markup block at (61:4,0 [149] ) Code span at (210:10,0 [7] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [203] ) -MetaCode span at (217:11,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [218] ) -Markup span at (220:12,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [220] ) +MetaCode span at (217:11,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [216] ) +MetaCode span at (218:11,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [218] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt index f42b3905d9..18d8fbe929 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..220)::218 - RazorDirective - [2..220)::218 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..218)::216 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..220)::217 + RazorDirectiveBody - [3..218)::215 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..220)::208 + CSharpCodeBlock - [12..218)::206 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -110,9 +110,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [217..220)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [217..218)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [220..220)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [218..220)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.cspans.txt index 5b87da26ef..7bed01ac15 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [98] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [96] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [96] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [94] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [94] ) Code span at (14:1,12 [47] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [81] ) Markup span at (61:4,0 [8] ) (Accepts:Any) - Parent: Markup block at (61:4,0 [27] ) Markup span at (69:4,8 [4] ) (Accepts:None) - Parent: Tag block at (69:4,8 [4] ) @@ -12,5 +12,5 @@ Code span at (74:4,13 [7] ) (Accepts:NonWhitespace) - Parent: Expression block a Markup span at (81:4,20 [5] ) (Accepts:None) - Parent: Tag block at (81:4,20 [5] ) Markup span at (86:4,25 [2] ) (Accepts:None) - Parent: Markup block at (61:4,0 [27] ) Code span at (88:5,0 [7] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [81] ) -MetaCode span at (95:6,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [96] ) -Markup span at (98:7,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [98] ) +MetaCode span at (95:6,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (96:6,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [96] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.stree.txt index 50360ca0cc..5ba7409aab 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..98)::96 - RazorDirective - [2..98)::96 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..96)::94 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..98)::95 + RazorDirectiveBody - [3..96)::93 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..98)::86 + CSharpCodeBlock - [12..96)::84 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -59,9 +59,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [95..98)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [95..96)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [98..98)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [96..98)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.cspans.txt index 33e5778064..003e1aa9ed 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [78] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [76] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [76] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [76] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [76] ) -Code span at (14:1,12 [61] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [76] ) -MetaCode span at (75:3,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [76] ) -Markup span at (78:4,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [78] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [74] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [74] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [74] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [74] ) +Code span at (14:1,12 [61] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [74] ) +MetaCode span at (75:3,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [74] ) +MetaCode span at (76:3,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [76] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt index e17cfa466c..51bf5a826e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..78)::76 - RazorDirective - [2..78)::76 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..76)::74 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..78)::75 + RazorDirectiveBody - [3..76)::73 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..78)::66 + CSharpCodeBlock - [12..76)::64 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -38,9 +38,8 @@ Identifier;[h3]; GreaterThan;[>]; NewLine;[LF]; - RazorMetaCode - [75..78)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [75..76)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [78..78)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [76..78)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.cspans.txt index 4c00812e27..9c21a38049 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [140] ) -Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [138] ) -MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [138] ) -None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [138] ) -MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [138] ) +Transition span at (2:1,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [136] ) +MetaCode span at (3:1,1 [9] ) (Accepts:None) - Parent: Directive block at (2:1,0 [136] ) +None span at (12:1,10 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (2:1,0 [136] ) +MetaCode span at (13:1,11 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [136] ) Code span at (14:1,12 [73] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [123] ) Markup span at (87:6,0 [12] ) (Accepts:Any) - Parent: Markup block at (87:6,0 [32] ) Markup span at (99:6,12 [3] ) (Accepts:None) - Parent: Tag block at (99:6,12 [3] ) @@ -10,5 +10,5 @@ Markup span at (102:6,15 [11] ) (Accepts:Any) - Parent: Markup block at (87:6,0 Markup span at (113:6,26 [4] ) (Accepts:None) - Parent: Tag block at (113:6,26 [4] ) Markup span at (117:6,30 [2] ) (Accepts:None) - Parent: Markup block at (87:6,0 [32] ) Code span at (119:7,0 [18] ) (Accepts:Any) - Parent: Statement block at (14:1,12 [123] ) -MetaCode span at (137:9,0 [3] ) (Accepts:None) - Parent: Directive block at (2:1,0 [138] ) -Markup span at (140:10,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [140] ) +MetaCode span at (137:9,0 [1] ) (Accepts:None) - Parent: Directive block at (2:1,0 [136] ) +MetaCode span at (138:9,1 [2] ) (Accepts:Any) - Parent: Statement block at (2:1,0 [138] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.stree.txt index 18428840a9..f302d2837c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any NewLine;[LF]; CSharpCodeBlock - [2..140)::138 - RazorDirective - [2..140)::138 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..138)::136 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [3..140)::137 + RazorDirectiveBody - [3..138)::135 RazorMetaCode - [3..12)::9 - Gen - SpanEditHandler;Accepts:None Identifier;[functions]; - CSharpCodeBlock - [12..140)::128 + CSharpCodeBlock - [12..138)::126 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd @@ -66,9 +66,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [137..140)::3 - Gen - SpanEditHandler;Accepts:None + RazorMetaCode - [137..138)::1 - Gen - SpanEditHandler;Accepts:None RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [140..140)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [138..140)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_01.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_01.cspans.txt new file mode 100644 index 0000000000..ff98fff55e --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_01.cspans.txt @@ -0,0 +1,8 @@ +Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [12] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (1:0,1 [4] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +None span at (5:0,5 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (6:0,6 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +Code span at (7:0,7 [2] ) (Accepts:Any) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (9:1,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (10:1,1 [2] ) (Accepts:Any) - Parent: Statement block at (0:0,0 [12] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_01.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_01.stree.txt new file mode 100644 index 0000000000..80acd438ee --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_01.stree.txt @@ -0,0 +1,24 @@ +RazorDocument - [0..12)::12 - [@code {LF}LF] + MarkupBlock - [0..12)::12 + MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any + Marker;[]; + CSharpCodeBlock - [0..12)::12 + RazorDirective - [0..10)::10 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [1..10)::9 + RazorMetaCode - [1..5)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [5..10)::5 + UnclassifiedTextLiteral - [5..6)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace + Whitespace;[ ]; + RazorMetaCode - [6..7)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [7..9)::2 + CSharpStatementLiteral - [7..9)::2 - [LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + RazorMetaCode - [9..10)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + RazorMetaCode - [10..12)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_02.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_02.cspans.txt new file mode 100644 index 0000000000..eabd8f89d6 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_02.cspans.txt @@ -0,0 +1,7 @@ +Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [31] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (1:0,1 [4] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (5:0,5 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +Code span at (6:0,6 [2] ) (Accepts:Any) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (8:1,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (9:1,1 [22] ) (Accepts:Any) - Parent: Statement block at (0:0,0 [31] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_02.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_02.stree.txt new file mode 100644 index 0000000000..35b4601072 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_02.stree.txt @@ -0,0 +1,23 @@ +RazorDocument - [0..31)::31 - [@code{LF} LF] + MarkupBlock - [0..31)::31 + MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any + Marker;[]; + CSharpCodeBlock - [0..31)::31 + RazorDirective - [0..9)::9 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [1..9)::8 + RazorMetaCode - [1..5)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [5..9)::4 + RazorMetaCode - [5..6)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [6..8)::2 + CSharpStatementLiteral - [6..8)::2 - [LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + RazorMetaCode - [8..9)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + RazorMetaCode - [9..31)::22 - Gen - SpanEditHandler;Accepts:Any + Whitespace;[ ]; + NewLine;[LF]; + EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_03.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_03.cspans.txt new file mode 100644 index 0000000000..f3c2f6c543 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_03.cspans.txt @@ -0,0 +1,13 @@ +Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [44] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (1:0,1 [4] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (5:0,5 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +Code span at (6:0,6 [2] ) (Accepts:Any) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (8:1,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +Markup span at (9:1,1 [20] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [44] ) +Transition span at (29:1,21 [1] ) (Accepts:None) - Parent: Comment block at (29:1,21 [13] ) +MetaCode span at (30:1,22 [1] ) (Accepts:None) - Parent: Comment block at (29:1,21 [13] ) +Comment span at (31:1,23 [9] ) (Accepts:Any) - Parent: Comment block at (29:1,21 [13] ) +MetaCode span at (40:1,32 [1] ) (Accepts:None) - Parent: Comment block at (29:1,21 [13] ) +Transition span at (41:1,33 [1] ) (Accepts:None) - Parent: Comment block at (29:1,21 [13] ) +Markup span at (42:1,34 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [44] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_03.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_03.stree.txt new file mode 100644 index 0000000000..50369916fb --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_03.stree.txt @@ -0,0 +1,30 @@ +RazorDocument - [0..44)::44 - [@code{LF} @* comment *@LF] + MarkupBlock - [0..44)::44 + MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any + Marker;[]; + CSharpCodeBlock - [0..9)::9 + RazorDirective - [0..9)::9 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [1..9)::8 + RazorMetaCode - [1..5)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [5..9)::4 + RazorMetaCode - [5..6)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [6..8)::2 + CSharpStatementLiteral - [6..8)::2 - [LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + RazorMetaCode - [8..9)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + MarkupTextLiteral - [9..29)::20 - [ ] - Gen - SpanEditHandler;Accepts:Any + Whitespace;[ ]; + RazorComment - [29..42)::13 + RazorCommentTransition;[@]; + RazorCommentStar;[*]; + RazorCommentLiteral;[ comment ]; + RazorCommentStar;[*]; + RazorCommentTransition;[@]; + MarkupTextLiteral - [42..44)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_04.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_04.cspans.txt new file mode 100644 index 0000000000..746d31a456 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_04.cspans.txt @@ -0,0 +1,13 @@ +Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [26] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (1:0,1 [4] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (5:0,5 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +Code span at (6:0,6 [2] ) (Accepts:Any) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (8:1,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [9] ) +MetaCode span at (9:1,1 [2] ) (Accepts:Any) - Parent: Statement block at (0:0,0 [11] ) +Transition span at (11:2,0 [1] ) (Accepts:None) - Parent: Comment block at (11:2,0 [13] ) +MetaCode span at (12:2,1 [1] ) (Accepts:None) - Parent: Comment block at (11:2,0 [13] ) +Comment span at (13:2,2 [9] ) (Accepts:Any) - Parent: Comment block at (11:2,0 [13] ) +MetaCode span at (22:2,11 [1] ) (Accepts:None) - Parent: Comment block at (11:2,0 [13] ) +Transition span at (23:2,12 [1] ) (Accepts:None) - Parent: Comment block at (11:2,0 [13] ) +Markup span at (24:2,13 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [26] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_04.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_04.stree.txt new file mode 100644 index 0000000000..3313bd5280 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_04.stree.txt @@ -0,0 +1,30 @@ +RazorDocument - [0..26)::26 - [@code{LF}LF@* comment *@LF] + MarkupBlock - [0..26)::26 + MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any + Marker;[]; + CSharpCodeBlock - [0..11)::11 + RazorDirective - [0..9)::9 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [1..9)::8 + RazorMetaCode - [1..5)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [5..9)::4 + RazorMetaCode - [5..6)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [6..8)::2 + CSharpStatementLiteral - [6..8)::2 - [LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + RazorMetaCode - [8..9)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + RazorMetaCode - [9..11)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + RazorComment - [11..24)::13 + RazorCommentTransition;[@]; + RazorCommentStar;[*]; + RazorCommentLiteral;[ comment ]; + RazorCommentStar;[*]; + RazorCommentTransition;[@]; + MarkupEphemeralTextLiteral - [24..26)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_05.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_05.cspans.txt new file mode 100644 index 0000000000..8300c7f985 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_05.cspans.txt @@ -0,0 +1,16 @@ +Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [26] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (1:0,1 [4] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +None span at (5:0,5 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (6:0,6 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +Code span at (7:0,7 [2] ) (Accepts:Any) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (9:1,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (10:1,1 [2] ) (Accepts:Any) - Parent: Statement block at (0:0,0 [12] ) +Markup span at (12:2,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [26] ) +Transition span at (14:3,0 [1] ) (Accepts:None) - Parent: Directive block at (14:3,0 [10] ) +MetaCode span at (15:3,1 [4] ) (Accepts:None) - Parent: Directive block at (14:3,0 [10] ) +None span at (19:3,5 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (14:3,0 [10] ) +MetaCode span at (20:3,6 [1] ) (Accepts:None) - Parent: Directive block at (14:3,0 [10] ) +Code span at (21:3,7 [2] ) (Accepts:Any) - Parent: Directive block at (14:3,0 [10] ) +MetaCode span at (23:4,0 [1] ) (Accepts:None) - Parent: Directive block at (14:3,0 [10] ) +MetaCode span at (24:4,1 [2] ) (Accepts:Any) - Parent: Statement block at (14:3,0 [12] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_05.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_05.stree.txt new file mode 100644 index 0000000000..65f6b67490 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_05.stree.txt @@ -0,0 +1,45 @@ +RazorDocument - [0..26)::26 - [@code {LF}LFLF@code {LF}LF] + MarkupBlock - [0..26)::26 + MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any + Marker;[]; + CSharpCodeBlock - [0..12)::12 + RazorDirective - [0..10)::10 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [1..10)::9 + RazorMetaCode - [1..5)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [5..10)::5 + UnclassifiedTextLiteral - [5..6)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace + Whitespace;[ ]; + RazorMetaCode - [6..7)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [7..9)::2 + CSharpStatementLiteral - [7..9)::2 - [LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + RazorMetaCode - [9..10)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + RazorMetaCode - [10..12)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + MarkupTextLiteral - [12..14)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + CSharpCodeBlock - [14..26)::12 + RazorDirective - [14..24)::10 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [14..15)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [15..24)::9 + RazorMetaCode - [15..19)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [19..24)::5 + UnclassifiedTextLiteral - [19..20)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace + Whitespace;[ ]; + RazorMetaCode - [20..21)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [21..23)::2 + CSharpStatementLiteral - [21..23)::2 - [LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + RazorMetaCode - [23..24)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + RazorMetaCode - [24..26)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_06.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_06.cspans.txt new file mode 100644 index 0000000000..05180e557a --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_06.cspans.txt @@ -0,0 +1,12 @@ +Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [27] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (1:0,1 [4] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +None span at (5:0,5 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (6:0,6 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +Code span at (7:0,7 [2] ) (Accepts:Any) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (9:1,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (10:1,1 [2] ) (Accepts:Any) - Parent: Statement block at (0:0,0 [12] ) +Markup span at (12:2,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [27] ) +Markup span at (14:3,0 [5] ) (Accepts:Any) - Parent: Tag block at (14:3,0 [5] ) +Markup span at (19:3,5 [6] ) (Accepts:Any) - Parent: Tag block at (19:3,5 [6] ) +Markup span at (25:3,11 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [27] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_06.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_06.stree.txt new file mode 100644 index 0000000000..189c5e5859 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_06.stree.txt @@ -0,0 +1,38 @@ +RazorDocument - [0..27)::27 - [@code {LF}LFLF
LF] + MarkupBlock - [0..27)::27 + MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any + Marker;[]; + CSharpCodeBlock - [0..12)::12 + RazorDirective - [0..10)::10 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [1..10)::9 + RazorMetaCode - [1..5)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [5..10)::5 + UnclassifiedTextLiteral - [5..6)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace + Whitespace;[ ]; + RazorMetaCode - [6..7)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [7..9)::2 + CSharpStatementLiteral - [7..9)::2 - [LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + RazorMetaCode - [9..10)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + RazorMetaCode - [10..12)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + MarkupTextLiteral - [12..14)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + MarkupElement - [14..25)::11 + MarkupStartTag - [14..19)::5 - [
] - Gen - SpanEditHandler;Accepts:Any + OpenAngle;[<]; + Text;[div]; + CloseAngle;[>]; + MarkupEndTag - [19..25)::6 - [
] - Gen - SpanEditHandler;Accepts:Any + OpenAngle;[<]; + ForwardSlash;[/]; + Text;[div]; + CloseAngle;[>]; + MarkupTextLiteral - [25..27)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_07.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_07.cspans.txt new file mode 100644 index 0000000000..f63e43a845 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_07.cspans.txt @@ -0,0 +1,11 @@ +Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [30] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (1:0,1 [4] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +None span at (5:0,5 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (6:0,6 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +Code span at (7:0,7 [7] ) (Accepts:Any) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (14:2,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (15:2,1 [2] ) (Accepts:Any) - Parent: Statement block at (0:0,0 [17] ) +Markup span at (17:3,0 [5] ) (Accepts:Any) - Parent: Tag block at (17:3,0 [5] ) +Markup span at (22:3,5 [6] ) (Accepts:Any) - Parent: Tag block at (22:3,5 [6] ) +Markup span at (28:3,11 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [30] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_07.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_07.stree.txt new file mode 100644 index 0000000000..16e0ce6a55 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_07.stree.txt @@ -0,0 +1,38 @@ +RazorDocument - [0..30)::30 - [@code {LF LF}LF
LF] + MarkupBlock - [0..30)::30 + MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any + Marker;[]; + CSharpCodeBlock - [0..17)::17 + RazorDirective - [0..15)::15 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [1..15)::14 + RazorMetaCode - [1..5)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [5..15)::10 + UnclassifiedTextLiteral - [5..6)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace + Whitespace;[ ]; + RazorMetaCode - [6..7)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [7..14)::7 + CSharpStatementLiteral - [7..14)::7 - [LF LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + Whitespace;[ ]; + NewLine;[LF]; + RazorMetaCode - [14..15)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + RazorMetaCode - [15..17)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + MarkupElement - [17..28)::11 + MarkupStartTag - [17..22)::5 - [
] - Gen - SpanEditHandler;Accepts:Any + OpenAngle;[<]; + Text;[div]; + CloseAngle;[>]; + MarkupEndTag - [22..28)::6 - [
] - Gen - SpanEditHandler;Accepts:Any + OpenAngle;[<]; + ForwardSlash;[/]; + Text;[div]; + CloseAngle;[>]; + MarkupTextLiteral - [28..30)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_08.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_08.cspans.txt new file mode 100644 index 0000000000..261a48fbc7 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_08.cspans.txt @@ -0,0 +1,11 @@ +Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [34] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (1:0,1 [4] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +None span at (5:0,5 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (6:0,6 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +Code span at (7:0,7 [7] ) (Accepts:Any) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (14:2,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +Markup span at (15:2,1 [6] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [34] ) +Markup span at (21:2,7 [5] ) (Accepts:Any) - Parent: Tag block at (21:2,7 [5] ) +Markup span at (26:2,12 [6] ) (Accepts:Any) - Parent: Tag block at (26:2,12 [6] ) +Markup span at (32:2,18 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [34] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_08.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_08.stree.txt new file mode 100644 index 0000000000..d2086905e3 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_08.stree.txt @@ -0,0 +1,38 @@ +RazorDocument - [0..34)::34 - [@code {LF LF}
LF] + MarkupBlock - [0..34)::34 + MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any + Marker;[]; + CSharpCodeBlock - [0..15)::15 + RazorDirective - [0..15)::15 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [1..15)::14 + RazorMetaCode - [1..5)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [5..15)::10 + UnclassifiedTextLiteral - [5..6)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace + Whitespace;[ ]; + RazorMetaCode - [6..7)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [7..14)::7 + CSharpStatementLiteral - [7..14)::7 - [LF LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + Whitespace;[ ]; + NewLine;[LF]; + RazorMetaCode - [14..15)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + MarkupTextLiteral - [15..21)::6 - [ ] - Gen - SpanEditHandler;Accepts:Any + Whitespace;[ ]; + MarkupElement - [21..32)::11 + MarkupStartTag - [21..26)::5 - [
] - Gen - SpanEditHandler;Accepts:Any + OpenAngle;[<]; + Text;[div]; + CloseAngle;[>]; + MarkupEndTag - [26..32)::6 - [
] - Gen - SpanEditHandler;Accepts:Any + OpenAngle;[<]; + ForwardSlash;[/]; + Text;[div]; + CloseAngle;[>]; + MarkupTextLiteral - [32..34)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_09.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_09.cspans.txt new file mode 100644 index 0000000000..e70f9e801d --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_09.cspans.txt @@ -0,0 +1,10 @@ +Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [28] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (1:0,1 [4] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +None span at (5:0,5 [1] ) (Accepts:AllWhitespace) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (6:0,6 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +Code span at (7:0,7 [7] ) (Accepts:Any) - Parent: Directive block at (0:0,0 [15] ) +MetaCode span at (14:2,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [15] ) +Markup span at (15:2,1 [5] ) (Accepts:Any) - Parent: Tag block at (15:2,1 [5] ) +Markup span at (20:2,6 [6] ) (Accepts:Any) - Parent: Tag block at (20:2,6 [6] ) +Markup span at (26:2,12 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [28] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_09.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_09.stree.txt new file mode 100644 index 0000000000..c5211701a6 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpToMarkupSwitchTest/CodeBlocksTrailingWhitespace_09.stree.txt @@ -0,0 +1,36 @@ +RazorDocument - [0..28)::28 - [@code {LF LF}
LF] + MarkupBlock - [0..28)::28 + MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any + Marker;[]; + CSharpCodeBlock - [0..15)::15 + RazorDirective - [0..15)::15 - Directive:{code;CodeBlock;Unrestricted} + CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None + Transition;[@]; + RazorDirectiveBody - [1..15)::14 + RazorMetaCode - [1..5)::4 - Gen - SpanEditHandler;Accepts:None + Identifier;[code]; + CSharpCodeBlock - [5..15)::10 + UnclassifiedTextLiteral - [5..6)::1 - [ ] - Gen - SpanEditHandler;Accepts:AllWhitespace + Whitespace;[ ]; + RazorMetaCode - [6..7)::1 - Gen - AutoCompleteEditHandler;Accepts:None,AutoComplete:[];AtEnd + LeftBrace;[{]; + CSharpCodeBlock - [7..14)::7 + CSharpStatementLiteral - [7..14)::7 - [LF LF] - Gen - CodeBlockEditHandler;Accepts:Any;CodeBlock + NewLine;[LF]; + Whitespace;[ ]; + NewLine;[LF]; + RazorMetaCode - [14..15)::1 - Gen - SpanEditHandler;Accepts:None + RightBrace;[}]; + MarkupElement - [15..26)::11 + MarkupStartTag - [15..20)::5 - [
] - Gen - SpanEditHandler;Accepts:Any + OpenAngle;[<]; + Text;[div]; + CloseAngle;[>]; + MarkupEndTag - [20..26)::6 - [
] - Gen - SpanEditHandler;Accepts:Any + OpenAngle;[<]; + ForwardSlash;[/]; + Text;[div]; + CloseAngle;[>]; + MarkupTextLiteral - [26..28)::2 - [LF] - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; + EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt index 6859bc4776..3a0e62a7b4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt @@ -62,7 +62,7 @@ LazyIntermediateToken - (359:11,22 [6] TagHelpersInSection.cshtml) - Html - \n LazyIntermediateToken - (365:12,4 [6] TagHelpersInSection.cshtml) - Html - LazyIntermediateToken - (371:12,10 [4] TagHelpersInSection.cshtml) - Html - \n\n - MalformedDirective - (379:14,4 [114] TagHelpersInSection.cshtml) - section + MalformedDirective - (379:14,4 [112] TagHelpersInSection.cshtml) - section DirectiveToken - (388:14,13 [13] TagHelpersInSection.cshtml) - nestedsection HtmlContent - (404:14,29 [29] TagHelpersInSection.cshtml) LazyIntermediateToken - (404:14,29 [10] TagHelpersInSection.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.cspans.txt index 92faad12a3..f849ff0741 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [147] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [145] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [145] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [145] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [145] ) -Code span at (14:1,12 [130] ) - Parent: Directive block at (2:1,0 [145] ) -MetaCode span at (144:6,0 [3] ) - Parent: Directive block at (2:1,0 [145] ) -Markup span at (147:7,0 [0] ) - Parent: Markup block at (0:0,0 [147] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [143] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [143] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [143] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [143] ) +Code span at (14:1,12 [130] ) - Parent: Directive block at (2:1,0 [143] ) +MetaCode span at (144:6,0 [1] ) - Parent: Directive block at (2:1,0 [143] ) +MetaCode span at (145:6,1 [2] ) - Parent: Statement block at (2:1,0 [145] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt index f2601b8b4c..acdea26753 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..147)::145 - RazorDirective - [2..147)::145 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..145)::143 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..147)::144 + RazorDirectiveBody - [3..145)::142 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..147)::135 + CSharpCodeBlock - [12..145)::133 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -55,9 +55,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [144..147)::3 - Gen + RazorMetaCode - [144..145)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [147..147)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [145..147)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.cspans.txt index a7e68e57f7..605b6c1ad9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [408] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [406] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [406] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [406] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [406] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [404] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [404] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [404] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [404] ) Code span at (14:1,12 [88] ) - Parent: Statement block at (14:1,12 [391] ) Markup span at (102:4,32 [3] ) - Parent: Tag block at (102:4,32 [3] ) Markup span at (105:4,35 [9] ) - Parent: Markup block at (102:4,32 [26] ) @@ -25,5 +25,5 @@ Markup span at (313:11,33 [6] ) - Parent: Markup block at (292:11,12 [27] ) Code span at (319:12,0 [31] ) - Parent: Statement block at (14:1,12 [391] ) Code span at (350:13,29 [1] ) - Parent: Statement block at (14:1,12 [391] ) Code span at (351:13,30 [54] ) - Parent: Statement block at (14:1,12 [391] ) -MetaCode span at (405:15,0 [3] ) - Parent: Directive block at (2:1,0 [406] ) -Markup span at (408:16,0 [0] ) - Parent: Markup block at (0:0,0 [408] ) +MetaCode span at (405:15,0 [1] ) - Parent: Directive block at (2:1,0 [404] ) +MetaCode span at (406:15,1 [2] ) - Parent: Statement block at (2:1,0 [406] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt index 664db62d81..947d952413 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/Functions_SingleLineControlFlowStatement_Error.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..408)::406 - RazorDirective - [2..408)::406 - Directive:{functions;CodeBlock;Unrestricted} [RZ1008(102:4,32 [1] ), RZ1008(206:8,12 [1] ), RZ1008(292:11,12 [2] ), RZ1008(350:13,29 [2] )] + RazorDirective - [2..406)::404 - Directive:{functions;CodeBlock;Unrestricted} [RZ1008(102:4,32 [1] ), RZ1008(206:8,12 [1] ), RZ1008(292:11,12 [2] ), RZ1008(350:13,29 [2] )] CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..408)::405 + RazorDirectiveBody - [3..406)::403 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..408)::396 + CSharpCodeBlock - [12..406)::394 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -186,9 +186,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [405..408)::3 - Gen + RazorMetaCode - [405..406)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [408..408)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [406..408)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.cspans.txt index 417f590755..540d78f50d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [210] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [208] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [208] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [208] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [208] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [206] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [206] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [206] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [206] ) Code span at (14:1,12 [47] ) - Parent: Statement block at (14:1,12 [193] ) Markup span at (61:4,0 [8] ) - Parent: Markup block at (61:4,0 [139] ) Markup span at (69:4,8 [5] ) - Parent: Tag block at (69:4,8 [5] ) @@ -22,5 +22,5 @@ Markup span at (184:9,0 [8] ) - Parent: Markup block at (61:4,0 [139] ) Markup span at (192:9,8 [6] ) - Parent: Tag block at (192:9,8 [6] ) Markup span at (198:9,14 [2] ) - Parent: Markup block at (61:4,0 [139] ) Code span at (200:10,0 [7] ) - Parent: Statement block at (14:1,12 [193] ) -MetaCode span at (207:11,0 [3] ) - Parent: Directive block at (2:1,0 [208] ) -Markup span at (210:12,0 [0] ) - Parent: Markup block at (0:0,0 [210] ) +MetaCode span at (207:11,0 [1] ) - Parent: Directive block at (2:1,0 [206] ) +MetaCode span at (208:11,1 [2] ) - Parent: Statement block at (2:1,0 [208] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt index b482356ff4..c046b0df4a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_CanContainCurlyBraces.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..210)::208 - RazorDirective - [2..210)::208 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..208)::206 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..210)::207 + RazorDirectiveBody - [3..208)::205 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..210)::198 + CSharpCodeBlock - [12..208)::196 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -105,9 +105,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [207..210)::3 - Gen + RazorMetaCode - [207..208)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [210..210)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [208..210)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.cspans.txt index 9ba235355d..1cafb397ca 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [81] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [79] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [79] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [79] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [79] ) -Code span at (14:1,12 [64] ) - Parent: Directive block at (2:1,0 [79] ) -MetaCode span at (78:3,0 [3] ) - Parent: Directive block at (2:1,0 [79] ) -Markup span at (81:4,0 [0] ) - Parent: Markup block at (0:0,0 [81] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [77] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [77] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [77] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [77] ) +Code span at (14:1,12 [64] ) - Parent: Directive block at (2:1,0 [77] ) +MetaCode span at (78:3,0 [1] ) - Parent: Directive block at (2:1,0 [77] ) +MetaCode span at (79:3,1 [2] ) - Parent: Statement block at (2:1,0 [79] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt index 1d1a4002f0..95bebc9331 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInString.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..81)::79 - RazorDirective - [2..81)::79 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..79)::77 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..81)::78 + RazorDirectiveBody - [3..79)::76 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..81)::69 + CSharpCodeBlock - [12..79)::67 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -32,9 +32,8 @@ StringLiteral;["

@message

"]; Semicolon;[;]; NewLine;[LF]; - RazorMetaCode - [78..81)::3 - Gen + RazorMetaCode - [78..79)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [81..81)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [79..81)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.cspans.txt index 3a7a1e4f2a..3625aff8f7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [82] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [80] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [80] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [80] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [80] ) -Code span at (14:1,12 [65] ) - Parent: Directive block at (2:1,0 [80] ) -MetaCode span at (79:3,0 [3] ) - Parent: Directive block at (2:1,0 [80] ) -Markup span at (82:4,0 [0] ) - Parent: Markup block at (0:0,0 [82] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [78] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [78] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [78] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [78] ) +Code span at (14:1,12 [65] ) - Parent: Directive block at (2:1,0 [78] ) +MetaCode span at (79:3,0 [1] ) - Parent: Directive block at (2:1,0 [78] ) +MetaCode span at (80:3,1 [2] ) - Parent: Statement block at (2:1,0 [80] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt index 92f753d125..23d7189276 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseMarkupInVerbatimString.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..82)::80 - RazorDirective - [2..82)::80 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..80)::78 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..82)::79 + RazorDirectiveBody - [3..80)::77 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..82)::70 + CSharpCodeBlock - [12..80)::68 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -32,9 +32,8 @@ StringLiteral;[@"

@message

"]; Semicolon;[;]; NewLine;[LF]; - RazorMetaCode - [79..82)::3 - Gen + RazorMetaCode - [79..80)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [82..82)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [80..82)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.cspans.txt index ed51079efa..d195c09709 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [98] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [96] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [96] ) -Code span at (14:1,12 [81] ) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (95:6,0 [3] ) - Parent: Directive block at (2:1,0 [96] ) -Markup span at (98:7,0 [0] ) - Parent: Markup block at (0:0,0 [98] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [94] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [94] ) +Code span at (14:1,12 [81] ) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (95:6,0 [1] ) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (96:6,1 [2] ) - Parent: Statement block at (2:1,0 [96] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt index ed9e5d9dc3..af91a84ac2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_DoesNotParseWhenNotSupported.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..98)::96 - RazorDirective - [2..98)::96 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..96)::94 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..98)::95 + RazorDirectiveBody - [3..96)::93 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..98)::86 + CSharpCodeBlock - [12..96)::84 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -44,9 +44,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [95..98)::3 - Gen + RazorMetaCode - [95..96)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [98..98)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [96..98)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.cspans.txt index ff33a1d2f2..bc76b7b205 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [220] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [218] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [218] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [218] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [218] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [216] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [216] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [216] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [216] ) Code span at (14:1,12 [47] ) - Parent: Statement block at (14:1,12 [203] ) Markup span at (61:4,0 [8] ) - Parent: Markup block at (61:4,0 [149] ) Markup span at (69:4,8 [5] ) - Parent: Tag block at (69:4,8 [5] ) @@ -21,5 +21,5 @@ Markup span at (194:9,0 [8] ) - Parent: Markup block at (61:4,0 [149] ) Markup span at (202:9,8 [6] ) - Parent: Tag block at (202:9,8 [6] ) Markup span at (208:9,14 [2] ) - Parent: Markup block at (61:4,0 [149] ) Code span at (210:10,0 [7] ) - Parent: Statement block at (14:1,12 [203] ) -MetaCode span at (217:11,0 [3] ) - Parent: Directive block at (2:1,0 [218] ) -Markup span at (220:12,0 [0] ) - Parent: Markup block at (0:0,0 [220] ) +MetaCode span at (217:11,0 [1] ) - Parent: Directive block at (2:1,0 [216] ) +MetaCode span at (218:11,1 [2] ) - Parent: Statement block at (2:1,0 [218] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt index faec3d4bd7..60a54424d2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_MarkupCanContainTemplate.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..220)::218 - RazorDirective - [2..220)::218 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..218)::216 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..220)::217 + RazorDirectiveBody - [3..218)::215 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..220)::208 + CSharpCodeBlock - [12..218)::206 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -110,9 +110,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [217..220)::3 - Gen + RazorMetaCode - [217..218)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [220..220)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [218..220)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.cspans.txt index 1939f834d0..4ce95ec601 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [98] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [96] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [96] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [96] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [94] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [94] ) Code span at (14:1,12 [47] ) - Parent: Statement block at (14:1,12 [81] ) Markup span at (61:4,0 [8] ) - Parent: Markup block at (61:4,0 [27] ) Markup span at (69:4,8 [4] ) - Parent: Tag block at (69:4,8 [4] ) @@ -12,5 +12,5 @@ Code span at (74:4,13 [7] ) - Parent: Expression block at (73:4,12 [8] ) Markup span at (81:4,20 [5] ) - Parent: Tag block at (81:4,20 [5] ) Markup span at (86:4,25 [2] ) - Parent: Markup block at (61:4,0 [27] ) Code span at (88:5,0 [7] ) - Parent: Statement block at (14:1,12 [81] ) -MetaCode span at (95:6,0 [3] ) - Parent: Directive block at (2:1,0 [96] ) -Markup span at (98:7,0 [0] ) - Parent: Markup block at (0:0,0 [98] ) +MetaCode span at (95:6,0 [1] ) - Parent: Directive block at (2:1,0 [94] ) +MetaCode span at (96:6,1 [2] ) - Parent: Statement block at (2:1,0 [96] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.stree.txt index 13a914d7f7..3a2b2c7ec2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupInsideMethod.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..98)::96 - RazorDirective - [2..98)::96 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..96)::94 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..98)::95 + RazorDirectiveBody - [3..96)::93 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..98)::86 + CSharpCodeBlock - [12..96)::84 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -59,9 +59,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [95..98)::3 - Gen + RazorMetaCode - [95..96)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [98..98)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [96..98)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.cspans.txt index 2c73392adf..722902909d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [78] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [76] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [76] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [76] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [76] ) -Code span at (14:1,12 [61] ) - Parent: Directive block at (2:1,0 [76] ) -MetaCode span at (75:3,0 [3] ) - Parent: Directive block at (2:1,0 [76] ) -Markup span at (78:4,0 [0] ) - Parent: Markup block at (0:0,0 [78] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [74] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [74] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [74] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [74] ) +Code span at (14:1,12 [61] ) - Parent: Directive block at (2:1,0 [74] ) +MetaCode span at (75:3,0 [1] ) - Parent: Directive block at (2:1,0 [74] ) +MetaCode span at (76:3,1 [2] ) - Parent: Statement block at (2:1,0 [76] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt index fed9c1fbcd..faf72ba71f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/MarkupInFunctionsBlock_ParsesMarkupWithExpressionsMethod.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..78)::76 - RazorDirective - [2..78)::76 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..76)::74 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..78)::75 + RazorDirectiveBody - [3..76)::73 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..78)::66 + CSharpCodeBlock - [12..76)::64 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -38,9 +38,8 @@ Identifier;[h3]; GreaterThan;[>]; NewLine;[LF]; - RazorMetaCode - [75..78)::3 - Gen + RazorMetaCode - [75..76)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [78..78)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [76..78)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.cspans.txt index 792e1b62f8..916fb34471 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.cspans.txt @@ -1,8 +1,8 @@ Markup span at (0:0,0 [2] ) - Parent: Markup block at (0:0,0 [140] ) -Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [138] ) -MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [138] ) -None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [138] ) -MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [138] ) +Transition span at (2:1,0 [1] ) - Parent: Directive block at (2:1,0 [136] ) +MetaCode span at (3:1,1 [9] ) - Parent: Directive block at (2:1,0 [136] ) +None span at (12:1,10 [1] ) - Parent: Directive block at (2:1,0 [136] ) +MetaCode span at (13:1,11 [1] ) - Parent: Directive block at (2:1,0 [136] ) Code span at (14:1,12 [73] ) - Parent: Statement block at (14:1,12 [123] ) Markup span at (87:6,0 [12] ) - Parent: Markup block at (87:6,0 [32] ) Markup span at (99:6,12 [3] ) - Parent: Tag block at (99:6,12 [3] ) @@ -10,5 +10,5 @@ Markup span at (102:6,15 [11] ) - Parent: Markup block at (87:6,0 [32] ) Markup span at (113:6,26 [4] ) - Parent: Tag block at (113:6,26 [4] ) Markup span at (117:6,30 [2] ) - Parent: Markup block at (87:6,0 [32] ) Code span at (119:7,0 [18] ) - Parent: Statement block at (14:1,12 [123] ) -MetaCode span at (137:9,0 [3] ) - Parent: Directive block at (2:1,0 [138] ) -Markup span at (140:10,0 [0] ) - Parent: Markup block at (0:0,0 [140] ) +MetaCode span at (137:9,0 [1] ) - Parent: Directive block at (2:1,0 [136] ) +MetaCode span at (138:9,1 [2] ) - Parent: Statement block at (2:1,0 [138] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.stree.txt index 019eb62f13..29dce0dc38 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpFunctionsTest/ReservedKeywordsInFunctionsBlock_WithMarkup.stree.txt @@ -3,13 +3,13 @@ MarkupTextLiteral - [0..2)::2 - [LF] - Gen NewLine;[LF]; CSharpCodeBlock - [2..140)::138 - RazorDirective - [2..140)::138 - Directive:{functions;CodeBlock;Unrestricted} + RazorDirective - [2..138)::136 - Directive:{functions;CodeBlock;Unrestricted} CSharpTransition - [2..3)::1 - Gen Transition;[@]; - RazorDirectiveBody - [3..140)::137 + RazorDirectiveBody - [3..138)::135 RazorMetaCode - [3..12)::9 - Gen Identifier;[functions]; - CSharpCodeBlock - [12..140)::128 + CSharpCodeBlock - [12..138)::126 UnclassifiedTextLiteral - [12..13)::1 - [ ] - Gen Whitespace;[ ]; RazorMetaCode - [13..14)::1 - Gen @@ -66,9 +66,8 @@ Whitespace;[ ]; RightBrace;[}]; NewLine;[LF]; - RazorMetaCode - [137..140)::3 - Gen + RazorMetaCode - [137..138)::1 - Gen RightBrace;[}]; - NewLine;[LF]; - MarkupTextLiteral - [140..140)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [138..140)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs index 396fe067d9..2f19316ade 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs @@ -1430,6 +1430,7 @@ internal class CSharpCodeParser : TokenizerBackedParser { var directiveBuilder = pooledResult.Builder; RazorMetaCodeSyntax? keywordBlock = null; + bool shouldCaptureWhitespaceToEndOfLine = false; try { @@ -1741,6 +1742,7 @@ internal class CSharpCodeParser : TokenizerBackedParser directiveBuilder.Add(OutputAsMarkupEphemeralLiteral()); break; case DirectiveKind.RazorBlock: + shouldCaptureWhitespaceToEndOfLine = true; AcceptWhile(IsSpacingTokenIncludingNewLinesAndComments); SetAcceptedCharacters(AcceptedCharactersInternal.AllWhitespace); directiveBuilder.Add(OutputTokensAsUnclassifiedLiteral()); @@ -1765,6 +1767,7 @@ internal class CSharpCodeParser : TokenizerBackedParser }); break; case DirectiveKind.CodeBlock: + shouldCaptureWhitespaceToEndOfLine = true; AcceptWhile(IsSpacingTokenIncludingNewLinesAndComments); SetAcceptedCharacters(AcceptedCharactersInternal.AllWhitespace); directiveBuilder.Add(OutputTokensAsUnclassifiedLiteral()); @@ -1807,6 +1810,12 @@ internal class CSharpCodeParser : TokenizerBackedParser builder.Add(BuildDirective(SyntaxKind.Identifier)); + if (shouldCaptureWhitespaceToEndOfLine) + { + CaptureWhitespaceToEndOfLine(); + builder.Add(OutputAsMetaCode(Output(), Context.CurrentAcceptedCharacters)); + } + RazorDirectiveSyntax BuildDirective(SyntaxKind expectedTokenKindIfMissing) { var node = OutputTokensAsStatementLiteral(); @@ -1960,7 +1969,6 @@ internal class CSharpCodeParser : TokenizerBackedParser autoCompleteStringAccessor.CanAcceptCloseBrace = canAcceptCloseBrace; } - CompleteBlock(insertMarkerIfNecessary: false, captureWhitespaceToEndOfLine: true); builder.Add(OutputAsMetaCode(Output(), Context.CurrentAcceptedCharacters)); } } @@ -2631,28 +2639,18 @@ internal class CSharpCodeParser : TokenizerBackedParser } protected void CompleteBlock() - { - CompleteBlock(insertMarkerIfNecessary: true); + { + AcceptMarkerTokenIfNecessary(); + CaptureWhitespaceToEndOfLine(); } - protected void CompleteBlock(bool insertMarkerIfNecessary) + private void CaptureWhitespaceToEndOfLine() { - CompleteBlock(insertMarkerIfNecessary, captureWhitespaceToEndOfLine: insertMarkerIfNecessary); - } - - protected void CompleteBlock(bool insertMarkerIfNecessary, bool captureWhitespaceToEndOfLine) - { - if (insertMarkerIfNecessary) - { - AcceptMarkerTokenIfNecessary(); - } - EnsureCurrent(); // Read whitespace, but not newlines // If we're not inserting a marker span, we don't need to capture whitespace if (!Context.WhiteSpaceIsSignificantToAncestorBlock && - captureWhitespaceToEndOfLine && !Context.DesignTimeMode && !IsNested) {