From b9fde956ea9eb7259204c43ea99e9d9cbbee6435 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 1 May 2019 09:06:23 -0700 Subject: [PATCH] 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.** \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/ef31a9683b3eadf84255e95cea061a25208ea483 --- .../CodeGeneration/DefaultDocumentWriter.cs | 4 +- .../src/DefaultRazorSyntaxTree.cs | 33 ++++++++++++-- .../IntermediateNodeExtensions.cs | 4 +- .../src/Legacy/RazorSyntaxTreeExtensions.cs | 1 - .../src/RazorSyntaxTree.cs | 2 +- .../src/Syntax/SyntaxNodeExtensions.cs | 43 +++++++++++++++++++ .../ComponentBindIntegrationTest.cs | 4 +- ...ssionWithMarkup_DesignTime.diagnostics.txt | 2 +- ...pressionWithMarkup_Runtime.diagnostics.txt | 2 +- ...pleteDirectives_DesignTime.diagnostics.txt | 4 +- ...completeDirectives_Runtime.diagnostics.txt | 4 +- .../OpenedIf_DesignTime.diagnostics.txt | 2 +- .../OpenedIf_Runtime.diagnostics.txt | 2 +- .../ParserError_DesignTime.diagnostics.txt | 2 +- .../ParserError_Runtime.diagnostics.txt | 2 +- ...nctionsDirectiveAutoCompleteAtEOF.diag.txt | 1 + ...irectiveAutoCompleteAtStartOfFile.diag.txt | 1 + ...SectionDirectiveAutoCompleteAtEOF.diag.txt | 1 + ...irectiveAutoCompleteAtStartOfFile.diag.txt | 1 + ...TerminatesBlockCommentAtEndOfFile.diag.txt | 2 +- ...DoubleTransition_EndOfFile_Throws.diag.txt | 2 +- ...terTransitionInEmbeddedExpression.diag.txt | 2 +- ...rrorIfClassBlockUnterminatedAtEOF.diag.txt | 1 + ...TerminatesNormalStringAtEndOfFile.diag.txt | 2 +- ...rminatesVerbatimStringAtEndOfFile.diag.txt | 2 +- .../RazorCommentInVerbatimBlock.diag.txt | 2 +- ...entInImplicitExpressionMethodCall.diag.txt | 2 +- ...inatedRazorCommentInVerbatimBlock.diag.txt | 2 +- ...pturesNewlineImmediatelyFollowing.diag.txt | 1 + ...LineInSectionStatementMissingName.diag.txt | 1 + ...nSectionStatementMissingOpenBrace.diag.txt | 1 + .../HandlesEOFAfterOpenBrace.diag.txt | 1 + .../HandlesEOFAfterOpenContent1.diag.txt | 1 + .../HandlesEOFAfterOpenContent2.diag.txt | 1 + .../HandlesEOFAfterOpenContent3.diag.txt | 1 + .../HandlesEOFAfterOpenContent4.diag.txt | 1 + .../HandlesUnterminatedSection.diag.txt | 1 + ...esUnterminatedSectionWithNestedIf.diag.txt | 1 + ...tOutputErrorOtherNestedDirectives.diag.txt | 2 + ...putsErrorOnMultipleNestedSections.diag.txt | 4 ++ ...arserOutputsErrorOnNestedSections.diag.txt | 2 + ...OLIfSectionNotFollowedByOpenBrace.diag.txt | 1 + ...dNotFollowedByIdentifierStartChar.diag.txt | 1 + ...BlockIfNameNotFollowedByOpenBrace.diag.txt | 1 + .../HandlesOpenAngleAtEof.diag.txt | 2 +- ...OpenAngleWithProperTagFollowingIt.diag.txt | 2 +- ...utCloseAngleDoesNotTerminateBlock.diag.txt | 2 +- .../HtmlBlockTest/TerminatesAtEOF.diag.txt | 2 +- ...osedTagAtEOFErrorsOnMissingEndTag.diag.txt | 2 +- ...edTagAtEOFErrorsWithIncompleteTag.diag.txt | 2 +- ...ToCodeIfThereIsNoMarkupOnThatLine.diag.txt | 1 + ...teRequiresDoubleQuotesAroundValue.diag.txt | 1 + ...teRequiresDoubleQuotesAroundValue.diag.txt | 1 + ...andleEOFIncompleteNamespaceTokens.diag.txt | 1 + ...anHandleEOFInvalidNamespaceTokens.diag.txt | 1 + ...anHandleIncompleteNamespaceTokens.diag.txt | 1 + ...r_CanHandleInvalidNamespaceTokens.diag.txt | 1 + ..._ErrorsExtraContentAfterDirective.diag.txt | 1 + ...ptor_ErrorsForInvalidMemberTokens.diag.txt | 1 + ...sWhenEOFBeforeDirectiveBlockStart.diag.txt | 1 + ...sWhenExtraContentBeforeBlockStart.diag.txt | 1 + ...criptor_ErrorsWhenMissingEndBrace.diag.txt | 1 + ...SinglyOccurring_ErrorsIfDuplicate.diag.txt | 1 + ...oken_ParserErrorForNonStringValue.diag.txt | 1 + ..._ParserErrorForPartialQuotedValue.diag.txt | 1 + ...n_ParserErrorForSingleQuotedValue.diag.txt | 1 + ...Token_ParserErrorForUnquotedValue.diag.txt | 1 + ...ptor_TokensMustBeSeparatedBySpace.diag.txt | 1 + ...DirectiveErrorsIfNotAtStartOfLine.diag.txt | 1 + ...teRequiresDoubleQuotesAroundValue.diag.txt | 1 + ...teRequiresDoubleQuotesAroundValue.diag.txt | 1 + ...teRequiresDoubleQuotesAroundValue.diag.txt | 1 + ...teRequiresDoubleQuotesAroundValue.diag.txt | 1 + 73 files changed, 156 insertions(+), 32 deletions(-) create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtEOF.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtStartOfFile.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtEOF.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtStartOfFile.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesNewlineImmediatelyFollowing.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingName.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenBrace.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent1.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent2.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent3.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent4.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSection.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSectionWithNestedIf.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserDoesNotOutputErrorOtherNestedDirectives.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnMultipleNestedSections.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnNestedSections.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndAcceptsWhitespaceToEOLIfSectionNotFollowedByOpenBrace.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartChar.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/SectionContextGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/AddTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/AddTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleEOFIncompleteNamespaceTokens.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleEOFInvalidNamespaceTokens.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleIncompleteNamespaceTokens.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleInvalidNamespaceTokens.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsExtraContentAfterDirective.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsForInvalidMemberTokens.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenEOFBeforeDirectiveBlockStart.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenExtraContentBeforeBlockStart.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenMissingEndBrace.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_FileScopedSinglyOccurring_ErrorsIfDuplicate.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForNonStringValue.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForPartialQuotedValue.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForSingleQuotedValue.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForUnquotedValue.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_TokensMustBeSeparatedBySpace.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/ExtensibleDirectiveErrorsIfNotAtStartOfLine.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/RemoveTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/RemoveTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/TagHelperPrefixDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt create mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/TagHelperPrefixDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/CodeGeneration/DefaultDocumentWriter.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/CodeGeneration/DefaultDocumentWriter.cs index 294304dd18..e665bbc024 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/CodeGeneration/DefaultDocumentWriter.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/CodeGeneration/DefaultDocumentWriter.cs @@ -42,10 +42,12 @@ namespace Microsoft.AspNetCore.Razor.Language.CodeGeneration context.Visitor.VisitDocument(documentNode); var cSharp = context.CodeWriter.GenerateCode(); + + var allOrderedDiagnostics = context.Diagnostics.OrderBy(diagnostic => diagnostic.Span.AbsoluteIndex); return new DefaultRazorCSharpDocument( cSharp, _options, - context.Diagnostics.ToArray(), + allOrderedDiagnostics.ToArray(), context.SourceMappings.ToArray(), context.LinePragmas.ToArray()); } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorSyntaxTree.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorSyntaxTree.cs index 018dbfe5fb..06097d1289 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorSyntaxTree.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorSyntaxTree.cs @@ -1,8 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; +using System.Linq; using Microsoft.AspNetCore.Razor.Language.Legacy; using Microsoft.AspNetCore.Razor.Language.Syntax; @@ -10,6 +10,9 @@ namespace Microsoft.AspNetCore.Razor.Language { internal class DefaultRazorSyntaxTree : RazorSyntaxTree { + private readonly IReadOnlyList _diagnostics; + private IReadOnlyList _allDiagnostics; + public DefaultRazorSyntaxTree( SyntaxNode root, RazorSourceDocument source, @@ -18,11 +21,35 @@ namespace Microsoft.AspNetCore.Razor.Language { Root = root; Source = source; - Diagnostics = diagnostics; + _diagnostics = diagnostics; Options = options; } - public override IReadOnlyList Diagnostics { get; } + public override IReadOnlyList Diagnostics + { + get + { + if (_allDiagnostics == null) + { + var allDiagnostics = new HashSet(); + for (var i = 0; i < _diagnostics.Count; i++) + { + allDiagnostics.Add(_diagnostics[i]); + } + + var rootDiagnostics = Root.GetAllDiagnostics(); + for (var i = 0; i < rootDiagnostics.Count; i++) + { + allDiagnostics.Add(rootDiagnostics[i]); + } + + var allOrderedDiagnostics = allDiagnostics.OrderBy(diagnostic => diagnostic.Span.AbsoluteIndex); + _allDiagnostics = allOrderedDiagnostics.ToArray(); + } + + return _allDiagnostics; + } + } public override RazorParserOptions Options { get; } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Intermediate/IntermediateNodeExtensions.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Intermediate/IntermediateNodeExtensions.cs index 6af13aab2c..f491158cec 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Intermediate/IntermediateNodeExtensions.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Intermediate/IntermediateNodeExtensions.cs @@ -27,7 +27,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate AddAllDiagnostics(node); - return diagnostics?.ToList() ?? EmptyDiagnostics; + var allOrderedDiagnostics = diagnostics?.OrderBy(diagnostic => diagnostic.Span.AbsoluteIndex); + + return allOrderedDiagnostics?.ToList() ?? EmptyDiagnostics; void AddAllDiagnostics(IntermediateNode n) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/RazorSyntaxTreeExtensions.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/RazorSyntaxTreeExtensions.cs index 2a3d016224..63402f9f65 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/RazorSyntaxTreeExtensions.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/RazorSyntaxTreeExtensions.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Linq; namespace Microsoft.AspNetCore.Razor.Language.Legacy { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorSyntaxTree.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorSyntaxTree.cs index 340129b2aa..2574ef0e07 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorSyntaxTree.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorSyntaxTree.cs @@ -55,7 +55,7 @@ namespace Microsoft.AspNetCore.Razor.Language { throw new ArgumentNullException(nameof(source)); } - + var parser = new RazorParser(options ?? RazorParserOptions.CreateDefault()); return parser.Parse(source); } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Syntax/SyntaxNodeExtensions.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Syntax/SyntaxNodeExtensions.cs index 626eac6d29..677c06d894 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Syntax/SyntaxNodeExtensions.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Syntax/SyntaxNodeExtensions.cs @@ -55,6 +55,25 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax return (TNode)node.WithDiagnostics(allDiagnostics); } + /// + /// Gets top-level and nested diagnostics from the . + /// + /// The type of syntax node. + /// The syntax node. + /// The list of s. + public static IReadOnlyList GetAllDiagnostics(this TNode node) where TNode : SyntaxNode + { + if (node == null) + { + throw new ArgumentNullException(nameof(node)); + } + + var walker = new DiagnosticSyntaxWalker(); + walker.Visit(node); + + return walker.Diagnostics; + } + public static SourceLocation GetSourceLocation(this SyntaxNode node, RazorSourceDocument source) { if (node == null) @@ -220,5 +239,29 @@ namespace Microsoft.AspNetCore.Razor.Language.Syntax var content = string.Concat(tokens.Select(t => t.Content)); return content; } + + private class DiagnosticSyntaxWalker : SyntaxWalker + { + private readonly List _diagnostics; + + public DiagnosticSyntaxWalker() + { + _diagnostics = new List(); + } + + public IReadOnlyList Diagnostics => _diagnostics; + + public override void Visit(SyntaxNode node) + { + if (node?.ContainsDiagnostics == true) + { + var diagnostics = node.GetDiagnostics(); + + _diagnostics.AddRange(diagnostics); + + base.Visit(node); + } + } + } } } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentBindIntegrationTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentBindIntegrationTest.cs index bfbda33a7a..374d5a25c5 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentBindIntegrationTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentBindIntegrationTest.cs @@ -80,11 +80,13 @@ namespace Test [Fact] public void Bind_InvalidUseOfDirective_DoesNotThrow() { + // We're looking for VS crash issues. Meaning if the parser returns + // diagnostics we don't want to throw. var generated = CompileToCSharp(@" @functions { public string page { get; set; } = ""text""; -}"); +}", throwOnFailure: false); // Assert Assert.Collection( diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.diagnostics.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.diagnostics.txt index 16ad2a09d5..04d0a39526 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.diagnostics.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.diagnostics.txt @@ -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? diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.diagnostics.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.diagnostics.txt index 16ad2a09d5..04d0a39526 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.diagnostics.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.diagnostics.txt @@ -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? diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.diagnostics.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.diagnostics.txt index 1eb0531be3..c7d8d88528 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.diagnostics.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.diagnostics.txt @@ -11,10 +11,10 @@ TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cs TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(9,18): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(9,18): Error RZ1036: Invalid tag helper directive look up text '"'. The correct look up text format is: "name, assemblyName". TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(11,2): Error RZ1018: Directive 'tagHelperPrefix' must have a value. -TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(12,2): Error RZ1018: Directive 'tagHelperPrefix' must have a value. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(12,1): Error RZ2001: The 'tagHelperPrefix' directive may only occur once per document. -TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(13,18): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. +TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(12,2): Error RZ1018: Directive 'tagHelperPrefix' must have a value. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(13,1): Error RZ2001: The 'tagHelperPrefix' directive may only occur once per document. +TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(13,18): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(13,18): Error RZ1020: Invalid tag helper directive 'tagHelperPrefix' value. '"' is not allowed in prefix '"'. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(15,10): Error RZ1013: The 'inherits' directive expects a type name. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(16,1): Error RZ2001: The 'inherits' directive may only occur once per document. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.diagnostics.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.diagnostics.txt index 1eb0531be3..c7d8d88528 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.diagnostics.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.diagnostics.txt @@ -11,10 +11,10 @@ TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cs TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(9,18): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(9,18): Error RZ1036: Invalid tag helper directive look up text '"'. The correct look up text format is: "name, assemblyName". TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(11,2): Error RZ1018: Directive 'tagHelperPrefix' must have a value. -TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(12,2): Error RZ1018: Directive 'tagHelperPrefix' must have a value. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(12,1): Error RZ2001: The 'tagHelperPrefix' directive may only occur once per document. -TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(13,18): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. +TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(12,2): Error RZ1018: Directive 'tagHelperPrefix' must have a value. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(13,1): Error RZ2001: The 'tagHelperPrefix' directive may only occur once per document. +TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(13,18): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(13,18): Error RZ1020: Invalid tag helper directive 'tagHelperPrefix' value. '"' is not allowed in prefix '"'. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(15,10): Error RZ1013: The 'inherits' directive expects a type name. TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml(16,1): Error RZ2001: The 'inherits' directive may only occur once per document. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.diagnostics.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.diagnostics.txt index 49f293ec33..681454769b 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.diagnostics.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.diagnostics.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.diagnostics.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.diagnostics.txt index 49f293ec33..681454769b 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.diagnostics.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.diagnostics.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.diagnostics.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.diagnostics.txt index 1a25d90e26..23ff3e26b1 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.diagnostics.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.diagnostics.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.diagnostics.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.diagnostics.txt index 1a25d90e26..23ff3e26b1 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.diagnostics.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.diagnostics.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtEOF.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtEOF.diag.txt new file mode 100644 index 0000000000..b03e548350 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtEOF.diag.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtStartOfFile.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtStartOfFile.diag.txt new file mode 100644 index 0000000000..b03e548350 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/FunctionsDirectiveAutoCompleteAtStartOfFile.diag.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtEOF.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtEOF.diag.txt new file mode 100644 index 0000000000..e65f8dfff3 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtEOF.diag.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtStartOfFile.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtStartOfFile.diag.txt new file mode 100644 index 0000000000..e65f8dfff3 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpAutoCompleteTest/SectionDirectiveAutoCompleteAtStartOfFile.diag.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.diag.txt index 2612cdd013..98a67406d1 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/TerminatesBlockCommentAtEndOfFile.diag.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransition_EndOfFile_Throws.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransition_EndOfFile_Throws.diag.txt index 69a6b33a62..a4e40cedd4 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransition_EndOfFile_Throws.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/WithDoubleTransition_EndOfFile_Throws.diag.txt @@ -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 ("
") or have matching end tags ("

Hello

"). 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 ("
") or have matching end tags ("

Hello

"). If you intended to display a "<" character, use the "<" HTML entity. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression.diag.txt index 5611de1939..5e816e75b7 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression.diag.txt @@ -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: "@@" diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.diag.txt new file mode 100644 index 0000000000..7a30f21cb3 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/ReportsErrorIfClassBlockUnterminatedAtEOF.diag.txt @@ -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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.diag.txt index da5c70dd69..a49f840204 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesNormalStringAtEndOfFile.diag.txt @@ -1,2 +1,2 @@ -(1,22): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. (1,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. +(1,22): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.diag.txt index da5c70dd69..a49f840204 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpErrorTest/TerminatesVerbatimStringAtEndOfFile.diag.txt @@ -1,2 +1,2 @@ -(1,22): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. (1,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. +(1,22): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInVerbatimBlock.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInVerbatimBlock.diag.txt index 1567f665b6..728d71fa46 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInVerbatimBlock.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/RazorCommentInVerbatimBlock.diag.txt @@ -1,3 +1,3 @@ +(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 RZ1023: "" and "" tags cannot contain attributes. (2,6): Error RZ1025: The "text" element was not closed. All elements must be either self-closing or have a matching end tag. -(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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInImplicitExpressionMethodCall.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInImplicitExpressionMethodCall.diag.txt index b65a64c148..4369e7d5eb 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInImplicitExpressionMethodCall.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInImplicitExpressionMethodCall.diag.txt @@ -1,2 +1,2 @@ -(1,6): Error RZ1028: End of file was reached before the end of the block comment. All comments that start with the "@*" sequence must be terminated with a matching "*@" sequence. (1,5): Error RZ1027: An opening "(" is missing the corresponding closing ")". +(1,6): Error RZ1028: End of file was reached before the end of the block comment. All comments that start with the "@*" sequence must be terminated with a matching "*@" sequence. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInVerbatimBlock.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInVerbatimBlock.diag.txt index 37d6bd7155..5ab5182308 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInVerbatimBlock.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpRazorCommentsTest/UnterminatedRazorCommentInVerbatimBlock.diag.txt @@ -1,2 +1,2 @@ -(1,3): Error RZ1028: End of file was reached before the end of the block comment. All comments that start with the "@*" sequence must be terminated with a matching "*@" 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. +(1,3): Error RZ1028: End of file was reached before the end of the block comment. All comments that start with the "@*" sequence must be terminated with a matching "*@" sequence. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesNewlineImmediatelyFollowing.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesNewlineImmediatelyFollowing.diag.txt new file mode 100644 index 0000000000..f15ab6ffa2 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesNewlineImmediatelyFollowing.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1015: The 'section' directive expects an identifier. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingName.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingName.diag.txt new file mode 100644 index 0000000000..feec72ed8b --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingName.diag.txt @@ -0,0 +1 @@ +(1,18): Error RZ1015: The 'section' directive expects an identifier. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace.diag.txt new file mode 100644 index 0000000000..498cbfed10 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/CapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace.diag.txt @@ -0,0 +1 @@ +(2,5): Error RZ1012: Unexpected end of file following the 'section' directive. Expected '{'. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenBrace.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenBrace.diag.txt new file mode 100644 index 0000000000..e1bd35fcb5 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenBrace.diag.txt @@ -0,0 +1 @@ +(1,14): 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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent1.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent1.diag.txt new file mode 100644 index 0000000000..e1bd35fcb5 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent1.diag.txt @@ -0,0 +1 @@ +(1,14): 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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent2.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent2.diag.txt new file mode 100644 index 0000000000..e1bd35fcb5 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent2.diag.txt @@ -0,0 +1 @@ +(1,14): 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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent3.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent3.diag.txt new file mode 100644 index 0000000000..e1bd35fcb5 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent3.diag.txt @@ -0,0 +1 @@ +(1,14): 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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent4.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent4.diag.txt new file mode 100644 index 0000000000..e1bd35fcb5 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesEOFAfterOpenContent4.diag.txt @@ -0,0 +1 @@ +(1,14): 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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSection.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSection.diag.txt new file mode 100644 index 0000000000..e1bd35fcb5 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSection.diag.txt @@ -0,0 +1 @@ +(1,14): 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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSectionWithNestedIf.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSectionWithNestedIf.diag.txt new file mode 100644 index 0000000000..e1202f894a --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/HandlesUnterminatedSectionWithNestedIf.diag.txt @@ -0,0 +1 @@ +(2,1): 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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserDoesNotOutputErrorOtherNestedDirectives.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserDoesNotOutputErrorOtherNestedDirectives.diag.txt new file mode 100644 index 0000000000..7f29e8edf5 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserDoesNotOutputErrorOtherNestedDirectives.diag.txt @@ -0,0 +1,2 @@ +(1,17): Error RZ2005: The 'inherits` directive must appear at the start of the line. +(1,30): Error RZ1017: Unexpected literal following the 'inherits' directive. Expected 'line break'. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnMultipleNestedSections.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnMultipleNestedSections.diag.txt new file mode 100644 index 0000000000..5ba54f32e6 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnMultipleNestedSections.diag.txt @@ -0,0 +1,4 @@ +(1,16): Error RZ2002: Section blocks ("@section Header { ... }") cannot be nested. Only one level of section blocks are allowed. +(1,17): Error RZ2005: The 'section` directive must appear at the start of the line. +(1,42): Error RZ2002: Section blocks ("@section Header { ... }") cannot be nested. Only one level of section blocks are allowed. +(1,43): Error RZ2005: The 'section` directive must appear at the start of the line. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnNestedSections.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnNestedSections.diag.txt new file mode 100644 index 0000000000..756b35bd86 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ParserOutputsErrorOnNestedSections.diag.txt @@ -0,0 +1,2 @@ +(1,16): Error RZ2002: Section blocks ("@section Header { ... }") cannot be nested. Only one level of section blocks are allowed. +(1,17): Error RZ2005: The 'section` directive must appear at the start of the line. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndAcceptsWhitespaceToEOLIfSectionNotFollowedByOpenBrace.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndAcceptsWhitespaceToEOLIfSectionNotFollowedByOpenBrace.diag.txt new file mode 100644 index 0000000000..079c1c2fda --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndAcceptsWhitespaceToEOLIfSectionNotFollowedByOpenBrace.diag.txt @@ -0,0 +1 @@ +(2,1): Error RZ1012: Unexpected end of file following the 'section' directive. Expected '{'. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartChar.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartChar.diag.txt new file mode 100644 index 0000000000..81ec8bff11 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartChar.diag.txt @@ -0,0 +1 @@ +(1,10): Error RZ1015: The 'section' directive expects an identifier. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace.diag.txt new file mode 100644 index 0000000000..fd83ce295e --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpSectionTest/ReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace.diag.txt @@ -0,0 +1 @@ +(1,13): Error RZ1017: Unexpected literal following the 'section' directive. Expected '{'. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/HandlesOpenAngleAtEof.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/HandlesOpenAngleAtEof.diag.txt index 5183cd029a..1b72b90879 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/HandlesOpenAngleAtEof.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/HandlesOpenAngleAtEof.diag.txt @@ -1,2 +1,2 @@ -(2,1): Error RZ1024: End of file or an unexpected character was reached before the "" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("
") or have matching end tags ("

Hello

"). 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. +(2,1): Error RZ1024: End of file or an unexpected character was reached before the "" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("
") or have matching end tags ("

Hello

"). If you intended to display a "<" character, use the "<" HTML entity. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/HandlesOpenAngleWithProperTagFollowingIt.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/HandlesOpenAngleWithProperTagFollowingIt.diag.txt index d1be8ea52d..16d45eb0ab 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/HandlesOpenAngleWithProperTagFollowingIt.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/HandlesOpenAngleWithProperTagFollowingIt.diag.txt @@ -1,3 +1,3 @@ +(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,1): Error RZ1024: End of file or an unexpected character was reached before the "" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("
") or have matching end tags ("

Hello

"). If you intended to display a "<" character, use the "<" HTML entity. (3,3): Error RZ1026: Encountered end tag "html" with no matching start tag. Are your start/end tags properly balanced? -(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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/TagWithoutCloseAngleDoesNotTerminateBlock.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/TagWithoutCloseAngleDoesNotTerminateBlock.diag.txt index c2dcafc10d..5c6d4706b6 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/TagWithoutCloseAngleDoesNotTerminateBlock.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/TagWithoutCloseAngleDoesNotTerminateBlock.diag.txt @@ -1,2 +1,2 @@ -(1,3): Error RZ1024: End of file or an unexpected character was reached before the "" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("
") or have matching end tags ("

Hello

"). 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,3): Error RZ1024: End of file or an unexpected character was reached before the "" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("
") or have matching end tags ("

Hello

"). If you intended to display a "<" character, use the "<" HTML entity. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/TerminatesAtEOF.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/TerminatesAtEOF.diag.txt index 5ea3dc7ca1..f87f5f62ad 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/TerminatesAtEOF.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlBlockTest/TerminatesAtEOF.diag.txt @@ -1,2 +1,2 @@ -(1,4): Error RZ1025: The "foo" element was not closed. All elements must be either self-closing or have a matching end tag. (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 RZ1025: The "foo" element was not closed. All elements must be either self-closing or have a matching end tag. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlErrorTest/WithUnclosedTagAtEOFErrorsOnMissingEndTag.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlErrorTest/WithUnclosedTagAtEOFErrorsOnMissingEndTag.diag.txt index 5ea3dc7ca1..f87f5f62ad 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlErrorTest/WithUnclosedTagAtEOFErrorsOnMissingEndTag.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlErrorTest/WithUnclosedTagAtEOFErrorsOnMissingEndTag.diag.txt @@ -1,2 +1,2 @@ -(1,4): Error RZ1025: The "foo" element was not closed. All elements must be either self-closing or have a matching end tag. (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 RZ1025: The "foo" element was not closed. All elements must be either self-closing or have a matching end tag. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlErrorTest/WithUnfinishedTagAtEOFErrorsWithIncompleteTag.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlErrorTest/WithUnfinishedTagAtEOFErrorsWithIncompleteTag.diag.txt index d896fe55e8..7611cfed5a 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlErrorTest/WithUnfinishedTagAtEOFErrorsWithIncompleteTag.diag.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlErrorTest/WithUnfinishedTagAtEOFErrorsWithIncompleteTag.diag.txt @@ -1,2 +1,2 @@ -(1,4): Error RZ1024: End of file or an unexpected character was reached before the "foo" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("
") or have matching end tags ("

Hello

"). 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 "foo" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("
") or have matching end tags ("

Hello

"). If you intended to display a "<" character, use the "<" HTML entity. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/SectionContextGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/SectionContextGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.diag.txt new file mode 100644 index 0000000000..82834fee1b --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/HtmlToCodeSwitchTest/SectionContextGivesWhitespacePreceedingToCodeIfThereIsNoMarkupOnThatLine.diag.txt @@ -0,0 +1 @@ +(1,4): Error RZ2005: The 'section` directive must appear at the start of the line. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/AddTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/AddTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt new file mode 100644 index 0000000000..c1d5bcd34e --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/AddTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt @@ -0,0 +1 @@ +(1,18): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/AddTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/AddTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt new file mode 100644 index 0000000000..859804d1cf --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/AddTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt @@ -0,0 +1 @@ +(1,15): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleEOFIncompleteNamespaceTokens.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleEOFIncompleteNamespaceTokens.diag.txt new file mode 100644 index 0000000000..7e7735a128 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleEOFIncompleteNamespaceTokens.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1014: The 'custom' directive expects a namespace name. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleEOFInvalidNamespaceTokens.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleEOFInvalidNamespaceTokens.diag.txt new file mode 100644 index 0000000000..7e7735a128 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleEOFInvalidNamespaceTokens.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1014: The 'custom' directive expects a namespace name. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleIncompleteNamespaceTokens.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleIncompleteNamespaceTokens.diag.txt new file mode 100644 index 0000000000..7e7735a128 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleIncompleteNamespaceTokens.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1014: The 'custom' directive expects a namespace name. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleInvalidNamespaceTokens.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleInvalidNamespaceTokens.diag.txt new file mode 100644 index 0000000000..7e7735a128 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_CanHandleInvalidNamespaceTokens.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1014: The 'custom' directive expects a namespace name. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsExtraContentAfterDirective.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsExtraContentAfterDirective.diag.txt new file mode 100644 index 0000000000..bbc8035249 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsExtraContentAfterDirective.diag.txt @@ -0,0 +1 @@ +(1,17): Error RZ1017: Unexpected literal following the 'custom' directive. Expected 'line break'. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsForInvalidMemberTokens.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsForInvalidMemberTokens.diag.txt new file mode 100644 index 0000000000..c8a41322a6 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsForInvalidMemberTokens.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1015: The 'custom' directive expects an identifier. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenEOFBeforeDirectiveBlockStart.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenEOFBeforeDirectiveBlockStart.diag.txt new file mode 100644 index 0000000000..6bc13c4718 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenEOFBeforeDirectiveBlockStart.diag.txt @@ -0,0 +1 @@ +(1,16): Error RZ1012: Unexpected end of file following the 'custom' directive. Expected '{'. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenExtraContentBeforeBlockStart.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenExtraContentBeforeBlockStart.diag.txt new file mode 100644 index 0000000000..8227b74116 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenExtraContentBeforeBlockStart.diag.txt @@ -0,0 +1 @@ +(1,17): Error RZ1017: Unexpected literal following the 'custom' directive. Expected '{'. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenMissingEndBrace.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenMissingEndBrace.diag.txt new file mode 100644 index 0000000000..7d15c3c5e9 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_ErrorsWhenMissingEndBrace.diag.txt @@ -0,0 +1 @@ +(1,17): Error RZ1006: The custom 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. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_FileScopedSinglyOccurring_ErrorsIfDuplicate.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_FileScopedSinglyOccurring_ErrorsIfDuplicate.diag.txt new file mode 100644 index 0000000000..6e707f9d16 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_FileScopedSinglyOccurring_ErrorsIfDuplicate.diag.txt @@ -0,0 +1 @@ +(2,1): Error RZ2001: The 'custom' directive may only occur once per document. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForNonStringValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForNonStringValue.diag.txt new file mode 100644 index 0000000000..b7818aa7a2 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForNonStringValue.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1016: The 'custom' directive expects a string surrounded by double quotes. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForPartialQuotedValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForPartialQuotedValue.diag.txt new file mode 100644 index 0000000000..b7818aa7a2 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForPartialQuotedValue.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1016: The 'custom' directive expects a string surrounded by double quotes. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForSingleQuotedValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForSingleQuotedValue.diag.txt new file mode 100644 index 0000000000..b7818aa7a2 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForSingleQuotedValue.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1016: The 'custom' directive expects a string surrounded by double quotes. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForUnquotedValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForUnquotedValue.diag.txt new file mode 100644 index 0000000000..b7818aa7a2 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_StringToken_ParserErrorForUnquotedValue.diag.txt @@ -0,0 +1 @@ +(1,9): Error RZ1016: The 'custom' directive expects a string surrounded by double quotes. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_TokensMustBeSeparatedBySpace.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_TokensMustBeSeparatedBySpace.diag.txt new file mode 100644 index 0000000000..653c80c1d1 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/DirectiveDescriptor_TokensMustBeSeparatedBySpace.diag.txt @@ -0,0 +1 @@ +(1,18): Error RZ1011: The 'custom' directives value(s) must be separated by whitespace. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/ExtensibleDirectiveErrorsIfNotAtStartOfLine.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/ExtensibleDirectiveErrorsIfNotAtStartOfLine.diag.txt new file mode 100644 index 0000000000..1ca018d1a5 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/ExtensibleDirectiveErrorsIfNotAtStartOfLine.diag.txt @@ -0,0 +1 @@ +(1,5): Error RZ2005: The 'custom` directive must appear at the start of the line. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/RemoveTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/RemoveTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt new file mode 100644 index 0000000000..8420d6c340 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/RemoveTagHelperDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt @@ -0,0 +1 @@ +(1,21): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/RemoveTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/RemoveTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt new file mode 100644 index 0000000000..c1d5bcd34e --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/RemoveTagHelperDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt @@ -0,0 +1 @@ +(1,18): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/TagHelperPrefixDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/TagHelperPrefixDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt new file mode 100644 index 0000000000..7628ab1cb8 --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/TagHelperPrefixDirective_EndQuoteRequiresDoubleQuotesAroundValue.diag.txt @@ -0,0 +1 @@ +(1,24): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/TagHelperPrefixDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/TagHelperPrefixDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt new file mode 100644 index 0000000000..c1d5bcd34e --- /dev/null +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/RazorDirectivesTest/TagHelperPrefixDirective_StartQuoteRequiresDoubleQuotesAroundValue.diag.txt @@ -0,0 +1 @@ +(1,18): Error RZ1000: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines.