Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Added SourceLocation to inherited chunks \ tag helpers #2390

Closed
wants to merge 1 commit into from
Closed

Conversation

pranavkm
Copy link
Contributor

Updated CompilationResult to support compilation failures from multiple
files.

Fixes #2321

Updated CompilationResult to support compilation failures from multiple
files.

Fixes #2321
@ghost ghost added the cla-already-signed label Apr 15, 2015
@pranavkm
Copy link
Contributor Author

Ties into Diagnostics changes - aspnet/Diagnostics#123 and Razor changes - aspnet/Razor#357. The error page from Helios already supports multiple error files.

{
var sourceFilePath = group.Key;
string sourceFileContent;
if (string.Equals(assemblyName, sourceFilePath, StringComparison.Ordinal))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to show errors if they happen to be produced in the generated code (for instance a custom base type that does not have a RenderAsync method). Mapping it to the cshtml file is not very helpful in diagnosing the issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a very general statement and doesn't seem correct. if it were correct, Razor would not generate #line pragmas at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or, are you commenting only on the case where the #line mapping is currently hidden?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is for generated code that we produce but don't map back to the cshtml - this includes things like default inherited directives (IHtmlHelper<TModel>) and any code that relies on a property \ method being present on the base type DefineSection, RenderAsync etc).

@dougbu
Copy link
Member

dougbu commented Apr 15, 2015

:shipit:


public RazorCompilationService(ICompilationService compilationService,
IMvcRazorHost razorHost)
IMvcRazorHost razorHost,
IOptions<RazorViewEngineOptions> viewEngineOptions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious: Why not just do IFileProvider?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file system that we use for views specifically hangs off of RazorViewEngineOptions. It allows doing things like using resources as view sources - https://github.com/aspnet/Mvc/blob/dev/test/WebSites/RazorEmbeddedViewsWebSite/Startup.cs#L20-L23

@NTaylorMullen
Copy link
Contributor

:shipit:

@pranavkm pranavkm closed this Apr 23, 2015
@pranavkm pranavkm deleted the 2321 branch April 23, 2015 22:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants