Skip to content

Commit

Permalink
give localize() the string literal it desires
Browse files Browse the repository at this point in the history
  • Loading branch information
spebl committed Nov 27, 2024
1 parent 6704c47 commit 4a68683
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1489,11 +1489,10 @@ async function onCopilotHover(): Promise<void> {
}

async function reportCopilotFailure(copilotHoverProvider: CopilotHoverProvider, hoverDocument: vscode.TextDocument, hoverPosition: vscode.Position, customError?: string): Promise<void> {
const defaultError: string = "An error occurred while generating Copilot summary.";
const errorMessage = customError ? customError : defaultError;
telemetry.logLanguageServerEvent("CopilotHoverError", { errorMessage });
const errorMessage = customError ? customError : "";
telemetry.logLanguageServerEvent("CopilotHoverError", { "ErrorMessage": errorMessage });
// Display the localized default failure message in the hover.
await showCopilotContent(copilotHoverProvider, hoverDocument, hoverPosition, localize("copilot.hover.error", defaultError));
await showCopilotContent(copilotHoverProvider, hoverDocument, hoverPosition, localize("copilot.hover.error", "An error occurred while generating Copilot summary."));
}

async function showCopilotContent(copilotHoverProvider: CopilotHoverProvider, hoverDocument: vscode.TextDocument, hoverPosition: vscode.Position, content?: string): Promise<boolean> {
Expand Down

0 comments on commit 4a68683

Please sign in to comment.