Using @inherits and @model together gives intellisense errors
Fixes #3243
This commit is contained in:
parent
18912b9530
commit
91cb6281e4
|
|
@ -53,7 +53,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
string.Equals(
|
string.Equals(
|
||||||
Path.GetFileName(Context.SourceFile),
|
Path.GetFileName(Context.SourceFile),
|
||||||
ViewHierarchyUtility.ViewImportsFileName,
|
ViewHierarchyUtility.ViewImportsFileName,
|
||||||
StringComparison.Ordinal))
|
StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
// Write a using TModel = System.Object; token during design time to make intellisense work
|
// Write a using TModel = System.Object; token during design time to make intellisense work
|
||||||
writer.WriteLine($"using {ChunkHelper.TModelToken} = {typeof(object).FullName};");
|
writer.WriteLine($"using {ChunkHelper.TModelToken} = {typeof(object).FullName};");
|
||||||
|
|
|
||||||
|
|
@ -478,7 +478,8 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
GeneratorResults results;
|
GeneratorResults results;
|
||||||
using (var stream = ResourceFile.GetResourceStream(_assembly, inputFile, sourceFile: true))
|
using (var stream = ResourceFile.GetResourceStream(_assembly, inputFile, sourceFile: true))
|
||||||
{
|
{
|
||||||
results = host.GenerateCode(inputFile, stream);
|
// VS tooling passes in paths in all lower case. We'll mimic this behavior in our tests.
|
||||||
|
results = host.GenerateCode(inputFile.ToLowerInvariant(), stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ namespace Asp
|
||||||
{
|
{
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
public class ASPV_TestFiles_Input_Basic_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<dynamic>
|
public class ASPV_testfiles_input_basic_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<dynamic>
|
||||||
{
|
{
|
||||||
private static object @__o;
|
private static object @__o;
|
||||||
private void @__RazorDesignTimeHelpers__()
|
private void @__RazorDesignTimeHelpers__()
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Asp
|
||||||
#pragma warning restore 219
|
#pragma warning restore 219
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
public ASPV_TestFiles_Input_Basic_cshtml()
|
public ASPV_testfiles_input_basic_cshtml()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
@ -29,12 +29,12 @@ namespace Asp
|
||||||
#pragma warning disable 1998
|
#pragma warning disable 1998
|
||||||
public override async Task ExecuteAsync()
|
public override async Task ExecuteAsync()
|
||||||
{
|
{
|
||||||
#line 1 "TestFiles/Input/Basic.cshtml"
|
#line 1 "testfiles/input/basic.cshtml"
|
||||||
__o = logo;
|
__o = logo;
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
#line 3 "TestFiles/Input/Basic.cshtml"
|
#line 3 "testfiles/input/basic.cshtml"
|
||||||
__o = Html.Input("SomeKey");
|
__o = Html.Input("SomeKey");
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace Asp
|
namespace Asp
|
||||||
{
|
{
|
||||||
#line 1 "TestFiles/Input/Inject.cshtml"
|
#line 1 "testfiles/input/inject.cshtml"
|
||||||
using MyNamespace
|
using MyNamespace
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
@ -8,7 +8,7 @@ using MyNamespace
|
||||||
;
|
;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
public class ASPV_TestFiles_Input_Inject_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<dynamic>
|
public class ASPV_testfiles_input_inject_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<dynamic>
|
||||||
{
|
{
|
||||||
private static object @__o;
|
private static object @__o;
|
||||||
private void @__RazorDesignTimeHelpers__()
|
private void @__RazorDesignTimeHelpers__()
|
||||||
|
|
@ -17,13 +17,13 @@ using MyNamespace
|
||||||
#pragma warning restore 219
|
#pragma warning restore 219
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
public ASPV_TestFiles_Input_Inject_cshtml()
|
public ASPV_testfiles_input_inject_cshtml()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||||
public
|
public
|
||||||
#line 2 "TestFiles/Input/Inject.cshtml"
|
#line 2 "testfiles/input/inject.cshtml"
|
||||||
MyApp MyPropertyName
|
MyApp MyPropertyName
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@ namespace Asp
|
||||||
{
|
{
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
public class ASPV_TestFiles_Input_InjectWithModel_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<MyModel>
|
public class ASPV_testfiles_input_injectwithmodel_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<MyModel>
|
||||||
{
|
{
|
||||||
private static object @__o;
|
private static object @__o;
|
||||||
private void @__RazorDesignTimeHelpers__()
|
private void @__RazorDesignTimeHelpers__()
|
||||||
{
|
{
|
||||||
#pragma warning disable 219
|
#pragma warning disable 219
|
||||||
#line 1 "TestFiles/Input/InjectWithModel.cshtml"
|
#line 1 "testfiles/input/injectwithmodel.cshtml"
|
||||||
var __modelHelper = default(MyModel);
|
var __modelHelper = default(MyModel);
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
@ -16,13 +16,13 @@ var __modelHelper = default(MyModel);
|
||||||
#pragma warning restore 219
|
#pragma warning restore 219
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
public ASPV_TestFiles_Input_InjectWithModel_cshtml()
|
public ASPV_testfiles_input_injectwithmodel_cshtml()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||||
public
|
public
|
||||||
#line 2 "TestFiles/Input/InjectWithModel.cshtml"
|
#line 2 "testfiles/input/injectwithmodel.cshtml"
|
||||||
MyApp MyPropertyName
|
MyApp MyPropertyName
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
@ -30,7 +30,7 @@ var __modelHelper = default(MyModel);
|
||||||
{ get; private set; }
|
{ get; private set; }
|
||||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||||
public
|
public
|
||||||
#line 3 "TestFiles/Input/InjectWithModel.cshtml"
|
#line 3 "testfiles/input/injectwithmodel.cshtml"
|
||||||
MyService<MyModel> Html
|
MyService<MyModel> Html
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@ namespace Asp
|
||||||
{
|
{
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
public class ASPV_TestFiles_Input_InjectWithSemicolon_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<MyModel>
|
public class ASPV_testfiles_input_injectwithsemicolon_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<MyModel>
|
||||||
{
|
{
|
||||||
private static object @__o;
|
private static object @__o;
|
||||||
private void @__RazorDesignTimeHelpers__()
|
private void @__RazorDesignTimeHelpers__()
|
||||||
{
|
{
|
||||||
#pragma warning disable 219
|
#pragma warning disable 219
|
||||||
#line 1 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
#line 1 "testfiles/input/injectwithsemicolon.cshtml"
|
||||||
var __modelHelper = default(MyModel);
|
var __modelHelper = default(MyModel);
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
@ -16,13 +16,13 @@ var __modelHelper = default(MyModel);
|
||||||
#pragma warning restore 219
|
#pragma warning restore 219
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
public ASPV_TestFiles_Input_InjectWithSemicolon_cshtml()
|
public ASPV_testfiles_input_injectwithsemicolon_cshtml()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||||
public
|
public
|
||||||
#line 2 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
#line 2 "testfiles/input/injectwithsemicolon.cshtml"
|
||||||
MyApp MyPropertyName
|
MyApp MyPropertyName
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
@ -30,7 +30,7 @@ var __modelHelper = default(MyModel);
|
||||||
{ get; private set; }
|
{ get; private set; }
|
||||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||||
public
|
public
|
||||||
#line 3 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
#line 3 "testfiles/input/injectwithsemicolon.cshtml"
|
||||||
MyService<MyModel> Html
|
MyService<MyModel> Html
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
@ -38,7 +38,7 @@ var __modelHelper = default(MyModel);
|
||||||
{ get; private set; }
|
{ get; private set; }
|
||||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||||
public
|
public
|
||||||
#line 4 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
#line 4 "testfiles/input/injectwithsemicolon.cshtml"
|
||||||
MyApp MyPropertyName2
|
MyApp MyPropertyName2
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
@ -46,7 +46,7 @@ var __modelHelper = default(MyModel);
|
||||||
{ get; private set; }
|
{ get; private set; }
|
||||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||||
public
|
public
|
||||||
#line 5 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
#line 5 "testfiles/input/injectwithsemicolon.cshtml"
|
||||||
MyService<MyModel> Html2
|
MyService<MyModel> Html2
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@ namespace Asp
|
||||||
{
|
{
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
public class ASPV_TestFiles_Input_Model_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<System.Collections.IEnumerable>
|
public class ASPV_testfiles_input_model_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<System.Collections.IEnumerable>
|
||||||
{
|
{
|
||||||
private static object @__o;
|
private static object @__o;
|
||||||
private void @__RazorDesignTimeHelpers__()
|
private void @__RazorDesignTimeHelpers__()
|
||||||
{
|
{
|
||||||
#pragma warning disable 219
|
#pragma warning disable 219
|
||||||
#line 1 "TestFiles/Input/Model.cshtml"
|
#line 1 "testfiles/input/model.cshtml"
|
||||||
var __modelHelper = default(System.Collections.IEnumerable);
|
var __modelHelper = default(System.Collections.IEnumerable);
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
@ -16,7 +16,7 @@ var __modelHelper = default(System.Collections.IEnumerable);
|
||||||
#pragma warning restore 219
|
#pragma warning restore 219
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
public ASPV_TestFiles_Input_Model_cshtml()
|
public ASPV_testfiles_input_model_cshtml()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace Asp
|
||||||
using Microsoft.AspNet.Mvc.Rendering;
|
using Microsoft.AspNet.Mvc.Rendering;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
public class ASPV_TestFiles_Input_ModelExpressionTagHelper_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<DateTime>
|
public class ASPV_testfiles_input_modelexpressiontaghelper_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<DateTime>
|
||||||
{
|
{
|
||||||
private static object @__o;
|
private static object @__o;
|
||||||
private void @__RazorDesignTimeHelpers__()
|
private void @__RazorDesignTimeHelpers__()
|
||||||
|
|
@ -16,13 +16,13 @@ namespace Asp
|
||||||
#pragma warning disable 219
|
#pragma warning disable 219
|
||||||
string __tagHelperDirectiveSyntaxHelper = null;
|
string __tagHelperDirectiveSyntaxHelper = null;
|
||||||
__tagHelperDirectiveSyntaxHelper =
|
__tagHelperDirectiveSyntaxHelper =
|
||||||
#line 3 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
#line 3 "testfiles/input/modelexpressiontaghelper.cshtml"
|
||||||
"Microsoft.AspNet.Mvc.Razor.InputTestTagHelper, Microsoft.AspNet.Mvc.Razor.Host.Test"
|
"Microsoft.AspNet.Mvc.Razor.InputTestTagHelper, Microsoft.AspNet.Mvc.Razor.Host.Test"
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
;
|
;
|
||||||
#line 1 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
#line 1 "testfiles/input/modelexpressiontaghelper.cshtml"
|
||||||
var __modelHelper = default(DateTime);
|
var __modelHelper = default(DateTime);
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
@ -32,7 +32,7 @@ var __modelHelper = default(DateTime);
|
||||||
#line hidden
|
#line hidden
|
||||||
private Microsoft.AspNet.Mvc.Razor.InputTestTagHelper __Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = null;
|
private Microsoft.AspNet.Mvc.Razor.InputTestTagHelper __Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = null;
|
||||||
#line hidden
|
#line hidden
|
||||||
public ASPV_TestFiles_Input_ModelExpressionTagHelper_cshtml()
|
public ASPV_testfiles_input_modelexpressiontaghelper_cshtml()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
@ -51,13 +51,13 @@ var __modelHelper = default(DateTime);
|
||||||
public override async Task ExecuteAsync()
|
public override async Task ExecuteAsync()
|
||||||
{
|
{
|
||||||
__Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = CreateTagHelper<Microsoft.AspNet.Mvc.Razor.InputTestTagHelper>();
|
__Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = CreateTagHelper<Microsoft.AspNet.Mvc.Razor.InputTestTagHelper>();
|
||||||
#line 5 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
#line 5 "testfiles/input/modelexpressiontaghelper.cshtml"
|
||||||
__Microsoft_AspNet_Mvc_Razor_InputTestTagHelper.For = CreateModelExpression(__model => __model.Now);
|
__Microsoft_AspNet_Mvc_Razor_InputTestTagHelper.For = CreateModelExpression(__model => __model.Now);
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
__Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = CreateTagHelper<Microsoft.AspNet.Mvc.Razor.InputTestTagHelper>();
|
__Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = CreateTagHelper<Microsoft.AspNet.Mvc.Razor.InputTestTagHelper>();
|
||||||
#line 6 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
#line 6 "testfiles/input/modelexpressiontaghelper.cshtml"
|
||||||
__Microsoft_AspNet_Mvc_Razor_InputTestTagHelper.For = CreateModelExpression(__model => Model);
|
__Microsoft_AspNet_Mvc_Razor_InputTestTagHelper.For = CreateModelExpression(__model => Model);
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ namespace Asp
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using TModel = System.Object;
|
using TModel = System.Object;
|
||||||
public class ASPV_TestFiles_Input__ViewImports_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<dynamic>
|
public class ASPV_testfiles_input__viewimports_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage<dynamic>
|
||||||
{
|
{
|
||||||
private static object @__o;
|
private static object @__o;
|
||||||
private void @__RazorDesignTimeHelpers__()
|
private void @__RazorDesignTimeHelpers__()
|
||||||
|
|
@ -12,13 +12,13 @@ namespace Asp
|
||||||
#pragma warning restore 219
|
#pragma warning restore 219
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
public ASPV_TestFiles_Input__ViewImports_cshtml()
|
public ASPV_testfiles_input__viewimports_cshtml()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#line hidden
|
#line hidden
|
||||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||||
public
|
public
|
||||||
#line 1 "TestFiles/Input/_ViewImports.cshtml"
|
#line 1 "testfiles/input/_viewimports.cshtml"
|
||||||
IHtmlHelper<dynamic> Model
|
IHtmlHelper<dynamic> Model
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue