Skip to content

Conversation

@akhera99
Copy link
Member

Updates OnTheFlyDocsView.xaml.vs to handle and display quota exceeded messages.
Updates ICopilotCodeAnalysisService to retrieve the status of the response from Copilot.

image
image

@akhera99 akhera99 requested a review from a team as a code owner January 23, 2025 01:08
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 23, 2025
@akhera99 akhera99 requested a review from genlu January 23, 2025 01:08
Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsAsync(Document document, string promptTitle, CancellationToken cancellationToken);
Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken);
Task<string> GetOnTheFlyDocsAsync(string symbolSignature, ImmutableArray<string> declarationCode, string language, CancellationToken cancellationToken);
Task<(string ResponseString, int ResponseStatus)> GetOnTheFlyDocsAsync(string symbolSignature, ImmutableArray<string> declarationCode, string language, CancellationToken cancellationToken);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Task<(string ResponseString, int ResponseStatus)> GetOnTheFlyDocsAsync(string symbolSignature, ImmutableArray<string> declarationCode, string language, CancellationToken cancellationToken);
Task<(string responseString, int responseStatus)> GetOnTheFlyDocsAsync(string symbolSignature, ImmutableArray<string> declarationCode, string language, CancellationToken cancellationToken);

Note: we recommmend not using tuples for apis shared among teams. define a real type that can be passed around.

also: is there a binary breaking change concern here?

Comment on lines 146 to 147
ClassifiedTextElement.TextClassificationTypeName,
quotaExceededMatch.Groups[1].Value),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ClassifiedTextElement.TextClassificationTypeName,
quotaExceededMatch.Groups[1].Value),
ClassifiedTextElement.TextClassificationTypeName,
quotaExceededMatch.Groups[1].Value),

cancellationToken.ThrowIfCancellationRequested();

if (response is null || response.Length == 0)
if (responseString is null || responseString.Length == 0)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (responseString is null || responseString.Length == 0)
if (string.IsNullOrEmpty(responseString))

Comment on lines 304 to 309
var elements = new List<object>
{
new ContainerElement(ContainerElementStyle.Wrapped, new ClassifiedTextElement(this.quotaExceededContent))
};

_responseControl.Content = ToUIElement(new ContainerElement(ContainerElementStyle.Stacked, elements));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var elements = new List<object>
{
new ContainerElement(ContainerElementStyle.Wrapped, new ClassifiedTextElement(this.quotaExceededContent))
};
_responseControl.Content = ToUIElement(new ContainerElement(ContainerElementStyle.Stacked, elements));
_responseControl.Content = ToUIElement(
new ContainerElement(ContainerElementStyle.Stacked,
[new ContainerElement(ContainerElementStyle.Wrapped, new ClassifiedTextElement(this.quotaExceededContent))]));

@akhera99 akhera99 merged commit 6f29e13 into dotnet:main Jan 23, 2025
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jan 23, 2025
akhera99 added a commit to akhera99/roslyn that referenced this pull request Jan 23, 2025
* wip

* wip

* revert

* comments

* pr feedback

* pr feedback

* pr feedback
akhera99 added a commit that referenced this pull request Jan 25, 2025
* wip

* wip

* revert

* comments

* pr feedback

* pr feedback

* pr feedback
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 VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants