From e7ba9e57abca70e838c22056b6620b9ce785bec7 Mon Sep 17 00:00:00 2001 From: Jason Malinowski Date: Mon, 12 Feb 2024 16:39:25 -0800 Subject: [PATCH] Simplify the GetTextDocuments helper 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. --- src/Features/LanguageServer/Protocol/Extensions/Extensions.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Features/LanguageServer/Protocol/Extensions/Extensions.cs b/src/Features/LanguageServer/Protocol/Extensions/Extensions.cs index 2a696715f5153..803a9fb106dad 100644 --- a/src/Features/LanguageServer/Protocol/Extensions/Extensions.cs +++ b/src/Features/LanguageServer/Protocol/Extensions/Extensions.cs @@ -78,8 +78,7 @@ public static ImmutableArray 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; @@ -138,7 +137,6 @@ public static ImmutableArray 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 {