Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Copilot #72655

Merged
merged 1 commit into from
Mar 21, 2024
Merged

Add support for Copilot #72655

merged 1 commit into from
Mar 21, 2024

Conversation

genlu
Copy link
Member

@genlu genlu commented Mar 21, 2024

No description provided.

@genlu genlu requested a review from a team as a code owner March 21, 2024 21:50
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 21, 2024
@genlu genlu changed the title Add support Copilot Add support for Copilot Mar 21, 2024
@genlu genlu merged commit 9c7bd9b into dotnet:main Mar 21, 2024
27 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 21, 2024
@genlu genlu deleted the FeatureBranchMerge branch March 21, 2024 23:37
var cancellationToken = context.CancellationToken;

var copilotService = document.GetLanguageService<ICopilotCodeAnalysisService>();
if (copilotService is null || !await copilotService.IsCodeAnalysisOptionEnabledAsync().ConfigureAwait(false))
Copy link
Member

Choose a reason for hiding this comment

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

nit IsCodeAnalysisOptionEnabledAsync could check IsAvailableAsync

// Guard against failure cases where the proposed fixed code does not parse into a method declaration.
// TODO: consider do this early when we create the diagnostic and add a flag in the property bag to speedup lightbulb computation
var fixMethodDeclaration = SyntaxFactory.ParseMemberDeclaration(fix, options: method.SyntaxTree.Options);
if (fixMethodDeclaration is null || !fixMethodDeclaration.IsKind(SyntaxKind.MethodDeclaration) || fixMethodDeclaration.GetDiagnostics().Count() > 3)
Copy link
Member

Choose a reason for hiding this comment

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

if (fixMethod is not MethodDeclarationSyntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants