Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Extracted from #78966 to make that PR easier to review.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 19, 2025 19:04
@CyrusNajmabadi CyrusNajmabadi changed the base branch from main to main-vs-deps June 19, 2025 19:04

var addImportOptions = await document.GetAddImportOptionsAsync(searchOptions, cancellationToken).ConfigureAwait(false);
var addImportOptions = await document.GetAddImportOptionsAsync(
searchOptions, cleanupDocument: true, cancellationToken).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

added a flag as copilot-fixup wants to add imports without that making other undesired changes to other parts of the document. (specifically, case correcting things in VB).

featureId, accepted, proposalId, analysisResult, cancellationToken).Dispose();
}

private static ImmutableArray<TextChange> Normalize(IEnumerable<TextChange> textChanges)
Copy link
Member Author

@CyrusNajmabadi CyrusNajmabadi Jun 19, 2025

Choose a reason for hiding this comment

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

moved to shared utilites outside of 'change analysis. needed by auto-fix-copilot-changes work.

var proposalId = proposal.ProposalId;

var solution = CopilotEditorUtilities.TryGetAffectedSolution(proposal);
if (solution is null)
Copy link
Member Author

Choose a reason for hiding this comment

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

standard helper to make sure this is even a proposal we can consider fixing. will be used by new feature as well.


// We're about to potentially make multiple calls to oop here. So keep a session alive to avoid
// resyncing any data unnecessary.
using var _1 = await RemoteKeepAliveSession.CreateAsync(solution, cancellationToken).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

somethign i noticed while doing work here. can help perf if copilot is suggesting changes to multiple documents.


internal static class CopilotEditorUtilities
{
public static Solution? TryGetAffectedSolution(ProposalBase proposal)
Copy link
Member Author

Choose a reason for hiding this comment

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

Ensures the edit is touching only files we can properly analyze within a single roslyn solution snapshot.

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge June 19, 2025 20:11
@CyrusNajmabadi CyrusNajmabadi disabled auto-merge June 19, 2025 20:14
@CyrusNajmabadi CyrusNajmabadi enabled auto-merge (squash) June 19, 2025 20:14
@CyrusNajmabadi CyrusNajmabadi disabled auto-merge June 19, 2025 21:41
@dibarbet
Copy link
Member

merging, integration test failures are expected on main-vs-deps.

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.

4 participants