diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/AssemblyAttributeInjectionPass.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/AssemblyAttributeInjectionPass.cs index 51e8f185e0..ef02120f02 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/AssemblyAttributeInjectionPass.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/AssemblyAttributeInjectionPass.cs @@ -22,13 +22,13 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions } var @class = documentNode.FindPrimaryClass(); - if (@class == null || string.IsNullOrEmpty(@class.Name)) + if (@class == null || string.IsNullOrEmpty(@class.ClassName)) { // No class node or it's incomplete. Skip. return; } - var generatedTypeName = $"{@namespace.Content}.{@class.Name}"; + var generatedTypeName = $"{@namespace.Content}.{@class.ClassName}"; var path = codeDocument.GetRelativePath(); var escapedPath = EscapeAsVerbatimLiteral(path); diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/InjectDirective.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/InjectDirective.cs index 903f5a2185..fc6fabbac5 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/InjectDirective.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/InjectDirective.cs @@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions public override void VisitDirective(DirectiveIntermediateNode node) { - if (node.Descriptor == Directive) + if (node.Directive == Directive) { Directives.Add(node); } diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ModelDirective.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ModelDirective.cs index e8a38f1e68..db37b74ca6 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ModelDirective.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ModelDirective.cs @@ -55,7 +55,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions if (document.DocumentKind == RazorPageDocumentClassifierPass.RazorPageDocumentKind) { - return visitor.Class.Name; + return visitor.Class.ClassName; } else { @@ -128,7 +128,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions public override void VisitDirective(DirectiveIntermediateNode node) { - if (node.Descriptor == Directive) + if (node.Directive == Directive) { ModelDirectives.Add(node); } diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/MvcRazorTemplateEngine.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/MvcRazorTemplateEngine.cs index 9f61050049..c30ad4a037 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/MvcRazorTemplateEngine.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/MvcRazorTemplateEngine.cs @@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions public override RazorCodeDocument CreateCodeDocument(RazorProjectItem projectItem) { var codeDocument = base.CreateCodeDocument(projectItem); - codeDocument.SetRelativePath(projectItem.Path); + codeDocument.SetRelativePath(projectItem.FilePath); return codeDocument; } diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/MvcViewDocumentClassifierPass.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/MvcViewDocumentClassifierPass.cs index cec740f156..ac524144d1 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/MvcViewDocumentClassifierPass.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/MvcViewDocumentClassifierPass.cs @@ -26,12 +26,12 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions @namespace.Content = "AspNetCore"; - @class.Name = CSharpIdentifier.GetClassNameFromPath(filePath); + @class.ClassName = CSharpIdentifier.GetClassNameFromPath(filePath); @class.BaseType = "global::Microsoft.AspNetCore.Mvc.Razor.RazorPage"; @class.Modifiers.Clear(); @class.Modifiers.Add("public"); - method.Name = "ExecuteAsync"; + method.MethodName = "ExecuteAsync"; method.Modifiers.Clear(); method.Modifiers.Add("public"); method.Modifiers.Add("async"); diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/NamespaceDirective.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/NamespaceDirective.cs index 9db3e0e091..98ec0ea336 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/NamespaceDirective.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/NamespaceDirective.cs @@ -70,11 +70,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var prefix = CSharpIdentifier.SanitizeClassName(Path.GetFileNameWithoutExtension(codeDocument.Source.FilePath)); if (@class != null && documentNode.DocumentKind == RazorPageDocumentClassifierPass.RazorPageDocumentKind) { - @class.Name = prefix + "_Page"; + @class.ClassName = prefix + "_Page"; } else if (@class != null && documentNode.DocumentKind == MvcViewDocumentClassifierPass.MvcViewDocumentKind) { - @class.Name = prefix + "_View"; + @class.ClassName = prefix + "_View"; } } @@ -194,7 +194,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions public override void VisitDirective(DirectiveIntermediateNode node) { - if (node.Descriptor == Directive) + if (node.Directive == Directive) { LastNamespaceDirective = node; } diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/PageDirective.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/PageDirective.cs index 2044117e25..55f502b80d 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/PageDirective.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/PageDirective.cs @@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions public override void VisitDirective(DirectiveIntermediateNode node) { - if (node.Descriptor == Directive) + if (node.Directive == Directive) { DirectiveNode = node; DirectiveTokens = node.Tokens; @@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions public override void VisitMalformedDirective(MalformedDirectiveIntermediateNode node) { - if (DirectiveTokens == null && node.Descriptor == Directive) + if (DirectiveTokens == null && node.Directive == Directive) { DirectiveNode = node; DirectiveTokens = node.Tokens; diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/RazorPageDocumentClassifierPass.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/RazorPageDocumentClassifierPass.cs index 6e4131dd54..c69cd9ac16 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/RazorPageDocumentClassifierPass.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/RazorPageDocumentClassifierPass.cs @@ -31,12 +31,12 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions @namespace.Content = "AspNetCore"; @class.BaseType = "global::Microsoft.AspNetCore.Mvc.RazorPages.Page"; - @class.Name = CSharpIdentifier.GetClassNameFromPath(filePath); + @class.ClassName = CSharpIdentifier.GetClassNameFromPath(filePath); @class.Modifiers.Clear(); @class.Modifiers.Add("public"); - method.Name = "ExecuteAsync"; + method.MethodName = "ExecuteAsync"; method.Modifiers.Clear(); method.Modifiers.Add("public"); method.Modifiers.Add("async"); diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperPass.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperPass.cs index 03cb7c1f50..96b0935c63 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperPass.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperPass.cs @@ -135,8 +135,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions { "private", }, - Name = context.GetFieldName(tagHelper), - Type = "global::" + context.GetFullyQualifiedName(tagHelper), + FieldName = context.GetFieldName(tagHelper), + FieldType = "global::" + context.GetFullyQualifiedName(tagHelper), }); } @@ -310,7 +310,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions } var className = $"__Generated__{tagHelper.GetViewComponentName()}ViewComponentTagHelper"; - var fullyQualifiedName = $"{Namespace.Content}.{Class.Name}.{className}"; + var fullyQualifiedName = $"{Namespace.Content}.{Class.ClassName}.{className}"; var fieldName = GenerateFieldName(tagHelper); _tagHelpers.Add(tagHelper, (className, fullyQualifiedName, fieldName)); diff --git a/src/Microsoft.AspNetCore.Razor.Language/CodeGeneration/DefaultDocumentWriter.cs b/src/Microsoft.AspNetCore.Razor.Language/CodeGeneration/DefaultDocumentWriter.cs index d2788e8c40..1469ec377c 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/CodeGeneration/DefaultDocumentWriter.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/CodeGeneration/DefaultDocumentWriter.cs @@ -118,7 +118,7 @@ namespace Microsoft.AspNetCore.Razor.Language.CodeGeneration public override void VisitClassDeclaration(ClassDeclarationIntermediateNode node) { - using (Context.CodeWriter.BuildClassDeclaration(node.Modifiers, node.Name, node.BaseType, node.Interfaces)) + using (Context.CodeWriter.BuildClassDeclaration(node.Modifiers, node.ClassName, node.BaseType, node.Interfaces)) { VisitDefault(node); } @@ -137,7 +137,7 @@ namespace Microsoft.AspNetCore.Razor.Language.CodeGeneration Context.CodeWriter .Write(node.ReturnType) .Write(" ") - .Write(node.Name) + .Write(node.MethodName) .WriteLine("()"); using (Context.CodeWriter.BuildScope()) @@ -150,12 +150,12 @@ namespace Microsoft.AspNetCore.Razor.Language.CodeGeneration public override void VisitFieldDeclaration(FieldDeclarationIntermediateNode node) { - Context.CodeWriter.WriteField(node.Modifiers, node.Type, node.Name); + Context.CodeWriter.WriteField(node.Modifiers, node.FieldType, node.FieldName); } public override void VisitPropertyDeclaration(PropertyDeclarationIntermediateNode node) { - Context.CodeWriter.WriteAutoPropertyDeclaration(node.Modifiers, node.Type, node.Name); + Context.CodeWriter.WriteAutoPropertyDeclaration(node.Modifiers, node.PropertyType, node.PropertyName); } public override void VisitExtension(ExtensionIntermediateNode node) diff --git a/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorIntermediateNodeLoweringPhase.cs b/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorIntermediateNodeLoweringPhase.cs index 6c5d63731a..7a5b9e34a8 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorIntermediateNodeLoweringPhase.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/DefaultRazorIntermediateNodeLoweringPhase.cs @@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Razor.Language { var reference = visitor.Directives[i]; var directive = (DirectiveIntermediateNode)reference.Node; - var descriptor = directive.Descriptor; + var descriptor = directive.Directive; var seenDirective = !seenDirectives.Add(descriptor); if (!directive.IsImported()) @@ -177,7 +177,7 @@ namespace Microsoft.AspNetCore.Razor.Language _builder.Add(new DirectiveTokenIntermediateNode() { Content = span.Content, - Descriptor = chunkGenerator.Descriptor, + DirectiveToken = chunkGenerator.Descriptor, Source = BuildSourceSpanFromNode(span), }); } @@ -189,8 +189,8 @@ namespace Microsoft.AspNetCore.Razor.Language { directiveNode = new MalformedDirectiveIntermediateNode() { - Name = chunkGenerator.Descriptor.Directive, - Descriptor = chunkGenerator.Descriptor, + DirectiveName = chunkGenerator.Descriptor.Directive, + Directive = chunkGenerator.Descriptor, Source = BuildSourceSpanFromNode(block), }; } @@ -198,8 +198,8 @@ namespace Microsoft.AspNetCore.Razor.Language { directiveNode = new DirectiveIntermediateNode() { - Name = chunkGenerator.Descriptor.Directive, - Descriptor = chunkGenerator.Descriptor, + DirectiveName = chunkGenerator.Descriptor.Directive, + Directive = chunkGenerator.Descriptor, Source = BuildSourceSpanFromNode(block), }; } @@ -230,8 +230,8 @@ namespace Microsoft.AspNetCore.Razor.Language { directiveNode = new MalformedDirectiveIntermediateNode() { - Name = CSharpCodeParser.AddTagHelperDirectiveDescriptor.Directive, - Descriptor = CSharpCodeParser.AddTagHelperDirectiveDescriptor, + DirectiveName = CSharpCodeParser.AddTagHelperDirectiveDescriptor.Directive, + Directive = CSharpCodeParser.AddTagHelperDirectiveDescriptor, Source = BuildSourceSpanFromNode(span), }; } @@ -239,8 +239,8 @@ namespace Microsoft.AspNetCore.Razor.Language { directiveNode = new DirectiveIntermediateNode() { - Name = CSharpCodeParser.AddTagHelperDirectiveDescriptor.Directive, - Descriptor = CSharpCodeParser.AddTagHelperDirectiveDescriptor, + DirectiveName = CSharpCodeParser.AddTagHelperDirectiveDescriptor.Directive, + Directive = CSharpCodeParser.AddTagHelperDirectiveDescriptor, Source = BuildSourceSpanFromNode(span), }; } @@ -255,7 +255,7 @@ namespace Microsoft.AspNetCore.Razor.Language _builder.Add(new DirectiveTokenIntermediateNode() { Content = chunkGenerator.LookupText, - Descriptor = CSharpCodeParser.AddTagHelperDirectiveDescriptor.Tokens.First(), + DirectiveToken = CSharpCodeParser.AddTagHelperDirectiveDescriptor.Tokens.First(), Source = BuildSourceSpanFromNode(span), }); @@ -269,8 +269,8 @@ namespace Microsoft.AspNetCore.Razor.Language { directiveNode = new MalformedDirectiveIntermediateNode() { - Name = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor.Directive, - Descriptor = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor, + DirectiveName = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor.Directive, + Directive = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor, Source = BuildSourceSpanFromNode(span), }; } @@ -278,8 +278,8 @@ namespace Microsoft.AspNetCore.Razor.Language { directiveNode = new DirectiveIntermediateNode() { - Name = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor.Directive, - Descriptor = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor, + DirectiveName = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor.Directive, + Directive = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor, Source = BuildSourceSpanFromNode(span), }; } @@ -294,7 +294,7 @@ namespace Microsoft.AspNetCore.Razor.Language _builder.Add(new DirectiveTokenIntermediateNode() { Content = chunkGenerator.LookupText, - Descriptor = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor.Tokens.First(), + DirectiveToken = CSharpCodeParser.RemoveTagHelperDirectiveDescriptor.Tokens.First(), Source = BuildSourceSpanFromNode(span), }); @@ -308,8 +308,8 @@ namespace Microsoft.AspNetCore.Razor.Language { directiveNode = new MalformedDirectiveIntermediateNode() { - Name = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor.Directive, - Descriptor = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor, + DirectiveName = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor.Directive, + Directive = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor, Source = BuildSourceSpanFromNode(span), }; } @@ -317,8 +317,8 @@ namespace Microsoft.AspNetCore.Razor.Language { directiveNode = new DirectiveIntermediateNode() { - Name = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor.Directive, - Descriptor = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor, + DirectiveName = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor.Directive, + Directive = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor, Source = BuildSourceSpanFromNode(span), }; } @@ -333,7 +333,7 @@ namespace Microsoft.AspNetCore.Razor.Language _builder.Add(new DirectiveTokenIntermediateNode() { Content = chunkGenerator.Prefix, - Descriptor = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor.Tokens.First(), + DirectiveToken = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor.Tokens.First(), Source = BuildSourceSpanFromNode(span), }); diff --git a/src/Microsoft.AspNetCore.Razor.Language/Extensions/DefaultTagHelperOptimizationPass.cs b/src/Microsoft.AspNetCore.Razor.Language/Extensions/DefaultTagHelperOptimizationPass.cs index e9be0a4901..cecb8c716c 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Extensions/DefaultTagHelperOptimizationPass.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Extensions/DefaultTagHelperOptimizationPass.cs @@ -201,8 +201,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Extensions { "private", }, - Name = context.GetFieldName(tagHelper), - Type = "global::" + tagHelper.GetTypeName(), + FieldName = context.GetFieldName(tagHelper), + FieldType = "global::" + tagHelper.GetTypeName(), }); } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Extensions/DesignTimeDirectiveTargetExtension.cs b/src/Microsoft.AspNetCore.Razor.Language/Extensions/DesignTimeDirectiveTargetExtension.cs index a558bbf838..8ba3733039 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Extensions/DesignTimeDirectiveTargetExtension.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Extensions/DesignTimeDirectiveTargetExtension.cs @@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Extensions private void WriteDesignTimeDirectiveToken(CodeRenderingContext context, DirectiveTokenIntermediateNode node) { - var tokenKind = node.Descriptor.Kind; + var tokenKind = node.DirectiveToken.Kind; if (!node.Source.HasValue || !string.Equals( context.SourceDocument?.FilePath, diff --git a/src/Microsoft.AspNetCore.Razor.Language/FileSystemRazorProjectItem.cs b/src/Microsoft.AspNetCore.Razor.Language/FileSystemRazorProjectItem.cs index cd36649dc8..4138fbc3d8 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/FileSystemRazorProjectItem.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/FileSystemRazorProjectItem.cs @@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Razor.Language public FileSystemRazorProjectItem(string basePath, string path, FileInfo file) { BasePath = basePath; - Path = path; + FilePath = path; File = file; } @@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Razor.Language public override string BasePath { get; } - public override string Path { get; } + public override string FilePath { get; } public override bool Exists => File.Exists; diff --git a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/ClassDeclarationIntermediateNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/ClassDeclarationIntermediateNode.cs index 85dc1aeb7c..3804ca8a4d 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/ClassDeclarationIntermediateNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/ClassDeclarationIntermediateNode.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate public IList Modifiers { get; } = new List(); - public string Name { get; set; } + public string ClassName { get; set; } public string BaseType { get; set; } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DirectiveIntermediateNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DirectiveIntermediateNode.cs index 6c1b4c114e..abb3a933de 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DirectiveIntermediateNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DirectiveIntermediateNode.cs @@ -10,11 +10,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate { public override IntermediateNodeCollection Children { get; } = new IntermediateNodeCollection(); - public string Name { get; set; } + public string DirectiveName { get; set; } public IEnumerable Tokens => Children.OfType(); - public DirectiveDescriptor Descriptor { get; set; } + public DirectiveDescriptor Directive { get; set; } public override void Accept(IntermediateNodeVisitor visitor) { diff --git a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DirectiveTokenIntermediateNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DirectiveTokenIntermediateNode.cs index dba8688c78..7db3769a08 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DirectiveTokenIntermediateNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DirectiveTokenIntermediateNode.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate public string Content { get; set; } - public DirectiveTokenDescriptor Descriptor { get; set; } + public DirectiveTokenDescriptor DirectiveToken { get; set; } public override void Accept(IntermediateNodeVisitor visitor) { diff --git a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DocumentIntermediateNodeExtensions.cs b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DocumentIntermediateNodeExtensions.cs index 961c39e173..c1482fbb67 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DocumentIntermediateNodeExtensions.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/DocumentIntermediateNodeExtensions.cs @@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate public override void VisitDirective(DirectiveIntermediateNode node) { - if (_directive == node.Descriptor) + if (_directive == node.Directive) { Directives.Add(new IntermediateNodeReference(Parent, node)); } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/FieldDeclarationIntermediateNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/FieldDeclarationIntermediateNode.cs index b0227bd5f4..6719f0768e 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/FieldDeclarationIntermediateNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/FieldDeclarationIntermediateNode.cs @@ -12,9 +12,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate public IList Modifiers { get; } = new List(); - public string Name { get; set; } + public string FieldName { get; set; } - public string Type { get; set; } + public string FieldType { get; set; } public override void Accept(IntermediateNodeVisitor visitor) { diff --git a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/MalformedDirectiveIntermediateNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/MalformedDirectiveIntermediateNode.cs index 1ccfec030a..22d23927ca 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/MalformedDirectiveIntermediateNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/MalformedDirectiveIntermediateNode.cs @@ -10,11 +10,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate { public override IntermediateNodeCollection Children { get; } = new IntermediateNodeCollection(); - public string Name { get; set; } + public string DirectiveName { get; set; } public IEnumerable Tokens => Children.OfType(); - public DirectiveDescriptor Descriptor { get; set; } + public DirectiveDescriptor Directive { get; set; } public override void Accept(IntermediateNodeVisitor visitor) { diff --git a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/MethodDeclarationIntermediateNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/MethodDeclarationIntermediateNode.cs index 877e30f325..85bdd7641e 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/MethodDeclarationIntermediateNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/MethodDeclarationIntermediateNode.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate public IList Modifiers { get; } = new List(); - public string Name { get; set; } + public string MethodName { get; set; } public string ReturnType { get; set; } diff --git a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/PropertyDeclarationIntermediateNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/PropertyDeclarationIntermediateNode.cs index a7ebaeb759..3b7242c5bd 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/PropertyDeclarationIntermediateNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/PropertyDeclarationIntermediateNode.cs @@ -12,9 +12,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate public IList Modifiers { get; } = new List(); - public string Name { get; set; } + public string PropertyName { get; set; } - public string Type { get; set; } + public string PropertyType { get; set; } public override void Accept(IntermediateNodeVisitor visitor) { diff --git a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/TagHelperIntermediateNode.cs b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/TagHelperIntermediateNode.cs index 2003882a19..a7d9704ae4 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Intermediate/TagHelperIntermediateNode.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Intermediate/TagHelperIntermediateNode.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate public string TagName { get; set; } - public ICollection TagHelpers { get; } = new List(); + public IList TagHelpers { get; } = new List(); public TagHelperBodyIntermediateNode Body => Children.OfType().SingleOrDefault(); diff --git a/src/Microsoft.AspNetCore.Razor.Language/NotFoundProjectItem.cs b/src/Microsoft.AspNetCore.Razor.Language/NotFoundProjectItem.cs index ecbb8dce32..6989ce7f63 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/NotFoundProjectItem.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/NotFoundProjectItem.cs @@ -19,14 +19,14 @@ namespace Microsoft.AspNetCore.Razor.Language public NotFoundProjectItem(string basePath, string path) { BasePath = basePath; - Path = path; + FilePath = path; } /// public override string BasePath { get; } /// - public override string Path { get; } + public override string FilePath { get; } /// public override bool Exists => false; diff --git a/src/Microsoft.AspNetCore.Razor.Language/RazorEngine.cs b/src/Microsoft.AspNetCore.Razor.Language/RazorEngine.cs index 1c7c4240e0..2c0d4d28a4 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/RazorEngine.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/RazorEngine.cs @@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Razor.Language var configurationFeature = new DefaultDocumentClassifierPassFeature(); configurationFeature.ConfigureClass.Add((document, @class) => { - @class.Name = "Template"; + @class.ClassName = "Template"; @class.Modifiers.Add("public"); }); @@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Razor.Language configurationFeature.ConfigureMethod.Add((document, method) => { - method.Name = "ExecuteAsync"; + method.MethodName = "ExecuteAsync"; method.ReturnType = $"global::{typeof(Task).FullName}"; method.Modifiers.Add("public"); diff --git a/src/Microsoft.AspNetCore.Razor.Language/RazorProjectItem.cs b/src/Microsoft.AspNetCore.Razor.Language/RazorProjectItem.cs index 6928158752..ccb61711bc 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/RazorProjectItem.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/RazorProjectItem.cs @@ -18,9 +18,9 @@ namespace Microsoft.AspNetCore.Razor.Language public abstract string BasePath { get; } /// - /// Path relative to . + /// File path relative to . /// - public abstract string Path { get; } + public abstract string FilePath { get; } /// /// The absolute path to the file, including the file name. @@ -47,11 +47,11 @@ namespace Microsoft.AspNetCore.Razor.Language { if (BasePath == "/") { - return Path; + return FilePath; } else { - return BasePath + Path; + return BasePath + FilePath; } } } @@ -82,26 +82,26 @@ namespace Microsoft.AspNetCore.Razor.Language { get { - var index = Path.LastIndexOf('/'); - return Path.Substring(index + 1); + var index = FilePath.LastIndexOf('/'); + return FilePath.Substring(index + 1); } } /// - /// Path relative to without the extension. + /// File path relative to without the extension. /// - public string PathWithoutExtension + public string FilePathWithoutExtension { get { - var index = Path.LastIndexOf('.'); + var index = FilePath.LastIndexOf('.'); if (index == -1) { - return Path; + return FilePath; } else { - return Path.Substring(0, index); + return FilePath.Substring(0, index); } } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocument.cs b/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocument.cs index 012f5c5868..868e25db88 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocument.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/RazorSourceDocument.cs @@ -110,7 +110,7 @@ namespace Microsoft.AspNetCore.Razor.Language var path = projectItem.PhysicalPath; if (string.IsNullOrEmpty(path)) { - path = projectItem.Path; + path = projectItem.FilePath; } using (var inputStream = projectItem.Read()) diff --git a/src/Microsoft.AspNetCore.Razor.Language/RazorTemplateEngine.cs b/src/Microsoft.AspNetCore.Razor.Language/RazorTemplateEngine.cs index 5717db117d..73bbb4d9cf 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/RazorTemplateEngine.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/RazorTemplateEngine.cs @@ -93,7 +93,7 @@ namespace Microsoft.AspNetCore.Razor.Language if (!projectItem.Exists) { - throw new InvalidOperationException(Resources.FormatRazorTemplateEngine_ItemCouldNotBeFound(projectItem.Path)); + throw new InvalidOperationException(Resources.FormatRazorTemplateEngine_ItemCouldNotBeFound(projectItem.FilePath)); } var codeDocument = CreateCodeDocument(projectItem); @@ -146,7 +146,7 @@ namespace Microsoft.AspNetCore.Razor.Language if (!projectItem.Exists) { - throw new InvalidOperationException(Resources.FormatRazorTemplateEngine_ItemCouldNotBeFound(projectItem.Path)); + throw new InvalidOperationException(Resources.FormatRazorTemplateEngine_ItemCouldNotBeFound(projectItem.FilePath)); } var source = RazorSourceDocument.ReadFrom(projectItem); @@ -233,7 +233,7 @@ namespace Microsoft.AspNetCore.Razor.Language var importsFileName = Options.ImportsFileName; if (!string.IsNullOrEmpty(importsFileName)) { - return Project.FindHierarchicalItems(projectItem.Path, importsFileName); + return Project.FindHierarchicalItems(projectItem.FilePath, importsFileName); } return Enumerable.Empty(); diff --git a/src/RazorPageGenerator/Program.cs b/src/RazorPageGenerator/Program.cs index 3229901b76..131f662265 100644 --- a/src/RazorPageGenerator/Program.cs +++ b/src/RazorPageGenerator/Program.cs @@ -46,7 +46,7 @@ namespace RazorPageGenerator .SetBaseType("Microsoft.Extensions.RazorViews.BaseView") .ConfigureClass((document, @class) => { - @class.Name = Path.GetFileNameWithoutExtension(document.Source.FilePath); + @class.ClassName = Path.GetFileNameWithoutExtension(document.Source.FilePath); @class.Modifiers.Clear(); @class.Modifiers.Add("internal"); }); @@ -134,7 +134,7 @@ namespace RazorPageGenerator public override string BasePath => _source.BasePath; - public override string Path => _source.Path; + public override string FilePath => _source.FilePath; // Mask the full name since we don't want a developer's local file paths to be commited. public override string PhysicalPath => _source.FileName; diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/AssemblyAttributeInjectionPassTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/AssemblyAttributeInjectionPassTest.cs index 52fad6b872..36e9adae36 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/AssemblyAttributeInjectionPassTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/AssemblyAttributeInjectionPassTest.cs @@ -121,7 +121,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Push(@namespace); var @class = new ClassDeclarationIntermediateNode { - Name = "SomeName", + ClassName = "SomeName", Annotations = { [CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass, @@ -163,7 +163,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Push(@namespace); var @class = new ClassDeclarationIntermediateNode { - Name = "SomeName", + ClassName = "SomeName", Annotations = { [CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass, @@ -214,7 +214,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Push(@namespace); var @class = new ClassDeclarationIntermediateNode { - Name = "SomeName", + ClassName = "SomeName", Annotations = { [CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass, @@ -256,7 +256,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var builder = IntermediateNodeBuilder.Create(irDocument); var pageDirective = new DirectiveIntermediateNode { - Descriptor = PageDirective.Directive, + Directive = PageDirective.Directive, }; builder.Add(pageDirective); @@ -271,7 +271,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Push(@namespace); var @class = new ClassDeclarationIntermediateNode { - Name = "SomeName", + ClassName = "SomeName", Annotations = { [CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass, @@ -323,7 +323,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Push(@namespace); var @class = new ClassDeclarationIntermediateNode { - Name = "SomeName", + ClassName = "SomeName", Annotations = { [CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass, diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/MvcViewDocumentClassifierPassTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/MvcViewDocumentClassifierPassTest.cs index 2d276a14a9..fbedc6f67f 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/MvcViewDocumentClassifierPassTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/MvcViewDocumentClassifierPassTest.cs @@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Assert Assert.Equal("global::Microsoft.AspNetCore.Mvc.Razor.RazorPage", visitor.Class.BaseType); Assert.Equal(new[] { "public" }, visitor.Class.Modifiers); - Assert.Equal("Test_cshtml", visitor.Class.Name); + Assert.Equal("Test_cshtml", visitor.Class.ClassName); } [Theory] @@ -115,7 +115,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions visitor.Visit(irDocument); // Assert - Assert.Equal(expected, visitor.Class.Name); + Assert.Equal(expected, visitor.Class.ClassName); } [Fact] @@ -138,7 +138,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions visitor.Visit(irDocument); // Assert - Assert.Equal(expected, visitor.Class.Name); + Assert.Equal(expected, visitor.Class.ClassName); } [Fact] @@ -161,7 +161,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions visitor.Visit(irDocument); // Assert - Assert.Equal(expected, visitor.Class.Name); + Assert.Equal(expected, visitor.Class.ClassName); } [Fact] @@ -182,7 +182,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions visitor.Visit(irDocument); // Assert - Assert.Equal("ExecuteAsync", visitor.Method.Name); + Assert.Equal("ExecuteAsync", visitor.Method.MethodName); Assert.Equal("global::System.Threading.Tasks.Task", visitor.Method.ReturnType); Assert.Equal(new[] { "public", "async", "override" }, visitor.Method.Modifiers); } diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/NamespaceDirectiveTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/NamespaceDirectiveTest.cs index fcde9715c7..fa806d0dc0 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/NamespaceDirectiveTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/NamespaceDirectiveTest.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var imports = "c:\\foo\\baz\\bleh.cshtml"; var node = new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan(imports, 0, 0, 0, 0), }; @@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var imports = "c:\\foo\\baz\\bleh.cshtml"; var node = new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan(imports, 0, 0, 0, 0), }; node.Children.Add(new DirectiveTokenIntermediateNode() { Content = string.Empty }); @@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Arrange var node = new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan(imports, 0, 0, 0, 0), }; @@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Arrange var node = new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan(imports, 0, 0, 0, 0), }; @@ -119,7 +119,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Push(new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan("/Account/_ViewImports.cshtml", 0, 0, 0, 0), }); builder.Add(new DirectiveTokenIntermediateNode() { Content = "WebApplication.Account" }); @@ -128,7 +128,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var @namespace = new NamespaceDeclarationIntermediateNode() { Content = "default" }; builder.Push(@namespace); - var @class = new ClassDeclarationIntermediateNode() { Name = "default" }; + var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); document.DocumentKind = RazorPageDocumentClassifierPass.RazorPageDocumentKind; @@ -143,7 +143,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Assert Assert.Equal("WebApplication.Account.Manage", @namespace.Content); - Assert.Equal("AddUser_Page", @class.Name); + Assert.Equal("AddUser_Page", @class.ClassName); } // This is the case where the source file sets the namespace. @@ -157,7 +157,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // This will be ignored. builder.Push(new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan("/Account/_ViewImports.cshtml", 0, 0, 0, 0), }); builder.Add(new DirectiveTokenIntermediateNode() { Content = "ignored" }); @@ -166,7 +166,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // This will be used. builder.Push(new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan("/Account/Manage/AddUser.cshtml", 0, 0, 0, 0), }); builder.Add(new DirectiveTokenIntermediateNode() { Content = "WebApplication.Account.Manage" }); @@ -175,7 +175,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var @namespace = new NamespaceDeclarationIntermediateNode() { Content = "default" }; builder.Push(@namespace); - var @class = new ClassDeclarationIntermediateNode() { Name = "default" }; + var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); document.DocumentKind = RazorPageDocumentClassifierPass.RazorPageDocumentKind; @@ -190,7 +190,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Assert Assert.Equal("WebApplication.Account.Manage", @namespace.Content); - Assert.Equal("AddUser_Page", @class.Name); + Assert.Equal("AddUser_Page", @class.ClassName); } // Handles cases where invalid characters appears in FileNames. Note that we don't sanitize the part of @@ -204,7 +204,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Push(new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan("/Account/_ViewImports.cshtml", 0, 0, 0, 0), }); builder.Add(new DirectiveTokenIntermediateNode() { Content = "WebApplication.Account" }); @@ -213,7 +213,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var @namespace = new NamespaceDeclarationIntermediateNode() { Content = "default" }; builder.Push(@namespace); - var @class = new ClassDeclarationIntermediateNode() { Name = "default" }; + var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); document.DocumentKind = RazorPageDocumentClassifierPass.RazorPageDocumentKind; @@ -228,7 +228,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Assert Assert.Equal("WebApplication.Account.Manage_Info", @namespace.Content); - Assert.Equal("Add_User_Page", @class.Name); + Assert.Equal("Add_User_Page", @class.ClassName); } // This is the case where the source file sets the namespace. @@ -242,7 +242,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // This will be ignored. builder.Push(new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan("/Account/_ViewImports.cshtml", 0, 0, 0, 0), }); builder.Add(new DirectiveTokenIntermediateNode() { Content = "ignored" }); @@ -251,7 +251,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // This will be used. builder.Push(new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan("/Account/Manage/AddUser.cshtml", 0, 0, 0, 0), }); builder.Add(new DirectiveTokenIntermediateNode() { Content = "WebApplication.Account.Manage" }); @@ -260,7 +260,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var @namespace = new NamespaceDeclarationIntermediateNode() { Content = "default" }; builder.Push(@namespace); - var @class = new ClassDeclarationIntermediateNode() { Name = "default" }; + var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); document.DocumentKind = MvcViewDocumentClassifierPass.MvcViewDocumentKind; @@ -275,7 +275,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Assert Assert.Equal("WebApplication.Account.Manage", @namespace.Content); - Assert.Equal("AddUser_View", @class.Name); + Assert.Equal("AddUser_View", @class.ClassName); } // This handles an error case where we can't determine the relationship between the @@ -289,7 +289,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Push(new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan(null, 0, 0, 0, 0), }); builder.Add(new DirectiveTokenIntermediateNode() { Content = "WebApplication.Account" }); @@ -298,7 +298,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var @namespace = new NamespaceDeclarationIntermediateNode() { Content = "default" }; builder.Push(@namespace); - var @class = new ClassDeclarationIntermediateNode() { Name = "default" }; + var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); document.DocumentKind = RazorPageDocumentClassifierPass.RazorPageDocumentKind; @@ -313,7 +313,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Assert Assert.Equal("WebApplication.Account", @namespace.Content); - Assert.Equal("default", @class.Name); + Assert.Equal("default", @class.ClassName); } [Fact] @@ -325,7 +325,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Push(new DirectiveIntermediateNode() { - Descriptor = NamespaceDirective.Directive, + Directive = NamespaceDirective.Directive, Source = new SourceSpan(null, 0, 0, 0, 0), }); builder.Add(new DirectiveTokenIntermediateNode() { Content = "WebApplication.Account" }); @@ -334,7 +334,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var @namespace = new NamespaceDeclarationIntermediateNode() { Content = "default" }; builder.Push(@namespace); - var @class = new ClassDeclarationIntermediateNode() { Name = "default" }; + var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); document.DocumentKind = null; @@ -349,7 +349,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Assert Assert.Equal("default", @namespace.Content); - Assert.Equal("default", @class.Name); + Assert.Equal("default", @class.ClassName); } } } diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/RazorPageDocumentClassifierPassTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/RazorPageDocumentClassifierPassTest.cs index a8ec5c0b2b..bd7ecb95dd 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/RazorPageDocumentClassifierPassTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/RazorPageDocumentClassifierPassTest.cs @@ -137,7 +137,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions // Assert Assert.Equal("global::Microsoft.AspNetCore.Mvc.RazorPages.Page", visitor.Class.BaseType); Assert.Equal(new[] { "public" }, visitor.Class.Modifiers); - Assert.Equal("Test_cshtml", visitor.Class.Name); + Assert.Equal("Test_cshtml", visitor.Class.ClassName); } [Theory] @@ -161,7 +161,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions visitor.Visit(irDocument); // Assert - Assert.Equal(expected, visitor.Class.Name); + Assert.Equal(expected, visitor.Class.ClassName); } [Fact] @@ -184,7 +184,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions visitor.Visit(irDocument); // Assert - Assert.Equal(expected, visitor.Class.Name); + Assert.Equal(expected, visitor.Class.ClassName); } [Fact] @@ -207,7 +207,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions visitor.Visit(irDocument); // Assert - Assert.Equal(expected, visitor.Class.Name); + Assert.Equal(expected, visitor.Class.ClassName); } [Fact] @@ -228,7 +228,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions visitor.Visit(irDocument); // Assert - Assert.Equal("ExecuteAsync", visitor.Method.Name); + Assert.Equal("ExecuteAsync", visitor.Method.MethodName); Assert.Equal("global::System.Threading.Tasks.Task", visitor.Method.ReturnType); Assert.Equal(new[] { "public", "async", "override" }, visitor.Method.Modifiers); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/DefaultDocumentWriterTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/DefaultDocumentWriterTest.cs index fa9c1fb399..88d3b8ea01 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/DefaultDocumentWriterTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/DefaultDocumentWriterTest.cs @@ -116,7 +116,7 @@ namespace TestNamespace }, BaseType = "TestBase", Interfaces = new List { "IFoo", "IBar", }, - Name = "TestClass", + ClassName = "TestClass", }); var codeDocument = TestRazorCodeDocument.CreateEmpty(); @@ -157,7 +157,7 @@ internal class TestClass : TestBase, IFoo, IBar "virtual", "async", }, - Name = "TestMethod", + MethodName = "TestMethod", ReturnType = "string", }); @@ -200,8 +200,8 @@ internal virtual async string TestMethod() "internal", "readonly", }, - Name = "_foo", - Type = "string", + FieldName = "_foo", + FieldType = "string", }); var codeDocument = TestRazorCodeDocument.CreateEmpty(); @@ -239,8 +239,8 @@ internal readonly string _foo; "internal", "virtual", }, - Name = "Foo", - Type = "string", + PropertyName = "Foo", + PropertyType = "string", }); var codeDocument = TestRazorCodeDocument.CreateEmpty(); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/DocumentClassifierPassBaseTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/DocumentClassifierPassBaseTest.cs index cf8a7772e0..b8b6b59c47 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/DocumentClassifierPassBaseTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/DocumentClassifierPassBaseTest.cs @@ -201,10 +201,10 @@ namespace Microsoft.AspNetCore.Razor.Language Assert.Equal("TestNamespace", @namespace.Content); var @class = SingleChild(@namespace); - Assert.Equal("TestClass", @class.Name); + Assert.Equal("TestClass", @class.ClassName); var method = SingleChild(@class); - Assert.Equal("TestMethod", method.Name); + Assert.Equal("TestMethod", method.MethodName); } [Fact] @@ -270,8 +270,8 @@ namespace Microsoft.AspNetCore.Razor.Language MethodDeclarationIntermediateNode method) { @namespace.Content = Namespace; - @class.Name = Class; - @method.Name = Method; + @class.ClassName = Class; + @method.MethodName = Method; } protected override void ConfigureTarget(ICodeTargetBuilder builder) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/DesignTimeDirectiveTargetExtensionTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/DesignTimeDirectiveTargetExtensionTest.cs index 9d64baaa03..ee37b0ce99 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/DesignTimeDirectiveTargetExtensionTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/DesignTimeDirectiveTargetExtensionTest.cs @@ -45,7 +45,7 @@ private void __RazorDirectiveTokenHelpers__() { { Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), Content = "System.String", - Descriptor = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.Type), + DirectiveToken = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.Type), }; node.Children.Add(token); @@ -80,7 +80,7 @@ System.String __typeHelper = default(System.String); { Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), Content = "System.Collections.Generic", - Descriptor = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.Namespace), + DirectiveToken = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.Namespace), }; node.Children.Add(token); @@ -115,7 +115,7 @@ global::System.Object __typeHelper = nameof(System.Collections.Generic); { Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), Content = "Foo", - Descriptor = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.Member), + DirectiveToken = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.Member), }; node.Children.Add(token); @@ -150,13 +150,13 @@ global::System.Object Foo = null; { Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), Content = "Value", - Descriptor = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.String), + DirectiveToken = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.String), }; var tokenWithQuotedContent = new DirectiveTokenIntermediateNode() { Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), Content = "\"Value\"", - Descriptor = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.String), + DirectiveToken = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.String), }; node.Children.Add(token); node.Children.Add(tokenWithQuotedContent); @@ -195,7 +195,7 @@ global::System.Object __typeHelper = ""Value""; var token = new DirectiveTokenIntermediateNode() { Content = "Value", - Descriptor = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.String), + DirectiveToken = DirectiveTokenDescriptor.CreateToken(DirectiveTokenKind.String), }; node.Children.Add(token); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/FunctionsDirectivePassTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/FunctionsDirectivePassTest.cs index c0df28f513..96e6eb4960 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/FunctionsDirectivePassTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/FunctionsDirectivePassTest.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Extensions var codeDocument = RazorCodeDocument.Create(sourceDocument); var irDocument = new DocumentIntermediateNode(); - irDocument.Children.Add(new DirectiveIntermediateNode() { Descriptor = FunctionsDirective.Directive, }); + irDocument.Children.Add(new DirectiveIntermediateNode() { Directive = FunctionsDirective.Directive, }); // Act pass.Execute(codeDocument, irDocument); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/InheritsDirectivePassTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/InheritsDirectivePassTest.cs index 471dbe3498..0d2638760c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/InheritsDirectivePassTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/InheritsDirectivePassTest.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Extensions var codeDocument = RazorCodeDocument.Create(sourceDocument); var irDocument = new DocumentIntermediateNode(); - irDocument.Children.Add(new DirectiveIntermediateNode() { Descriptor = FunctionsDirective.Directive, }); + irDocument.Children.Add(new DirectiveIntermediateNode() { Directive = FunctionsDirective.Directive, }); // Act pass.Execute(codeDocument, irDocument); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/SectionDirectivePassTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/SectionDirectivePassTest.cs index ce5b1e8303..c043304787 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/SectionDirectivePassTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Extensions/SectionDirectivePassTest.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Extensions var codeDocument = RazorCodeDocument.Create(sourceDocument); var irDocument = new DocumentIntermediateNode(); - irDocument.Children.Add(new DirectiveIntermediateNode() { Descriptor = SectionDirective.Directive, }); + irDocument.Children.Add(new DirectiveIntermediateNode() { Directive = SectionDirective.Directive, }); // Act pass.Execute(codeDocument, irDocument); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/FileSystemRazorProjectItemTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/FileSystemRazorProjectItemTest.cs index b1508e3802..638d898e0d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/FileSystemRazorProjectItemTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/FileSystemRazorProjectItemTest.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Razor.Language var projectItem = new FileSystemRazorProjectItem("/Views", "/Home.cshtml", fileInfo); // Assert - Assert.Equal("/Home.cshtml", projectItem.Path); + Assert.Equal("/Home.cshtml", projectItem.FilePath); Assert.Equal("/Views", projectItem.BasePath); Assert.True(projectItem.Exists); Assert.Equal("Home.cshtml", projectItem.FileName); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/FileSystemRazorProjectTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/FileSystemRazorProjectTest.cs index 5ee4ea9d9b..98a22f4fc5 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/FileSystemRazorProjectTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/FileSystemRazorProjectTest.cs @@ -76,20 +76,20 @@ namespace Microsoft.AspNetCore.Razor.Language var files = fileSystemProject.EnumerateItems("/"); // Assert - Assert.Collection(files.OrderBy(f => f.Path), + Assert.Collection(files.OrderBy(f => f.FilePath), file => { - Assert.Equal("/Home.cshtml", file.Path); + Assert.Equal("/Home.cshtml", file.FilePath); Assert.Equal("/", file.BasePath); }, file => { - Assert.Equal("/Views/About/About.cshtml", file.Path); + Assert.Equal("/Views/About/About.cshtml", file.FilePath); Assert.Equal("/", file.BasePath); }, file => { - Assert.Equal("/Views/Home/Index.cshtml", file.Path); + Assert.Equal("/Views/Home/Index.cshtml", file.FilePath); Assert.Equal("/", file.BasePath); }); } @@ -104,15 +104,15 @@ namespace Microsoft.AspNetCore.Razor.Language var files = fileSystemProject.EnumerateItems("/Views"); // Assert - Assert.Collection(files.OrderBy(f => f.Path), + Assert.Collection(files.OrderBy(f => f.FilePath), file => { - Assert.Equal("/About/About.cshtml", file.Path); + Assert.Equal("/About/About.cshtml", file.FilePath); Assert.Equal("/Views", file.BasePath); }, file => { - Assert.Equal("/Home/Index.cshtml", file.Path); + Assert.Equal("/Home/Index.cshtml", file.FilePath); Assert.Equal("/Views", file.BasePath); }); } @@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.Razor.Language // Assert Assert.True(file.Exists); - Assert.Equal(path, file.Path); + Assert.Equal(path, file.FilePath); } [Fact] diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/RazorTemplateEngineIntegrationTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/RazorTemplateEngineIntegrationTest.cs index d7ad0e1f21..b5cd18e7ff 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/RazorTemplateEngineIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/RazorTemplateEngineIntegrationTest.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests var templateEngine = new RazorTemplateEngine(razorEngine, project); // Act - var resultcSharpDocument = templateEngine.GenerateCode(projectItem.Path); + var resultcSharpDocument = templateEngine.GenerateCode(projectItem.FilePath); // Assert AssertCSharpDocumentMatchesBaseline(resultcSharpDocument); @@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests var templateEngine = new RazorTemplateEngine(razorEngine, project); // Act - var cSharpDocument = templateEngine.GenerateCode(projectItem.Path); + var cSharpDocument = templateEngine.GenerateCode(projectItem.FilePath); // Assert AssertCSharpDocumentMatchesBaseline(cSharpDocument); @@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests { engine.ConfigureClass((document, @class) => { - @class.Name = "MyClass"; + @class.ClassName = "MyClass"; @class.Modifiers.Clear(); @class.Modifiers.Add("protected"); @@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests var templateEngine = new RazorTemplateEngine(razorEngine, project); // Act - var cSharpDocument = templateEngine.GenerateCode(projectItem.Path); + var cSharpDocument = templateEngine.GenerateCode(projectItem.FilePath); // Assert AssertCSharpDocumentMatchesBaseline(cSharpDocument); @@ -105,7 +105,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests var templateEngine = new RazorTemplateEngine(razorEngine, project); // Act - var cSharpDocument = templateEngine.GenerateCode(projectItem.Path); + var cSharpDocument = templateEngine.GenerateCode(projectItem.FilePath); // Assert AssertCSharpDocumentMatchesBaseline(cSharpDocument); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Intermediate/DocumentIntermediateNodeExtensionsTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Intermediate/DocumentIntermediateNodeExtensionsTest.cs index 7af8f14860..8def071acc 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Intermediate/DocumentIntermediateNodeExtensionsTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Intermediate/DocumentIntermediateNodeExtensionsTest.cs @@ -76,19 +76,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate var match1 = new DirectiveIntermediateNode() { - Descriptor = directive, + Directive = directive, }; builder.Add(match1); var nonMatch = new DirectiveIntermediateNode() { - Descriptor = directive2, + Directive = directive2, }; builder.Add(nonMatch); var match2 = new DirectiveIntermediateNode() { - Descriptor = directive, + Directive = directive, }; builder.Add(match2); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/RazorProjectItemTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/RazorProjectItemTest.cs index 637b364758..e1e95b2cc0 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/RazorProjectItemTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/RazorProjectItemTest.cs @@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.Razor.Language var projectItem = new TestRazorProjectItem(path, basePath: "/"); // Act - var fileName = projectItem.PathWithoutExtension; + var fileName = projectItem.FilePathWithoutExtension; // Assert Assert.Equal(expected, fileName); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/RazorProjectTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/RazorProjectTest.cs index 01461415a5..7831db3521 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/RazorProjectTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/RazorProjectTest.cs @@ -86,9 +86,9 @@ namespace Microsoft.AspNetCore.Razor.Language // Assert Assert.Collection( result, - item => Assert.Equal($"/Views/Home/{fileName}", item.Path), - item => Assert.Equal($"/Views/{fileName}", item.Path), - item => Assert.Equal($"/{fileName}", item.Path)); + item => Assert.Equal($"/Views/Home/{fileName}", item.FilePath), + item => Assert.Equal($"/Views/{fileName}", item.FilePath), + item => Assert.Equal($"/{fileName}", item.FilePath)); } [Fact] @@ -108,7 +108,7 @@ namespace Microsoft.AspNetCore.Razor.Language // Assert Assert.Collection( result, - item => Assert.Equal("/File.cshtml", item.Path)); + item => Assert.Equal("/File.cshtml", item.FilePath)); } [Fact] @@ -132,10 +132,10 @@ namespace Microsoft.AspNetCore.Razor.Language // Assert Assert.Collection( result, - item => Assert.Equal("/Areas/MyArea/Views/File.cshtml", item.Path), - item => Assert.Equal("/Areas/MyArea/File.cshtml", item.Path), - item => Assert.Equal("/Areas/File.cshtml", item.Path), - item => Assert.Equal("/File.cshtml", item.Path)); + item => Assert.Equal("/Areas/MyArea/Views/File.cshtml", item.FilePath), + item => Assert.Equal("/Areas/MyArea/File.cshtml", item.FilePath), + item => Assert.Equal("/Areas/File.cshtml", item.FilePath), + item => Assert.Equal("/File.cshtml", item.FilePath)); } [Fact] @@ -176,27 +176,27 @@ namespace Microsoft.AspNetCore.Razor.Language result, item => { - Assert.Equal("/Areas/MyArea/Views/Home/File.cshtml", item.Path); + Assert.Equal("/Areas/MyArea/Views/Home/File.cshtml", item.FilePath); Assert.False(item.Exists); }, item => { - Assert.Equal("/Areas/MyArea/Views/File.cshtml", item.Path); + Assert.Equal("/Areas/MyArea/Views/File.cshtml", item.FilePath); Assert.False(item.Exists); }, item => { - Assert.Equal("/Areas/MyArea/File.cshtml", item.Path); + Assert.Equal("/Areas/MyArea/File.cshtml", item.FilePath); Assert.True(item.Exists); }, item => { - Assert.Equal("/Areas/File.cshtml", item.Path); + Assert.Equal("/Areas/File.cshtml", item.FilePath); Assert.False(item.Exists); }, item => { - Assert.Equal("/File.cshtml", item.Path); + Assert.Equal("/File.cshtml", item.FilePath); Assert.True(item.Exists); }); } @@ -223,22 +223,22 @@ namespace Microsoft.AspNetCore.Razor.Language result, item => { - Assert.Equal("/Areas/MyArea/Views/Home/File.cshtml", item.Path); + Assert.Equal("/Areas/MyArea/Views/Home/File.cshtml", item.FilePath); Assert.False(item.Exists); }, item => { - Assert.Equal("/Areas/MyArea/Views/File.cshtml", item.Path); + Assert.Equal("/Areas/MyArea/Views/File.cshtml", item.FilePath); Assert.False(item.Exists); }, item => { - Assert.Equal("/Areas/MyArea/File.cshtml", item.Path); + Assert.Equal("/Areas/MyArea/File.cshtml", item.FilePath); Assert.True(item.Exists); }, item => { - Assert.Equal("/Areas/File.cshtml", item.Path); + Assert.Equal("/Areas/File.cshtml", item.FilePath); Assert.False(item.Exists); }); } @@ -265,12 +265,12 @@ namespace Microsoft.AspNetCore.Razor.Language result, item => { - Assert.Equal("/Areas/MyArea/Views/Home/File.cshtml", item.Path); + Assert.Equal("/Areas/MyArea/Views/Home/File.cshtml", item.FilePath); Assert.False(item.Exists); }, item => { - Assert.Equal("/Areas/MyArea/Views/File.cshtml", item.Path); + Assert.Equal("/Areas/MyArea/Views/File.cshtml", item.FilePath); Assert.False(item.Exists); }); } @@ -297,7 +297,7 @@ namespace Microsoft.AspNetCore.Razor.Language result, item => { - Assert.Equal("/Areas/MyArea/Views/Home/File.cshtml", item.Path); + Assert.Equal("/Areas/MyArea/Views/Home/File.cshtml", item.FilePath); Assert.False(item.Exists); }); } @@ -325,7 +325,7 @@ namespace Microsoft.AspNetCore.Razor.Language private RazorProjectItem CreateProjectItem(string path) { var projectItem = new Mock(); - projectItem.SetupGet(f => f.Path).Returns(path); + projectItem.SetupGet(f => f.FilePath).Returns(path); projectItem.SetupGet(f => f.Exists).Returns(true); return projectItem.Object; } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/RazorSourceDocumentTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/RazorSourceDocumentTest.cs index 3001d53ec8..7288f8a43c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/RazorSourceDocumentTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/RazorSourceDocumentTest.cs @@ -75,7 +75,7 @@ namespace Microsoft.AspNetCore.Razor.Language var document = RazorSourceDocument.ReadFrom(projectItem); // Assert - Assert.Equal(projectItem.Path, document.FilePath); + Assert.Equal(projectItem.FilePath, document.FilePath); Assert.Equal(projectItem.Content, ReadContent(document)); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/RazorTemplateEngineTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/RazorTemplateEngineTest.cs index 1cb5cc62b2..453788d36c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/RazorTemplateEngineTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/RazorTemplateEngineTest.cs @@ -55,7 +55,7 @@ namespace Microsoft.AspNetCore.Razor.Language // Assert var import = Assert.Single(imports); - Assert.Equal(projectItem.Path, import.FilePath); + Assert.Equal(projectItem.FilePath, import.FilePath); } [Fact] @@ -283,7 +283,7 @@ namespace Microsoft.AspNetCore.Razor.Language var imports = templateEngine.GetImportItems("/Views/Home/Index.cshtml"); // Assert - var paths = imports.Select(i => i.Path); + var paths = imports.Select(i => i.FilePath); Assert.Equal(expected, paths); } @@ -307,7 +307,7 @@ namespace Microsoft.AspNetCore.Razor.Language var imports = templateEngine.GetImportItems(projectItem); // Assert - var paths = imports.Select(i => i.Path); + var paths = imports.Select(i => i.FilePath); Assert.Equal(expected, paths); } } diff --git a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs index 2803102f6c..f38ddeea52 100644 --- a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs +++ b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs @@ -240,7 +240,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests { public override void VisitClassDeclaration(ClassDeclarationIntermediateNode node) { - node.Name = FileName.Replace('/', '_'); + node.ClassName = FileName.Replace('/', '_'); node.Modifiers.Clear(); node.Modifiers.Add("public"); @@ -260,7 +260,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests node.Modifiers.Clear(); node.Modifiers.Add("public"); node.Modifiers.Add("async"); - node.Name = "ExecuteAsync"; + node.MethodName = "ExecuteAsync"; node.ReturnType = typeof(Task).FullName; VisitDefault(node); diff --git a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntermediateNodeWriter.cs b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntermediateNodeWriter.cs index 61046af3cf..5127d7ddb2 100644 --- a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntermediateNodeWriter.cs +++ b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntermediateNodeWriter.cs @@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests public override void VisitClassDeclaration(ClassDeclarationIntermediateNode node) { - WriteContentNode(node, string.Join(" ", node.Modifiers), node.Name, node.BaseType, string.Join(", ", node.Interfaces ?? new List())); + WriteContentNode(node, string.Join(" ", node.Modifiers), node.ClassName, node.BaseType, string.Join(", ", node.Interfaces ?? new List())); } public override void VisitCSharpExpressionAttributeValue(CSharpExpressionAttributeValueIntermediateNode node) @@ -52,12 +52,12 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests public override void VisitMalformedDirective(MalformedDirectiveIntermediateNode node) { - WriteContentNode(node, node.Name); + WriteContentNode(node, node.DirectiveName); } public override void VisitDirective(DirectiveIntermediateNode node) { - WriteContentNode(node, node.Name); + WriteContentNode(node, node.DirectiveName); } public override void VisitDirectiveToken(DirectiveTokenIntermediateNode node) @@ -67,7 +67,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests public override void VisitFieldDeclaration(FieldDeclarationIntermediateNode node) { - WriteContentNode(node, string.Join(" ", node.Modifiers), node.Type, node.Name); + WriteContentNode(node, string.Join(" ", node.Modifiers), node.FieldType, node.FieldName); } public override void VisitHtmlAttribute(HtmlAttributeIntermediateNode node) @@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests public override void VisitMethodDeclaration(MethodDeclarationIntermediateNode node) { - WriteContentNode(node, string.Join(" ", node.Modifiers), node.ReturnType, node.Name); + WriteContentNode(node, string.Join(" ", node.Modifiers), node.ReturnType, node.MethodName); } public override void VisitUsingDirective(UsingDirectiveIntermediateNode node) diff --git a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/Intermediate/IntermediateNodeAssert.cs b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/Intermediate/IntermediateNodeAssert.cs index c0c2e18128..2937b8f13b 100644 --- a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/Intermediate/IntermediateNodeAssert.cs +++ b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/Intermediate/IntermediateNodeAssert.cs @@ -140,7 +140,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate try { var directive = Assert.IsType(node); - Assert.Equal(expectedName, directive.Name); + Assert.Equal(expectedName, directive.DirectiveName); } catch (XunitException e) { @@ -155,7 +155,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate try { var token = Assert.IsType(node); - Assert.Equal(expectedKind, token.Descriptor.Kind); + Assert.Equal(expectedKind, token.DirectiveToken.Kind); Assert.Equal(expectedContent, token.Content); } catch (XunitException e) @@ -314,7 +314,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate try { var fieldNode = Assert.IsType(node); - Assert.Equal(typeFullName, fieldNode.Type); + Assert.Equal(typeFullName, fieldNode.FieldType); } catch (XunitException e) { diff --git a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProject.cs b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProject.cs index f276c9c26b..24b3c8eaf4 100644 --- a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProject.cs +++ b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProject.cs @@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Razor.Language public TestRazorProject(IList items) { - _lookup = items.ToDictionary(item => item.Path); + _lookup = items.ToDictionary(item => item.FilePath); } public override IEnumerable EnumerateItems(string basePath) diff --git a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectItem.cs b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectItem.cs index 623a04c711..3e0bd1e44f 100644 --- a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectItem.cs +++ b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectItem.cs @@ -13,14 +13,14 @@ namespace Microsoft.AspNetCore.Razor.Language string physicalPath = null, string basePath = "/") { - Path = path; + FilePath = path; PhysicalPath = physicalPath; BasePath = basePath; } public override string BasePath { get; } - public override string Path { get; } + public override string FilePath { get; } public override string PhysicalPath { get; }