Skip to content

Commit

Permalink
Simplify the GetTextDocuments helper
Browse files Browse the repository at this point in the history
I don't imagine returning .editorconfigs is a problem here since nothing
is really going to take that path, but this makes it more consistent
with everything else.
  • Loading branch information
jasonmalinowski committed Feb 13, 2024
1 parent bb94edb commit e7ba9e5
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ public static ImmutableArray<TextDocument> GetTextDocuments(this Solution soluti
var documentIds = GetDocumentIds(solution, documentUri);

var documents = documentIds
.Select(solution.GetDocument)
.Concat(documentIds.Select(solution.GetAdditionalDocument))
.Select(solution.GetTextDocument)
.WhereNotNull()
.ToImmutableArray();
return documents;
Expand Down Expand Up @@ -138,7 +137,6 @@ public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution,
// this means we can safely call .Single() and not worry about calling FindDocumentInProjectContext.
var documentId = solution.GetDocumentIds(documentIdentifier.Uri).Single();
return await solution.GetDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);

}
else
{
Expand Down

0 comments on commit e7ba9e5

Please sign in to comment.