-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
On-the-fly-docs -- Add quota exceeded dialogue #76877
On-the-fly-docs -- Add quota exceeded dialogue #76877
Conversation
@@ -18,6 +18,6 @@ internal interface IExternalCSharpCopilotCodeAnalysisService | |||
Task<ImmutableArray<Diagnostic>> AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); | |||
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
ClassifiedTextElement.TextClassificationTypeName, | ||
quotaExceededMatch.Groups[1].Value), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClassifiedTextElement.TextClassificationTypeName, | |
quotaExceededMatch.Groups[1].Value), | |
ClassifiedTextElement.TextClassificationTypeName, | |
quotaExceededMatch.Groups[1].Value), |
var copilotRequestTime = stopwatch.Elapsed; | ||
|
||
await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); | ||
|
||
cancellationToken.ThrowIfCancellationRequested(); | ||
|
||
if (response is null || response.Length == 0) | ||
if (responseString is null || responseString.Length == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (responseString is null || responseString.Length == 0) | |
if (string.IsNullOrEmpty(responseString)) |
var elements = new List<object> | ||
{ | ||
new ContainerElement(ContainerElementStyle.Wrapped, new ClassifiedTextElement(this.quotaExceededContent)) | ||
}; | ||
|
||
_responseControl.Content = ToUIElement(new ContainerElement(ContainerElementStyle.Stacked, elements)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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))])); |
* wip * wip * revert * comments * pr feedback * pr feedback * pr feedback
Updates
OnTheFlyDocsView.xaml.vs
to handle and display quota exceeded messages.Updates
ICopilotCodeAnalysisService
to retrieve the status of the response from Copilot.