Skip to content

Commit 2094b28

Browse files
Merge pull request #6797 from CyrusNajmabadi/smartTagDuplication
Don't add nested code actions *and* their parent to the smart tag list.
2 parents 80d3bb7 + 2198010 commit 2094b28

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/EditorFeatures/Core/Implementation/Suggestions/SuggestedActionsSourceProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ private SuggestedActionSet InlineActions(SuggestedActionSet actionSet)
220220
}
221221

222222
newActions.AddRange(childActionSets[0].Actions);
223+
continue;
223224
}
224225

225226
newActions.Add(action);

src/Workspaces/Core/Portable/CodeActions/CodeAction.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ protected override Task<Document> GetChangedDocumentAsync(CancellationToken canc
331331
return Task.FromResult<Document>(null);
332332
}
333333

334-
private static string ComputeEquivalenceKey(IEnumerable<CodeAction> nestedActions)
334+
private static string ComputeEquivalenceKey(ImmutableArray<CodeAction> nestedActions)
335335
{
336-
if (nestedActions == null)
336+
if (nestedActions.IsDefault)
337337
{
338338
return null;
339339
}
@@ -343,7 +343,7 @@ private static string ComputeEquivalenceKey(IEnumerable<CodeAction> nestedAction
343343
{
344344
foreach (var action in nestedActions)
345345
{
346-
equivalenceKey.Append(action.EquivalenceKey ?? action.GetHashCode().ToString() + ";");
346+
equivalenceKey.Append((action.EquivalenceKey ?? action.GetHashCode().ToString()) + ";");
347347
}
348348

349349
return equivalenceKey.Length > 0 ? equivalenceKey.ToString() : null;

0 commit comments

Comments
 (0)