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(
|
||||
Path.GetFileName(Context.SourceFile),
|
||||
ViewHierarchyUtility.ViewImportsFileName,
|
||||
StringComparison.Ordinal))
|
||||
StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Write a using TModel = System.Object; token during design time to make intellisense work
|
||||
writer.WriteLine($"using {ChunkHelper.TModelToken} = {typeof(object).FullName};");
|
||||
|
|
|
|||
|
|
@ -478,7 +478,8 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
GeneratorResults results;
|
||||
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
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ namespace Asp
|
|||
{
|
||||
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 void @__RazorDesignTimeHelpers__()
|
||||
|
|
@ -11,7 +11,7 @@ namespace Asp
|
|||
#pragma warning restore 219
|
||||
}
|
||||
#line hidden
|
||||
public ASPV_TestFiles_Input_Basic_cshtml()
|
||||
public ASPV_testfiles_input_basic_cshtml()
|
||||
{
|
||||
}
|
||||
#line hidden
|
||||
|
|
@ -29,12 +29,12 @@ namespace Asp
|
|||
#pragma warning disable 1998
|
||||
public override async Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/Input/Basic.cshtml"
|
||||
#line 1 "testfiles/input/basic.cshtml"
|
||||
__o = logo;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 3 "TestFiles/Input/Basic.cshtml"
|
||||
#line 3 "testfiles/input/basic.cshtml"
|
||||
__o = Html.Input("SomeKey");
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
namespace Asp
|
||||
{
|
||||
#line 1 "TestFiles/Input/Inject.cshtml"
|
||||
#line 1 "testfiles/input/inject.cshtml"
|
||||
using MyNamespace
|
||||
|
||||
#line default
|
||||
|
|
@ -8,7 +8,7 @@ using MyNamespace
|
|||
;
|
||||
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 void @__RazorDesignTimeHelpers__()
|
||||
|
|
@ -17,13 +17,13 @@ using MyNamespace
|
|||
#pragma warning restore 219
|
||||
}
|
||||
#line hidden
|
||||
public ASPV_TestFiles_Input_Inject_cshtml()
|
||||
public ASPV_testfiles_input_inject_cshtml()
|
||||
{
|
||||
}
|
||||
#line hidden
|
||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public
|
||||
#line 2 "TestFiles/Input/Inject.cshtml"
|
||||
#line 2 "testfiles/input/inject.cshtml"
|
||||
MyApp MyPropertyName
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ namespace Asp
|
|||
{
|
||||
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 void @__RazorDesignTimeHelpers__()
|
||||
{
|
||||
#pragma warning disable 219
|
||||
#line 1 "TestFiles/Input/InjectWithModel.cshtml"
|
||||
#line 1 "testfiles/input/injectwithmodel.cshtml"
|
||||
var __modelHelper = default(MyModel);
|
||||
|
||||
#line default
|
||||
|
|
@ -16,13 +16,13 @@ var __modelHelper = default(MyModel);
|
|||
#pragma warning restore 219
|
||||
}
|
||||
#line hidden
|
||||
public ASPV_TestFiles_Input_InjectWithModel_cshtml()
|
||||
public ASPV_testfiles_input_injectwithmodel_cshtml()
|
||||
{
|
||||
}
|
||||
#line hidden
|
||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public
|
||||
#line 2 "TestFiles/Input/InjectWithModel.cshtml"
|
||||
#line 2 "testfiles/input/injectwithmodel.cshtml"
|
||||
MyApp MyPropertyName
|
||||
|
||||
#line default
|
||||
|
|
@ -30,7 +30,7 @@ var __modelHelper = default(MyModel);
|
|||
{ get; private set; }
|
||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public
|
||||
#line 3 "TestFiles/Input/InjectWithModel.cshtml"
|
||||
#line 3 "testfiles/input/injectwithmodel.cshtml"
|
||||
MyService<MyModel> Html
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ namespace Asp
|
|||
{
|
||||
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 void @__RazorDesignTimeHelpers__()
|
||||
{
|
||||
#pragma warning disable 219
|
||||
#line 1 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
||||
#line 1 "testfiles/input/injectwithsemicolon.cshtml"
|
||||
var __modelHelper = default(MyModel);
|
||||
|
||||
#line default
|
||||
|
|
@ -16,13 +16,13 @@ var __modelHelper = default(MyModel);
|
|||
#pragma warning restore 219
|
||||
}
|
||||
#line hidden
|
||||
public ASPV_TestFiles_Input_InjectWithSemicolon_cshtml()
|
||||
public ASPV_testfiles_input_injectwithsemicolon_cshtml()
|
||||
{
|
||||
}
|
||||
#line hidden
|
||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public
|
||||
#line 2 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
||||
#line 2 "testfiles/input/injectwithsemicolon.cshtml"
|
||||
MyApp MyPropertyName
|
||||
|
||||
#line default
|
||||
|
|
@ -30,7 +30,7 @@ var __modelHelper = default(MyModel);
|
|||
{ get; private set; }
|
||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public
|
||||
#line 3 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
||||
#line 3 "testfiles/input/injectwithsemicolon.cshtml"
|
||||
MyService<MyModel> Html
|
||||
|
||||
#line default
|
||||
|
|
@ -38,7 +38,7 @@ var __modelHelper = default(MyModel);
|
|||
{ get; private set; }
|
||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public
|
||||
#line 4 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
||||
#line 4 "testfiles/input/injectwithsemicolon.cshtml"
|
||||
MyApp MyPropertyName2
|
||||
|
||||
#line default
|
||||
|
|
@ -46,7 +46,7 @@ var __modelHelper = default(MyModel);
|
|||
{ get; private set; }
|
||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public
|
||||
#line 5 "TestFiles/Input/InjectWithSemicolon.cshtml"
|
||||
#line 5 "testfiles/input/injectwithsemicolon.cshtml"
|
||||
MyService<MyModel> Html2
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ namespace Asp
|
|||
{
|
||||
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 void @__RazorDesignTimeHelpers__()
|
||||
{
|
||||
#pragma warning disable 219
|
||||
#line 1 "TestFiles/Input/Model.cshtml"
|
||||
#line 1 "testfiles/input/model.cshtml"
|
||||
var __modelHelper = default(System.Collections.IEnumerable);
|
||||
|
||||
#line default
|
||||
|
|
@ -16,7 +16,7 @@ var __modelHelper = default(System.Collections.IEnumerable);
|
|||
#pragma warning restore 219
|
||||
}
|
||||
#line hidden
|
||||
public ASPV_TestFiles_Input_Model_cshtml()
|
||||
public ASPV_testfiles_input_model_cshtml()
|
||||
{
|
||||
}
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Asp
|
|||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
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 void @__RazorDesignTimeHelpers__()
|
||||
|
|
@ -16,13 +16,13 @@ namespace Asp
|
|||
#pragma warning disable 219
|
||||
string __tagHelperDirectiveSyntaxHelper = null;
|
||||
__tagHelperDirectiveSyntaxHelper =
|
||||
#line 3 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
#line 3 "testfiles/input/modelexpressiontaghelper.cshtml"
|
||||
"Microsoft.AspNet.Mvc.Razor.InputTestTagHelper, Microsoft.AspNet.Mvc.Razor.Host.Test"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
;
|
||||
#line 1 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
#line 1 "testfiles/input/modelexpressiontaghelper.cshtml"
|
||||
var __modelHelper = default(DateTime);
|
||||
|
||||
#line default
|
||||
|
|
@ -32,7 +32,7 @@ var __modelHelper = default(DateTime);
|
|||
#line hidden
|
||||
private Microsoft.AspNet.Mvc.Razor.InputTestTagHelper __Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = null;
|
||||
#line hidden
|
||||
public ASPV_TestFiles_Input_ModelExpressionTagHelper_cshtml()
|
||||
public ASPV_testfiles_input_modelexpressiontaghelper_cshtml()
|
||||
{
|
||||
}
|
||||
#line hidden
|
||||
|
|
@ -51,13 +51,13 @@ var __modelHelper = default(DateTime);
|
|||
public override async Task ExecuteAsync()
|
||||
{
|
||||
__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);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__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);
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ namespace Asp
|
|||
using System.Threading.Tasks;
|
||||
|
||||
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 void @__RazorDesignTimeHelpers__()
|
||||
|
|
@ -12,13 +12,13 @@ namespace Asp
|
|||
#pragma warning restore 219
|
||||
}
|
||||
#line hidden
|
||||
public ASPV_TestFiles_Input__ViewImports_cshtml()
|
||||
public ASPV_testfiles_input__viewimports_cshtml()
|
||||
{
|
||||
}
|
||||
#line hidden
|
||||
[Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public
|
||||
#line 1 "TestFiles/Input/_ViewImports.cshtml"
|
||||
#line 1 "testfiles/input/_viewimports.cshtml"
|
||||
IHtmlHelper<dynamic> Model
|
||||
|
||||
#line default
|
||||
|
|
|
|||
Loading…
Reference in New Issue