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

When code-gening inherited chunks that replace TModel token, wrap it in line pragmas #2373

Closed
pranavkm opened this issue Apr 13, 2015 · 1 comment
Assignees
Milestone

Comments

@pranavkm
Copy link
Contributor

As part of directive inheritance from _GlobalImports, we perform a string replacement on certain kinds of chunks to change the token TModel real model type. For e.g., GlobalImport might contain @inject IFoo<TModel> MyFoo which gets code-gened as public IFoo<MyRealModel> MyFoo { get; set; }.

We should instead code-gen this with line pragmas as

public IFoo<
#line 23 something.cshtml
MyRealModel
#line hidden
> { get; set; }

This will ensure errors related to MyRealModel (misspelt type name etc) map to the view file correctly.

@danroth27 danroth27 added this to the 6.0.0-beta5 milestone Apr 13, 2015
@danroth27 danroth27 modified the milestones: 6.0.0-beta5, 6.0.0-beta6 May 22, 2015
@Eilon Eilon modified the milestones: 6.0.0-beta6, 6.0.0-beta7 Jul 1, 2015
@Eilon Eilon modified the milestones: 6.0.0-beta7, 6.0.0-beta8 Aug 7, 2015
@pranavkm
Copy link
Contributor Author

@NTaylorMullen and I looked at this as part of 89f58aa and discovered line mappings need to be above full statements and wrapping partial lines like this generally gets ignored. We made some changes as to how the @model gets code gened as part of ff4100e so design time mappings continue working correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants