-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix RazorDiagnostics from being hidden and unordered.
- Diagnostics were not being raised to the `RazorSyntaxTree` and weren't being ordered on final output. This resulted in some of our tests missing the fact that certain cases were generating errors. - Made all three phases of Razor parsing order their diagnostics. - Added `GetAllDiagnostics` methods to `SyntaxNode`s to be more consistent with IR documents. - Updated test files. In some cases new errors were found because we're now lifting them to the `SyntaxTree`, in most others the errors are re-ordered. **Note: In end-to-end scenarios diagnostics were not hidden, only unordered. The IR phase would find nested/hidden documents and lift them to the IR/C# documents.**
- Loading branch information
1 parent
11e4db2
commit ef31a96
Showing
73 changed files
with
156 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...sts/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.diagnostics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,11): Error RZ1026: Encountered end tag "div" with no matching start tag. Are your start/end tags properly balanced? | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,7): Error RZ1006: The explicit expression block is missing a closing ")" character. Make sure you have a matching ")" character for all the "(" characters within this block, and that none of the ")" characters are being interpreted as markup. | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,11): Error RZ1026: Encountered end tag "div" with no matching start tag. Are your start/end tags properly balanced? |
2 changes: 1 addition & 1 deletion
2
...nTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.diagnostics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,11): Error RZ1026: Encountered end tag "div" with no matching start tag. Are your start/end tags properly balanced? | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,7): Error RZ1006: The explicit expression block is missing a closing ")" character. Make sure you have a matching ")" character for all the "(" characters within this block, and that none of the ")" characters are being interpreted as markup. | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,11): Error RZ1026: Encountered end tag "div" with no matching start tag. Are your start/end tags properly balanced? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.diagnostics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(3,2): Error RZ1006: The if block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(4,3): Error RZ1026: Encountered end tag "body" with no matching start tag. Are your start/end tags properly balanced? | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(5,3): Error RZ1026: Encountered end tag "html" with no matching start tag. Are your start/end tags properly balanced? | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(3,2): Error RZ1006: The if block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. |
2 changes: 1 addition & 1 deletion
2
...TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.diagnostics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(3,2): Error RZ1006: The if block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(4,3): Error RZ1026: Encountered end tag "body" with no matching start tag. Are your start/end tags properly balanced? | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(5,3): Error RZ1026: Encountered end tag "html" with no matching start tag. Are your start/end tags properly balanced? | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml(3,2): Error RZ1006: The if block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. |
2 changes: 1 addition & 1 deletion
2
...les/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.diagnostics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml(2,1): Error RZ1001: End of file was reached before the end of the block comment. All comments started with "/*" sequence must be terminated with a matching "*/" sequence. | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml(1,2): Error RZ1006: The code block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml(2,1): Error RZ1001: End of file was reached before the end of the block comment. All comments started with "/*" sequence must be terminated with a matching "*/" sequence. |
2 changes: 1 addition & 1 deletion
2
...tFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.diagnostics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml(2,1): Error RZ1001: End of file was reached before the end of the block comment. All comments started with "/*" sequence must be terminated with a matching "*/" sequence. | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml(1,2): Error RZ1006: The code block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. | ||
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml(2,1): Error RZ1001: End of file was reached before the end of the block comment. All comments started with "/*" sequence must be terminated with a matching "*/" sequence. |
1 change: 1 addition & 0 deletions
1
...TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtEOF.diag.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(1,11): Error RZ1006: The functions block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. |
1 change: 1 addition & 0 deletions
1
...s/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtStartOfFile.diag.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(1,11): Error RZ1006: The functions block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. |
1 change: 1 addition & 0 deletions
1
...t/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtEOF.diag.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(1,17): Error RZ1006: The section block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. |
1 change: 1 addition & 0 deletions
1
...les/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtStartOfFile.diag.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(1,17): Error RZ1006: The section block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. |
2 changes: 1 addition & 1 deletion
2
...age.Test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.diag.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
(1,26): Error RZ1001: End of file was reached before the end of the block comment. All comments started with "/*" sequence must be terminated with a matching "*/" sequence. | ||
(1,2): Error RZ1006: The foreach block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. | ||
(1,26): Error RZ1001: End of file was reached before the end of the block comment. All comments started with "/*" sequence must be terminated with a matching "*/" sequence. |
2 changes: 1 addition & 1 deletion
2
...Test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransition_EndOfFile_Throws.diag.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
(1,4): Error RZ1024: End of file or an unexpected character was reached before the "span" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "<" HTML entity. | ||
(1,2): Error RZ1006: The code block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. | ||
(1,4): Error RZ1024: End of file or an unexpected character was reached before the "span" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "<" HTML entity. |
2 changes: 1 addition & 1 deletion
2
...ests/CSharpErrorTest/MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression.diag.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
(2,6): Error RZ1004: End-of-file was found after the "@" character. "@" must be followed by a valid code block. If you want to output an "@", escape it using the sequence: "@@" | ||
(1,2): Error RZ1006: The code block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. | ||
(2,6): Error RZ1004: End-of-file was found after the "@" character. "@" must be followed by a valid code block. If you want to output an "@", escape it using the sequence: "@@" |
1 change: 1 addition & 0 deletions
1
.../TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.diag.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(1,12): Error RZ1006: The functions block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. |
Oops, something went wrong.