From 0f230d039922659abd08be9b12c1dcc94b0da372 Mon Sep 17 00:00:00 2001 From: Jason Malinowski Date: Fri, 3 May 2019 15:27:11 -0700 Subject: [PATCH] Add an API for ProjectState.AnalyzerConfigDocumentIds to be consistent It's not as important as the others because the file ordering doesn't matter in the same way, but it's good to have for consistency. --- src/Workspaces/Core/Portable/Workspace/Solution/Project.cs | 2 +- .../Core/Portable/Workspace/Solution/ProjectState.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/Project.cs b/src/Workspaces/Core/Portable/Workspace/Solution/Project.cs index f39574188da..24ff57c88c6 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/Project.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/Project.cs @@ -173,7 +173,7 @@ internal Project(Solution solution, ProjectState projectState) /// /// All the s associated with this project. /// - public IEnumerable AnalyzerConfigDocuments => _projectState.AnalyzerConfigDocumentStates.Select(s => GetAnalyzerConfigDocument(s.Key)); + public IEnumerable AnalyzerConfigDocuments => _projectState.AnalyzerConfigDocumentIds.Select(GetAnalyzerConfigDocument); /// /// True if the project contains a document with the specified ID. diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/ProjectState.cs b/src/Workspaces/Core/Portable/Workspace/Solution/ProjectState.cs index 26eb00949a4..493bccb6d59 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/ProjectState.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/ProjectState.cs @@ -402,6 +402,11 @@ public async Task GetSemanticVersionAsync(CancellationToken cancel [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] public IReadOnlyList AdditionalDocumentIds => _additionalDocumentIds; + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + // Regular documents and additionald documents have an ordering, and so we maintain lists of the IDs in order; in the case of analyzerconfig documents, + // we don't define a workspace ordering because they are ordered via fancier algorithms in the compiler based on directory depth. + public IEnumerable AnalyzerConfigDocumentIds => _analyzerConfigDocumentStates.Keys; + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] public IImmutableDictionary DocumentStates => _documentStates; -- GitLab