diff --git a/src/Docfx.Build/CompilePhaseHandler.cs b/src/Docfx.Build/CompilePhaseHandler.cs index 1dc41221526..e6ad1537014 100644 --- a/src/Docfx.Build/CompilePhaseHandler.cs +++ b/src/Docfx.Build/CompilePhaseHandler.cs @@ -26,7 +26,7 @@ public void Handle(List hostServices, int maxParallelism) Prepare(hostServices, maxParallelism); hostServices.RunAll(hostService => { - var steps = string.Join("=>", hostService.Processor.BuildSteps.OrderBy(step => step.BuildOrder).Select(s => s.Name)); + var steps = string.Join("=>", hostService.Processor.BuildSteps.OrderBy(static step => step.BuildOrder).Select(static s => s.Name)); Logger.LogInfo($"Building {hostService.Models.Count} file(s) in {hostService.Processor.Name}({steps})..."); Logger.LogVerbose($"Processor {hostService.Processor.Name}: Prebuilding..."); Prebuild(hostService); @@ -144,7 +144,7 @@ private static void RunBuildSteps(IEnumerable buildSteps, Ac { if (buildSteps != null) { - foreach (var buildStep in buildSteps.OrderBy(step => step.BuildOrder)) + foreach (var buildStep in buildSteps.OrderBy(static step => step.BuildOrder)) { action(buildStep); } diff --git a/src/Docfx.Build/DocumentBuilder.cs b/src/Docfx.Build/DocumentBuilder.cs index 8c662bbc39a..ede13a86dd3 100644 --- a/src/Docfx.Build/DocumentBuilder.cs +++ b/src/Docfx.Build/DocumentBuilder.cs @@ -92,11 +92,11 @@ public void Build(IList parameters, string outputDirect if (parameter.Files.Count == 0) { - manifests.Add(new Manifest() { SourceBasePath = StringExtension.ToNormalizedPath(EnvironmentContext.BaseDirectory) }); + manifests.Add(new Manifest { SourceBasePath = StringExtension.ToNormalizedPath(EnvironmentContext.BaseDirectory) }); } else { - if (!parameter.Files.EnumerateFiles().Any(s => s.Type == DocumentType.Article)) + if (!parameter.Files.EnumerateFiles().Any(static s => s.Type == DocumentType.Article)) { if (!string.IsNullOrEmpty(parameter.GroupInfo?.Name)) { diff --git a/src/Docfx.Dotnet/DotnetApiCatalog.ApiPage.cs b/src/Docfx.Dotnet/DotnetApiCatalog.ApiPage.cs index 8dd02350c9a..7842c8b625f 100644 --- a/src/Docfx.Dotnet/DotnetApiCatalog.ApiPage.cs +++ b/src/Docfx.Dotnet/DotnetApiCatalog.ApiPage.cs @@ -602,18 +602,21 @@ void EnumFields(INamedTypeSymbol type) return; if (config.EnumSortOrder is EnumSortOrder.Alphabetic) - items = items.OrderBy(m => m.Name).ToList(); + items = items.OrderBy(static m => m.Name).ToList(); body.Add((Heading)new H2 { h2 = "Fields" }); body.Add(new Parameters { parameters = items.Select(ToParameter).ToArray() }); + return; + Parameter ToParameter(IFieldSymbol item) { var docs = Comment(item, compilation) is { } comment ? string.Join("\n\n", comment.Summary, comment.Remarks) : null; return new() { - name = item.Name, @default = $"{item.ConstantValue}", + name = item.Name, + @default = $"{item.ConstantValue}", deprecated = Deprecated(item), preview = Preview(item), description = docs, diff --git a/src/Docfx.Dotnet/DotnetApiCatalog.ManagedReference.cs b/src/Docfx.Dotnet/DotnetApiCatalog.ManagedReference.cs index e619ded5880..3a8e0fd6b2f 100644 --- a/src/Docfx.Dotnet/DotnetApiCatalog.ManagedReference.cs +++ b/src/Docfx.Dotnet/DotnetApiCatalog.ManagedReference.cs @@ -44,6 +44,9 @@ private static void CreateManagedReference(List<(IAssemblySymbol symbol, Compila ResolveAndExportYamlMetadata(allMembers, allReferences); + return; + + void ResolveAndExportYamlMetadata( Dictionary allMembers, Dictionary allReferences) { diff --git a/src/Docfx.Dotnet/DotnetApiCatalog.cs b/src/Docfx.Dotnet/DotnetApiCatalog.cs index cf42e58425b..948cb23cf8c 100644 --- a/src/Docfx.Dotnet/DotnetApiCatalog.cs +++ b/src/Docfx.Dotnet/DotnetApiCatalog.cs @@ -169,8 +169,8 @@ private static ExtractMetadataConfig ConvertConfig(MetadataJsonItemConfig config MemberLayout = configModel?.MemberLayout ?? default, EnumSortOrder = configModel?.EnumSortOrder ?? default, AllowCompilationErrors = configModel?.AllowCompilationErrors ?? false, - Files = expandedFiles.Items.SelectMany(s => s.Files).ToList(), - References = expandedReferences?.Items.SelectMany(s => s.Files).ToList(), + Files = expandedFiles.Items.SelectMany(static s => s.Files).ToList(), + References = expandedReferences?.Items.SelectMany(static s => s.Files).ToList() }; } }