Skip to content

Add support for source generators in Razor compiler #29916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Components/Components/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Microsoft.AspNetCore.Components.DynamicComponent.Type.get -> System.Type!
Microsoft.AspNetCore.Components.DynamicComponent.Type.set -> void
static Microsoft.AspNetCore.Components.ParameterView.FromDictionary(System.Collections.Generic.IDictionary<string!, object?>! parameters) -> Microsoft.AspNetCore.Components.ParameterView
virtual Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync(ulong eventHandlerId, Microsoft.AspNetCore.Components.RenderTree.EventFieldInfo? fieldInfo, System.EventArgs! eventArgs) -> System.Threading.Tasks.Task!
*REMOVED*readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeEdit.RemovedAttributeName -> string
2 changes: 2 additions & 0 deletions src/Components/Ignitor/src/Ignitor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<NoWarn>$(NoWarn);CS1591</NoWarn>
<DefineConstants>$(DefineConstants);IGNITOR</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<AddPublicApiAnalyzers>false</AddPublicApiAnalyzers>
</PropertyGroup>

<ItemGroup>
Expand Down
193 changes: 0 additions & 193 deletions src/Components/Ignitor/src/PublicAPI.Shipped.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/Components/Ignitor/src/PublicAPI.Unshipped.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Common.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.TagHelperTool, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.NET.Sdk.Razor.SourceGenerators, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Razor.Workspaces, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Remote.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ public string FilePathWithoutExtension
}
}

internal RazorSourceDocument RazorSourceDocument { get; set; }

private string DebuggerToString()
{
return CombinedPath;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static RazorSourceDocument ReadFrom(Stream stream, Encoding encoding, Raz
{
throw new ArgumentNullException(nameof(properties));
}

return new StreamSourceDocument(stream, encoding, properties);
}

Expand All @@ -179,7 +179,7 @@ public static RazorSourceDocument ReadFrom(RazorProjectItem projectItem)
}

// ProjectItem.PhysicalPath is usually an absolute (rooted) path.
var filePath = projectItem.PhysicalPath;
var filePath = projectItem.PhysicalPath;
if (string.IsNullOrEmpty(filePath))
{
// Fall back to the relative path only if necessary.
Expand All @@ -193,6 +193,11 @@ public static RazorSourceDocument ReadFrom(RazorProjectItem projectItem)
filePath = projectItem.FilePath;
}

if (projectItem.RazorSourceDocument is not null)
{
return projectItem.RazorSourceDocument;
}

using (var stream = projectItem.Read())
{
// Autodetect the encoding.
Expand All @@ -217,7 +222,7 @@ public static RazorSourceDocument Create(string content, string fileName)

return Create(content, fileName, Encoding.UTF8);
}


/// <summary>
/// Creates a <see cref="RazorSourceDocument"/> from the specified <paramref name="content"/>.
Expand Down
Loading