Skip to content

Speed up performance of remove-unused-imports fix all#79173

Merged
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
CyrusNajmabadi:removeImportsPerf
Jun 27, 2025
Merged

Speed up performance of remove-unused-imports fix all#79173
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
CyrusNajmabadi:removeImportsPerf

Conversation

@CyrusNajmabadi
Copy link
Contributor

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 27, 2025 19:11
namespace Microsoft.CodeAnalysis.RemoveUnnecessaryImports;

internal abstract class AbstractRemoveUnnecessaryImportsCodeFixProvider : CodeFixProvider
internal abstract class AbstractRemoveUnnecessaryImportsCodeFixProvider : SyntaxEditorBasedCodeFixProvider
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this allows the fixer to work on individual documents in parallel. It doesn't need to run them serially.

// We don't need to perform any cleanup for this code fix. It simply removes code, leaving
// things in the state it already needs to be in.
protected override CodeActionCleanup Cleanup => CodeActionCleanup.None;
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ensures that after the fixer runs, the Code Action system itself doesn't do an full semantic pass on the resultant documents to clean them up.

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge June 27, 2025 21:18
@CyrusNajmabadi CyrusNajmabadi merged commit 4a5ff47 into dotnet:main Jun 27, 2025
25 of 26 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the removeImportsPerf branch June 27, 2025 22:26
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jun 27, 2025
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants