diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkHelper.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkHelper.cs index 8f39c3596a..46550466e8 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkHelper.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkHelper.cs @@ -36,7 +36,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives // If there's more than 1 model chunk there will be a Razor error BUT we want intellisense to show up on // the current model chunk that the user is typing. return chunkTree - .Chunks + .Children .OfType() .LastOrDefault(); } diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs index e4711d9e6e..521ebd4c09 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs @@ -127,7 +127,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives var chunkMergers = GetChunkMergers(chunkTree, defaultModel); // We merge chunks into the ChunkTree in two passes. In the first pass, we traverse the ChunkTree visiting // a mapped IChunkMerger for types that are registered. - foreach (var chunk in chunkTree.Chunks) + foreach (var chunk in chunkTree.Children) { foreach (var merger in chunkMergers) { @@ -136,7 +136,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives } var inheritedChunks = _defaultInheritedChunks.Concat( - inheritedChunkTrees.SelectMany(tree => tree.Chunks)).ToArray(); + inheritedChunkTrees.SelectMany(tree => tree.Children)).ToArray(); foreach (var merger in chunkMergers) { @@ -175,8 +175,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives chunkGenerator.Visit(parseResults); // Rewrite the location of inherited chunks so they point to the global import file. - var chunkTree = chunkGenerator.Context.ChunkTreeBuilder.ChunkTree; - foreach (var chunk in chunkTree.Chunks) + var chunkTree = chunkGenerator.Context.ChunkTreeBuilder.Root; + foreach (var chunk in chunkTree.Children) { chunk.Start = new SourceLocation( viewImportsPath, diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/InjectChunkMerger.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/InjectChunkMerger.cs index 99f8354532..434624a9f9 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/InjectChunkMerger.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/InjectChunkMerger.cs @@ -65,7 +65,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives if (injectChunk != null && _addedMemberNames.Add(injectChunk.MemberName)) { - chunkTree.Chunks.Add(TransformChunk(injectChunk)); + chunkTree.Children.Add(TransformChunk(injectChunk)); } } } diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/SetBaseTypeChunkMerger.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/SetBaseTypeChunkMerger.cs index 05ab57f9ac..ba8003389e 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/SetBaseTypeChunkMerger.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/SetBaseTypeChunkMerger.cs @@ -60,7 +60,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives var baseTypeChunk = inheritedChunks[i] as SetBaseTypeChunk; if (baseTypeChunk != null) { - chunkTree.Chunks.Add(TransformChunk(baseTypeChunk)); + chunkTree.Children.Add(TransformChunk(baseTypeChunk)); break; } } diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/UsingChunkMerger.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/UsingChunkMerger.cs index 896aae6f7b..27ac03a29e 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/UsingChunkMerger.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/UsingChunkMerger.cs @@ -48,7 +48,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives { if (_currentUsings.Add(namespaceChunk.Namespace)) { - chunkTree.Chunks.Add(namespaceChunk); + chunkTree.Children.Add(namespaceChunk); } } } diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeGenerator.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeGenerator.cs index 78b6fba6dd..43b9d99168 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeGenerator.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeGenerator.cs @@ -119,7 +119,7 @@ namespace Microsoft.AspNet.Mvc.Razor writer.WriteLineHiddenDirective(); var injectVisitor = new InjectChunkVisitor(writer, Context, _injectAttribute); - injectVisitor.Accept(Context.ChunkTreeBuilder.ChunkTree.Chunks); + injectVisitor.Accept(Context.ChunkTreeBuilder.Root.Children); writer.WriteLine(); writer.WriteLineHiddenDirective(); diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorHost.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorHost.cs index 8ec53daa49..3477137d76 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorHost.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorHost.cs @@ -311,7 +311,7 @@ namespace Microsoft.AspNet.Mvc.Razor var inheritedChunkTrees = GetInheritedChunkTrees(context.SourceFile); ChunkInheritanceUtility.MergeInheritedChunkTrees( - context.ChunkTreeBuilder.ChunkTree, + context.ChunkTreeBuilder.Root, inheritedChunkTrees, DefaultModel); diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorParser.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorParser.cs index 0e8ac8f865..8886f6775f 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorParser.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorParser.cs @@ -117,7 +117,7 @@ namespace Microsoft.AspNet.Mvc.Razor { var descriptors = new List(); - var inheritedChunks = defaultInheritedChunks.Concat(inheritedChunkTrees.SelectMany(tree => tree.Chunks)); + var inheritedChunks = defaultInheritedChunks.Concat(inheritedChunkTrees.SelectMany(tree => tree.Children)); foreach (var chunk in inheritedChunks) { // All TagHelperDirectiveDescriptors created here have undefined source locations because the source diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs index 57e0fc7b26..987fa03083 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs @@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives chunkTreeResult => { var viewImportsPath = @"/Views/_ViewImports.cshtml"; - Assert.Collection(chunkTreeResult.ChunkTree.Chunks, + Assert.Collection(chunkTreeResult.ChunkTree.Children, chunk => { Assert.IsType(chunk); @@ -87,7 +87,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives chunkTreeResult => { var viewImportsPath = "/Views/home/_ViewImports.cshtml"; - Assert.Collection(chunkTreeResult.ChunkTree.Chunks, + Assert.Collection(chunkTreeResult.ChunkTree.Children, chunk => { Assert.IsType(chunk); @@ -150,7 +150,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives { new ChunkTree { - Chunks = new Chunk[] + Children = new Chunk[] { new UsingChunk { Namespace = "InheritedNamespace" }, new LiteralChunk { Text = "some text" } @@ -158,7 +158,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives }, new ChunkTree { - Chunks = new Chunk[] + Children = new Chunk[] { new UsingChunk { Namespace = "AppNamespace.Model" }, } @@ -172,9 +172,9 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives utility.MergeInheritedChunkTrees(chunkTree, inheritedChunkTrees, "dynamic"); // Assert - Assert.Collection(chunkTree.Chunks, + Assert.Collection(chunkTree.Children, chunk => Assert.Same(defaultChunks[1], chunk), - chunk => Assert.Same(inheritedChunkTrees[0].Chunks[0], chunk), + chunk => Assert.Same(inheritedChunkTrees[0].Children[0], chunk), chunk => Assert.Same(defaultChunks[0], chunk)); } } diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/InjectChunkMergerTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/InjectChunkMergerTest.cs index 14fbc0fd4f..58da4f9fc8 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/InjectChunkMergerTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/InjectChunkMergerTest.cs @@ -42,7 +42,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - var chunk = Assert.Single(chunkTree.Chunks); + var chunk = Assert.Single(chunkTree.Children); var injectChunk = Assert.IsType(chunk); Assert.Equal(expectedType, injectChunk.TypeName); Assert.Equal(expectedProperty, injectChunk.MemberName); @@ -64,7 +64,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - Assert.Empty(chunkTree.Chunks); + Assert.Empty(chunkTree.Children); } [Fact] @@ -84,12 +84,12 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - Assert.Equal(2, chunkTree.Chunks.Count); - var injectChunk = Assert.IsType(chunkTree.Chunks[0]); + Assert.Equal(2, chunkTree.Children.Count); + var injectChunk = Assert.IsType(chunkTree.Children[0]); Assert.Equal("MyType", injectChunk.TypeName); Assert.Equal("myproperty", injectChunk.MemberName); - injectChunk = Assert.IsType(chunkTree.Chunks[1]); + injectChunk = Assert.IsType(chunkTree.Children[1]); Assert.Equal("MyTypeB", injectChunk.TypeName); Assert.Equal("different-property", injectChunk.MemberName); } @@ -109,7 +109,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - var chunk = Assert.Single(chunkTree.Chunks); + var chunk = Assert.Single(chunkTree.Children); var injectChunk = Assert.IsType(chunk); Assert.Equal("MyHelper", injectChunk.TypeName); Assert.Equal("MyProperty", injectChunk.MemberName); @@ -130,7 +130,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - var chunk = Assert.Single(chunkTree.Chunks); + var chunk = Assert.Single(chunkTree.Children); var injectChunk = Assert.IsType(chunk); Assert.Equal("MyHelper", injectChunk.TypeName); Assert.Equal("MyProperty", injectChunk.MemberName); @@ -154,7 +154,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - Assert.Collection(chunkTree.Chunks, + Assert.Collection(chunkTree.Children, chunk => { var injectChunk = Assert.IsType(chunk); diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/SetBaseTypeChunkMergerTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/SetBaseTypeChunkMergerTest.cs index 16bf468625..04c04df560 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/SetBaseTypeChunkMergerTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/SetBaseTypeChunkMergerTest.cs @@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - var chunk = Assert.Single(chunkTree.Chunks); + var chunk = Assert.Single(chunkTree.Children); var setBaseTypeChunk = Assert.IsType(chunk); Assert.Equal(expected, setBaseTypeChunk.TypeName); } @@ -64,7 +64,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - Assert.Empty(chunkTree.Chunks); + Assert.Empty(chunkTree.Children); } [Fact] @@ -84,7 +84,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - var chunk = Assert.Single(chunkTree.Chunks); + var chunk = Assert.Single(chunkTree.Children); var setBaseTypeChunk = Assert.IsType(chunk); Assert.Equal("MyBase1", setBaseTypeChunk.TypeName); } diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/UsingChunkMergerTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/UsingChunkMergerTest.cs index 47d70d457d..ca6f3afa20 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/UsingChunkMergerTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/UsingChunkMergerTest.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - var chunk = Assert.Single(chunkTree.Chunks); + var chunk = Assert.Single(chunkTree.Children); var usingChunk = Assert.IsType(chunk); Assert.Equal(expected, usingChunk.Namespace); } @@ -48,7 +48,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - Assert.Empty(chunkTree.Chunks); + Assert.Empty(chunkTree.Children); } [Fact] @@ -69,10 +69,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - Assert.Equal(2, chunkTree.Chunks.Count); - var chunk = Assert.IsType(chunkTree.Chunks[0]); + Assert.Equal(2, chunkTree.Children.Count); + var chunk = Assert.IsType(chunkTree.Children[0]); Assert.Equal("Microsoft.AspNet.Mvc", chunk.Namespace); - chunk = Assert.IsType(chunkTree.Chunks[1]); + chunk = Assert.IsType(chunkTree.Children[1]); Assert.Equal("Microsoft.AspNet.Mvc.Razor", chunk.Namespace); } @@ -92,10 +92,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives merger.MergeInheritedChunks(chunkTree, inheritedChunks); // Assert - Assert.Equal(2, chunkTree.Chunks.Count); - var chunk = Assert.IsType(chunkTree.Chunks[0]); + Assert.Equal(2, chunkTree.Children.Count); + var chunk = Assert.IsType(chunkTree.Children[0]); Assert.Equal("Microsoft.AspNet.Mvc", chunk.Namespace); - chunk = Assert.IsType(chunkTree.Chunks[1]); + chunk = Assert.IsType(chunkTree.Children[1]); Assert.Equal("Microsoft.AspNet.mvc", chunk.Namespace); } } diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs index 624e31e492..f57ce4e09b 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs @@ -215,7 +215,7 @@ namespace Microsoft.AspNet.Mvc.Razor { return new ChunkTree { - Chunks = chunks + Children = chunks }; }