diff --git a/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorSourceLineCollection.cs b/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorSourceLineCollection.cs
index 87749a73e6..37b5e156f1 100644
--- a/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorSourceLineCollection.cs
+++ b/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorSourceLineCollection.cs
@@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Razor.Language
// We have an exact match for the start of a line.
Debug.Assert(_lineStarts[index] == position);
- return new SourceLocation(_document.FilePath, position, index, characterIndex: 0);
+ return new SourceLocation(_document.GetFilePathForDisplay(), position, index, characterIndex: 0);
}
@@ -59,12 +59,12 @@ namespace Microsoft.AspNetCore.Razor.Language
if (index == -1)
{
// There's no preceding line, so it's based on the start of the string
- return new SourceLocation(_document.FilePath, position, 0, position);
+ return new SourceLocation(_document.GetFilePathForDisplay(), position, 0, position);
}
else
{
var characterIndex = position - _lineStarts[index];
- return new SourceLocation(_document.FilePath, position, index, characterIndex);
+ return new SourceLocation(_document.GetFilePathForDisplay(), position, index, characterIndex);
}
}
diff --git a/src/Microsoft.AspNetCore.Razor.Language/LargeTextSourceDocument.cs b/src/Microsoft.AspNetCore.Razor.Language/LargeTextSourceDocument.cs
index 20498f66b4..34e72ad984 100644
--- a/src/Microsoft.AspNetCore.Razor.Language/LargeTextSourceDocument.cs
+++ b/src/Microsoft.AspNetCore.Razor.Language/LargeTextSourceDocument.cs
@@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Razor.Language
private readonly int _length;
private byte[] _checksum;
- public LargeTextSourceDocument(StreamReader reader, int chunkMaxLength, Encoding encoding, string fileName)
+ public LargeTextSourceDocument(StreamReader reader, int chunkMaxLength, Encoding encoding, RazorSourceDocumentProperties properties)
{
if (reader == null)
{
@@ -32,9 +32,15 @@ namespace Microsoft.AspNetCore.Razor.Language
throw new ArgumentNullException(nameof(encoding));
}
+ if (properties == null)
+ {
+ throw new ArgumentNullException(nameof(properties));
+ }
+
_chunkMaxLength = chunkMaxLength;
Encoding = encoding;
- FilePath = fileName;
+ FilePath = properties.FilePath;
+ RelativePath = properties.RelativePath;
ReadChunks(reader, _chunkMaxLength, out _length, out _chunks);
_lines = new DefaultRazorSourceLineCollection(this);
@@ -59,6 +65,8 @@ namespace Microsoft.AspNetCore.Razor.Language
public override RazorSourceLineCollection Lines => _lines;
+ public override string RelativePath { get; }
+
public override void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count)
{
if (destination == null)
diff --git a/src/Microsoft.AspNetCore.Razor.Language/Properties/Resources.Designer.cs b/src/Microsoft.AspNetCore.Razor.Language/Properties/Resources.Designer.cs
index 0831a5ca2c..4c0119da51 100644
--- a/src/Microsoft.AspNetCore.Razor.Language/Properties/Resources.Designer.cs
+++ b/src/Microsoft.AspNetCore.Razor.Language/Properties/Resources.Designer.cs
@@ -1842,6 +1842,20 @@ namespace Microsoft.AspNetCore.Razor.Language
internal static string FormatUnsupportedChecksumAlgorithm(object p0, object p1, object p2, object p3)
=> string.Format(CultureInfo.CurrentCulture, GetString("UnsupportedChecksumAlgorithm"), p0, p1, p2, p3);
+ ///
+ /// The '{0}.{1}' property must not be null.
+ ///
+ internal static string PropertyMustNotBeNull
+ {
+ get => GetString("PropertyMustNotBeNull");
+ }
+
+ ///
+ /// The '{0}.{1}' property must not be null.
+ ///
+ internal static string FormatPropertyMustNotBeNull(object p0, object p1)
+ => string.Format(CultureInfo.CurrentCulture, GetString("PropertyMustNotBeNull"), p0, p1);
+
private static string GetString(string name, params string[] formatterNames)
{
var value = _resourceManager.GetString(name);
diff --git a/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocument.cs b/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocument.cs
index b0bc48773f..920113efee 100644
--- a/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocument.cs
+++ b/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocument.cs
@@ -18,15 +18,33 @@ namespace Microsoft.AspNetCore.Razor.Language
internal static readonly RazorSourceDocument[] EmptyArray = new RazorSourceDocument[0];
///
- /// Encoding of the file that the text was read from.
+ /// Gets the encoding of the text in the original source document.
///
+ ///
+ /// Depending on the method used to create a the encoding may be used to
+ /// read the file contents, or it may be solely informational. Refer to the documentation on the method
+ /// used to create the for details.
+ ///
public abstract Encoding Encoding { get; }
///
- /// Path of the file the content was read from.
+ /// Gets the file path of the orginal source document.
///
+ ///
+ /// The file path may be either an absolute path or project-relative path. An absolute path is required
+ /// to generate debuggable assemblies.
+ ///
public abstract string FilePath { get; }
+ ///
+ /// Gets the project-relative path to the source file. May be null.
+ ///
+ ///
+ /// The relative path (if provided) is used for display (error messages). The project-relative path may also
+ /// be used to embed checksums of the original source documents to support runtime recompilation of Razor code.
+ ///
+ public virtual string RelativePath => null;
+
///
/// Gets a character at given position.
///
@@ -72,6 +90,15 @@ namespace Microsoft.AspNetCore.Razor.Language
return HashAlgorithmName.SHA1.Name;
}
+ ///
+ /// Gets the file path in a format that should be used for display.
+ ///
+ /// The if set, or the .
+ public virtual string GetFilePathForDisplay()
+ {
+ return RelativePath ?? FilePath;
+ }
+
///
/// Reads the from the specified .
///
@@ -85,7 +112,8 @@ namespace Microsoft.AspNetCore.Razor.Language
throw new ArgumentNullException(nameof(stream));
}
- return new StreamSourceDocument(stream, encoding: null, fileName: fileName);
+ var properties = new RazorSourceDocumentProperties(fileName, relativePath: null);
+ return new StreamSourceDocument(stream, null, properties);
}
///
@@ -107,7 +135,35 @@ namespace Microsoft.AspNetCore.Razor.Language
throw new ArgumentNullException(nameof(encoding));
}
- return new StreamSourceDocument(stream, encoding, fileName);
+ var properties = new RazorSourceDocumentProperties(fileName, relativePath: null);
+ return new StreamSourceDocument(stream, encoding, properties);
+ }
+
+ ///
+ /// Reads the from the specified .
+ ///
+ /// The to read from.
+ /// The to use to read the .
+ /// Properties to configure the .
+ /// The .
+ public static RazorSourceDocument ReadFrom(Stream stream, Encoding encoding, RazorSourceDocumentProperties properties)
+ {
+ if (stream == null)
+ {
+ throw new ArgumentNullException(nameof(stream));
+ }
+
+ if (encoding == null)
+ {
+ throw new ArgumentNullException(nameof(encoding));
+ }
+
+ if (properties == null)
+ {
+ throw new ArgumentNullException(nameof(properties));
+ }
+
+ return new StreamSourceDocument(stream, encoding, properties);
}
///
@@ -122,22 +178,25 @@ namespace Microsoft.AspNetCore.Razor.Language
throw new ArgumentNullException(nameof(projectItem));
}
- var path = projectItem.PhysicalPath;
- if (string.IsNullOrEmpty(path))
+ // ProjectItem.PhysicalPath is usually an absolute (rooted) path.
+ var filePath = projectItem.PhysicalPath;
+ if (string.IsNullOrEmpty(filePath))
{
- path = projectItem.FilePath;
+ // Fall back to the relative path only if necessary.
+ filePath = projectItem.FilePath;
}
- using (var inputStream = projectItem.Read())
+ using (var stream = projectItem.Read())
{
- return ReadFrom(inputStream, path);
+ // Autodetect the encoding.
+ return new StreamSourceDocument(stream, null, new RazorSourceDocumentProperties(filePath, projectItem.FilePath));
}
}
///
/// Creates a from the specified .
///
- /// The template content.
+ /// The source document content.
/// The file name of the .
/// The .
/// Uses
@@ -147,7 +206,7 @@ namespace Microsoft.AspNetCore.Razor.Language
///
/// Creates a from the specified .
///
- /// The template content.
+ /// The source document content.
/// The file name of the .
/// The of the file was read from.
/// The .
@@ -163,7 +222,35 @@ namespace Microsoft.AspNetCore.Razor.Language
throw new ArgumentNullException(nameof(encoding));
}
- return new StringSourceDocument(content, encoding, fileName);
+ var properties = new RazorSourceDocumentProperties(fileName, relativePath: null);
+ return new StringSourceDocument(content, encoding, properties);
+ }
+
+ ///
+ /// Creates a from the specified .
+ ///
+ /// The source document content.
+ /// The encoding of the source document.
+ /// Properties to configure the .
+ /// The .
+ public static RazorSourceDocument Create(string content, Encoding encoding, RazorSourceDocumentProperties properties)
+ {
+ if (content == null)
+ {
+ throw new ArgumentNullException(nameof(content));
+ }
+
+ if (encoding == null)
+ {
+ throw new ArgumentNullException(nameof(encoding));
+ }
+
+ if (properties == null)
+ {
+ throw new ArgumentNullException(nameof(properties));
+ }
+
+ return new StringSourceDocument(content, encoding, properties);
}
}
}
diff --git a/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocumentProperties.cs b/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocumentProperties.cs
new file mode 100644
index 0000000000..ed48c00181
--- /dev/null
+++ b/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocumentProperties.cs
@@ -0,0 +1,57 @@
+// 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.
+
+namespace Microsoft.AspNetCore.Razor.Language
+{
+ ///
+ /// Use to configure optional properties for creating a .
+ ///
+ public sealed class RazorSourceDocumentProperties
+ {
+ ///
+ /// A with default values.
+ ///
+ internal static readonly RazorSourceDocumentProperties Default = new RazorSourceDocumentProperties();
+
+ ///
+ /// Creates a new .
+ ///
+ public RazorSourceDocumentProperties()
+ {
+ }
+
+ ///
+ /// Creates a new .
+ ///
+ ///
+ /// The path to the source file. Provide an rooted path if possible. May be null.
+ ///
+ ///
+ /// The project-relative path to the source file. May be null. Must be a non-rooted path.
+ ///
+ public RazorSourceDocumentProperties(string filePath, string relativePath)
+ {
+ // We don't do any magic or validation here since we don't need to do any I/O or interation
+ // with the file system. We didn't validate anything in 2.0 so we don't want any compat risk.
+ FilePath = filePath;
+ RelativePath = relativePath;
+ }
+
+ ///
+ /// Gets the path to the source file. May be an absolute or project-relative path. May be null.
+ ///
+ ///
+ /// An absolute path must be provided to generate debuggable assemblies.
+ ///
+ public string FilePath { get; }
+
+ ///
+ /// Gets the project-relative path to the source file. May be null.
+ ///
+ ///
+ /// The relative path (if provided) is used for display (error messages). The project-relative path may also
+ /// be used to embed checksums of the original source documents to support runtime recompilation of Razor code.
+ ///
+ public string RelativePath { get; }
+ }
+}
diff --git a/src/Microsoft.AspNetCore.Razor.Language/Resources.resx b/src/Microsoft.AspNetCore.Razor.Language/Resources.resx
index 51ebede322..f706f89561 100644
--- a/src/Microsoft.AspNetCore.Razor.Language/Resources.resx
+++ b/src/Microsoft.AspNetCore.Razor.Language/Resources.resx
@@ -530,4 +530,7 @@ Instead, wrap the contents of the block in "{{}}":
The hash algorithm '{0}' is not supported for checksum generation. Supported algorithms are: '{1}'. Set '{2}' to '{3}' to suppress automatic checksum generation.
+
+ The '{0}.{1}' property must not be null.
+
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.Razor.Language/StreamSourceDocument.cs b/src/Microsoft.AspNetCore.Razor.Language/StreamSourceDocument.cs
index 2c0fab062c..1b9d239e7b 100644
--- a/src/Microsoft.AspNetCore.Razor.Language/StreamSourceDocument.cs
+++ b/src/Microsoft.AspNetCore.Razor.Language/StreamSourceDocument.cs
@@ -15,15 +15,21 @@ namespace Microsoft.AspNetCore.Razor.Language
private readonly byte[] _checksum;
- public StreamSourceDocument(Stream stream, Encoding encoding, string fileName)
+ public StreamSourceDocument(Stream stream, Encoding encoding, RazorSourceDocumentProperties properties)
{
if (stream == null)
{
throw new ArgumentNullException(nameof(stream));
}
+ if (properties == null)
+ {
+ throw new ArgumentNullException(nameof(properties));
+ }
+
+ // Notice we don't validate the encoding here. StreamSourceDocument can compute it.
_checksum = ComputeChecksum(stream);
- _innerSourceDocument = CreateInnerSourceDocument(stream, encoding, fileName);
+ _innerSourceDocument = CreateInnerSourceDocument(stream, encoding, properties);
}
public override char this[int position] => _innerSourceDocument[position];
@@ -36,6 +42,8 @@ namespace Microsoft.AspNetCore.Razor.Language
public override RazorSourceLineCollection Lines => _innerSourceDocument.Lines;
+ public override string RelativePath => _innerSourceDocument.RelativePath;
+
public override void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count)
=> _innerSourceDocument.CopyTo(sourceIndex, destination, destinationIndex, count);
@@ -58,7 +66,7 @@ namespace Microsoft.AspNetCore.Razor.Language
}
}
- private static RazorSourceDocument CreateInnerSourceDocument(Stream stream, Encoding encoding, string fileName)
+ private static RazorSourceDocument CreateInnerSourceDocument(Stream stream, Encoding encoding, RazorSourceDocumentProperties properties)
{
var streamLength = (int)stream.Length;
var content = string.Empty;
@@ -98,14 +106,14 @@ namespace Microsoft.AspNetCore.Razor.Language
reader,
LargeObjectHeapLimitInChars,
contentEncoding,
- fileName);
+ properties);
}
content = reader.ReadToEnd();
}
}
- return new StringSourceDocument(content, contentEncoding, fileName);
+ return new StringSourceDocument(content, contentEncoding, properties);
}
}
}
diff --git a/src/Microsoft.AspNetCore.Razor.Language/StringSourceDocument.cs b/src/Microsoft.AspNetCore.Razor.Language/StringSourceDocument.cs
index 5f528024c2..a89ac1b25a 100644
--- a/src/Microsoft.AspNetCore.Razor.Language/StringSourceDocument.cs
+++ b/src/Microsoft.AspNetCore.Razor.Language/StringSourceDocument.cs
@@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Razor.Language
private readonly RazorSourceLineCollection _lines;
private byte[] _checksum;
- public StringSourceDocument(string content, Encoding encoding, string filePath)
+ public StringSourceDocument(string content, Encoding encoding, RazorSourceDocumentProperties properties)
{
if (content == null)
{
@@ -25,9 +25,15 @@ namespace Microsoft.AspNetCore.Razor.Language
throw new ArgumentNullException(nameof(encoding));
}
+ if (properties == null)
+ {
+ throw new ArgumentNullException(nameof(properties));
+ }
+
_content = content;
Encoding = encoding;
- FilePath = filePath;
+ FilePath = properties.FilePath;
+ RelativePath = properties.RelativePath;
_lines = new DefaultRazorSourceLineCollection(this);
}
@@ -37,11 +43,13 @@ namespace Microsoft.AspNetCore.Razor.Language
public override Encoding Encoding { get; }
public override string FilePath { get; }
-
+
public override int Length => _content.Length;
public override RazorSourceLineCollection Lines => _lines;
+ public override string RelativePath { get; }
+
public override void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count)
{
if (destination == null)
diff --git a/src/Microsoft.VisualStudio.Editor.Razor/TextSnapshotSourceDocument.cs b/src/Microsoft.VisualStudio.Editor.Razor/TextSnapshotSourceDocument.cs
index e965b7ae2e..ffe6c2f212 100644
--- a/src/Microsoft.VisualStudio.Editor.Razor/TextSnapshotSourceDocument.cs
+++ b/src/Microsoft.VisualStudio.Editor.Razor/TextSnapshotSourceDocument.cs
@@ -40,7 +40,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
public override RazorSourceLineCollection Lines => _lines;
public override string FilePath { get; }
-
+
public override void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count)
{
if (destination == null)
diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorIntermediateNodeLoweringPhaseTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorIntermediateNodeLoweringPhaseTest.cs
index 1288b1b127..bb53e69947 100644
--- a/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorIntermediateNodeLoweringPhaseTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorIntermediateNodeLoweringPhaseTest.cs
@@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Razor.Language
b.AddDirective(directive);
});
var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
- var importSource = TestRazorSourceDocument.Create("@custom \"hello\"", fileName: "import.cshtml");
+ var importSource = TestRazorSourceDocument.Create("@custom \"hello\"", filePath: "import.cshtml");
var codeDocument = TestRazorCodeDocument.Create("NonDirective
");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
codeDocument.SetImportSyntaxTrees(new[] { RazorSyntaxTree.Parse(importSource, options) });
@@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Razor.Language
b.AddDirective(directive);
});
var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
- var importSource = TestRazorSourceDocument.Create("@custom \"hello\"", fileName: "import.cshtml");
+ var importSource = TestRazorSourceDocument.Create("@custom \"hello\"", filePath: "import.cshtml");
var codeDocument = TestRazorCodeDocument.Create("@custom \"world\"");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
codeDocument.SetImportSyntaxTrees(new[] { RazorSyntaxTree.Parse(importSource, options) });
@@ -100,8 +100,8 @@ namespace Microsoft.AspNetCore.Razor.Language
b.AddDirective(directive);
});
var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
- var importSource1 = TestRazorSourceDocument.Create("@custom \"hello\"", fileName: "import1.cshtml");
- var importSource2 = TestRazorSourceDocument.Create("@custom \"world\"", fileName: "import2.cshtml");
+ var importSource1 = TestRazorSourceDocument.Create("@custom \"hello\"", filePath: "import1.cshtml");
+ var importSource2 = TestRazorSourceDocument.Create("@custom \"world\"", filePath: "import2.cshtml");
var codeDocument = TestRazorCodeDocument.Create("NonDirective
");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
codeDocument.SetImportSyntaxTrees(new[] { RazorSyntaxTree.Parse(importSource1, options), RazorSyntaxTree.Parse(importSource2, options) });
@@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Razor.Language
var importSource = TestRazorSourceDocument.Create(
@"@code ""code block"" { }
@razor ""razor block"" { }",
- fileName: "testImports.cshtml");
+ filePath: "testImports.cshtml");
var codeDocument = TestRazorCodeDocument.Create("NonDirective
");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
codeDocument.SetImportSyntaxTrees(new[] { RazorSyntaxTree.Parse(importSource, options) });
@@ -166,7 +166,7 @@ namespace Microsoft.AspNetCore.Razor.Language
b.AddDirective(directive);
});
var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
- var importSource = TestRazorSourceDocument.Create("@custom { }", fileName: "import.cshtml");
+ var importSource = TestRazorSourceDocument.Create("@custom { }", filePath: "import.cshtml");
var codeDocument = TestRazorCodeDocument.Create("NonDirective
");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
codeDocument.SetImportSyntaxTrees(new[] { RazorSyntaxTree.Parse(importSource, options) });
@@ -196,7 +196,7 @@ namespace Microsoft.AspNetCore.Razor.Language
b.AddDirective(directive);
});
var options = RazorParserOptions.Create(builder => builder.Directives.Add(directive));
- var importSource = TestRazorSourceDocument.Create("@custom { }", fileName: "import.cshtml");
+ var importSource = TestRazorSourceDocument.Create("@custom { }", filePath: "import.cshtml");
var codeDocument = TestRazorCodeDocument.Create("NonDirective
");
codeDocument.SetSyntaxTree(RazorSyntaxTree.Parse(codeDocument.Source, options));
codeDocument.SetImportSyntaxTrees(new[] { RazorSyntaxTree.Parse(importSource, options) });
diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorTagHelperBinderPhaseTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorTagHelperBinderPhaseTest.cs
index eaead88382..d4fd3c1910 100644
--- a/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorTagHelperBinderPhaseTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorTagHelperBinderPhaseTest.cs
@@ -36,7 +36,7 @@ namespace Microsoft.AspNetCore.Razor.Language
var content =
@"
@addTagHelper """;
- var sourceDocument = TestRazorSourceDocument.Create(content, fileName: null);
+ var sourceDocument = TestRazorSourceDocument.Create(content, filePath: null);
var codeDocument = RazorCodeDocument.Create(sourceDocument);
var originalTree = RazorSyntaxTree.Parse(sourceDocument);
codeDocument.SetSyntaxTree(originalTree);
@@ -75,7 +75,7 @@ namespace Microsoft.AspNetCore.Razor.Language
var content =
@"
@removeTagHelper """;
- var sourceDocument = TestRazorSourceDocument.Create(content, fileName: null);
+ var sourceDocument = TestRazorSourceDocument.Create(content, filePath: null);
var codeDocument = RazorCodeDocument.Create(sourceDocument);
var originalTree = RazorSyntaxTree.Parse(sourceDocument);
codeDocument.SetSyntaxTree(originalTree);
@@ -114,7 +114,7 @@ namespace Microsoft.AspNetCore.Razor.Language
var content =
@"
@tagHelperPrefix """;
- var sourceDocument = TestRazorSourceDocument.Create(content, fileName: null);
+ var sourceDocument = TestRazorSourceDocument.Create(content, filePath: null);
var codeDocument = RazorCodeDocument.Create(sourceDocument);
var originalTree = RazorSyntaxTree.Parse(sourceDocument);
codeDocument.SetSyntaxTree(originalTree);
@@ -413,7 +413,7 @@ namespace Microsoft.AspNetCore.Razor.Language
@addTagHelper *, TestAssembly