private void AddVirtualDocuments(RazorCodeDocument document, string relativePath) { foreach (var item in _project.EnumerateAscending(relativePath, ".razor")) { if (item.Filename == "_PageImports.razor") { var source = item.ToSourceDocument(); var parsed = RazorParser.Parse(source); document.AddVirtualSyntaxTree(parsed); } } }
private void SetImportedDocuments(RazorCodeDocument document, string relativePath) { var importedDocuments = new List <RazorSourceDocument>(); foreach (var item in _project.EnumerateAscending(relativePath, ".razor")) { if (item.Filename == "_PageImports.razor") { var sourceDocument = item.ToSourceDocument(); importedDocuments.Add(sourceDocument); } } document.SetImportedDocuments(importedDocuments); }