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

Using @inherits and @model together gives intellisense errors #3285

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected override CSharpCodeWritingScope BuildClassDeclaration(CSharpCodeWriter
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};");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ private static void RunDesignTimeTest(
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand All @@ -11,7 +11,7 @@ private void @__RazorDesignTimeHelpers__()
#pragma warning restore 219
}
#line hidden
public ASPV_TestFiles_Input_Basic_cshtml()
public ASPV_testfiles_input_basic_cshtml()
{
}
#line hidden
Expand All @@ -29,12 +29,12 @@ public ASPV_TestFiles_Input_Basic_cshtml()
#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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Asp
{
#line 1 "TestFiles/Input/Inject.cshtml"
#line 1 "testfiles/input/inject.cshtml"
using MyNamespace

#line default
#line hidden
;
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__()
Expand All @@ -17,13 +17,13 @@ private void @__RazorDesignTimeHelpers__()
#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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@ 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
#line hidden
#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
#line hidden
{ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@ 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
#line hidden
#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
#line hidden
{ 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
#line hidden
{ 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
#line hidden
{ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ 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
#line hidden
#pragma warning restore 219
}
#line hidden
public ASPV_TestFiles_Input_Model_cshtml()
public ASPV_testfiles_input_model_cshtml()
{
}
#line hidden
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ 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__()
{
#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
Expand All @@ -32,7 +32,7 @@ private void @__RazorDesignTimeHelpers__()
#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
Expand All @@ -51,13 +51,13 @@ public ASPV_TestFiles_Input_ModelExpressionTagHelper_cshtml()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand All @@ -12,13 +12,13 @@ private void @__RazorDesignTimeHelpers__()
#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
Expand Down