mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
refactor - remove unused chat issue reporting command (#291684)
This commit is contained in:
@@ -48,9 +48,6 @@ import { ChatSetupController } from './chatSetupController.js';
|
||||
import { ChatSetupAnonymous, ChatSetupStep, IChatSetupResult } from './chatSetup.js';
|
||||
import { ChatSetup } from './chatSetupRunner.js';
|
||||
import { CommandsRegistry } from '../../../../../platform/commands/common/commands.js';
|
||||
import { IOutputService } from '../../../../services/output/common/output.js';
|
||||
import { ITextModelService } from '../../../../../editor/common/services/resolverService.js';
|
||||
import { IWorkbenchIssueService } from '../../../issue/common/issue.js';
|
||||
import { IDefaultAccountService } from '../../../../../platform/defaultAccount/common/defaultAccount.js';
|
||||
import { IHostService } from '../../../../services/host/browser/host.js';
|
||||
|
||||
@@ -175,7 +172,6 @@ export class SetupAgent extends Disposable implements IChatAgentImplementation {
|
||||
private static readonly TRUST_NEEDED_MESSAGE = new MarkdownString(localize('trustNeeded', "You need to trust this workspace to use Chat."));
|
||||
|
||||
private static readonly CHAT_RETRY_COMMAND_ID = 'workbench.action.chat.retrySetup';
|
||||
private static readonly CHAT_REPORT_ISSUE_WITH_OUTPUT_COMMAND_ID = 'workbench.action.chat.reportIssueWithOutput';
|
||||
|
||||
private readonly _onUnresolvableError = this._register(new Emitter<void>());
|
||||
readonly onUnresolvableError = this._onUnresolvableError.event;
|
||||
@@ -200,50 +196,6 @@ export class SetupAgent extends Disposable implements IChatAgentImplementation {
|
||||
|
||||
private registerCommands(): void {
|
||||
|
||||
// Report issue with output command
|
||||
this._register(CommandsRegistry.registerCommand(SetupAgent.CHAT_REPORT_ISSUE_WITH_OUTPUT_COMMAND_ID, async accessor => {
|
||||
const outputService = accessor.get(IOutputService);
|
||||
const textModelService = accessor.get(ITextModelService);
|
||||
const issueService = accessor.get(IWorkbenchIssueService);
|
||||
const logService = accessor.get(ILogService);
|
||||
|
||||
let outputData = '';
|
||||
let channelName = '';
|
||||
|
||||
let channel = outputService.getChannel(defaultChat.outputChannelId);
|
||||
if (channel) {
|
||||
channelName = defaultChat.outputChannelId;
|
||||
} else {
|
||||
logService.warn(`[chat setup] Output channel '${defaultChat.outputChannelId}' not found, falling back to Window output channel`);
|
||||
channel = outputService.getChannel('rendererLog');
|
||||
channelName = 'Window';
|
||||
}
|
||||
|
||||
if (channel) {
|
||||
try {
|
||||
const model = await textModelService.createModelReference(channel.uri);
|
||||
try {
|
||||
const rawOutput = model.object.textEditorModel.getValue();
|
||||
outputData = `<details>\n<summary>GitHub Copilot Chat Output (${channelName})</summary>\n\n\`\`\`\n${rawOutput}\n\`\`\`\n</details>`;
|
||||
logService.info(`[chat setup] Retrieved ${rawOutput.length} characters from ${channelName} output channel`);
|
||||
} finally {
|
||||
model.dispose();
|
||||
}
|
||||
} catch (error) {
|
||||
logService.error(`[chat setup] Failed to retrieve output channel content: ${error}`);
|
||||
}
|
||||
} else {
|
||||
logService.warn(`[chat setup] No output channel available`);
|
||||
}
|
||||
|
||||
await issueService.openReporter({
|
||||
extensionId: defaultChat.chatExtensionId,
|
||||
issueTitle: 'Chat took too long to get ready',
|
||||
issueBody: 'Chat took too long to get ready',
|
||||
data: outputData || localize('chatOutputChannelUnavailable', "GitHub Copilot Chat output channel not available. Please ensure the GitHub Copilot Chat extension is active and try again. If the issue persists, you can manually include relevant information from the Output panel (View > Output > GitHub Copilot Chat).")
|
||||
});
|
||||
}));
|
||||
|
||||
// Retry chat command
|
||||
this._register(CommandsRegistry.registerCommand(SetupAgent.CHAT_RETRY_COMMAND_ID, async (accessor, sessionResource: URI) => {
|
||||
const hostService = accessor.get(IHostService);
|
||||
@@ -430,11 +382,7 @@ export class SetupAgent extends Disposable implements IChatAgentImplementation {
|
||||
id: SetupAgent.CHAT_RETRY_COMMAND_ID,
|
||||
title: localize('retryChat', "Restart"),
|
||||
arguments: [requestModel.session.sessionResource]
|
||||
},
|
||||
additionalCommands: [{
|
||||
id: SetupAgent.CHAT_REPORT_ISSUE_WITH_OUTPUT_COMMAND_ID,
|
||||
title: localize('reportChatIssue', "Report Issue"),
|
||||
}]
|
||||
}
|
||||
});
|
||||
|
||||
// This means Chat is unhealthy and we cannot retry the
|
||||
|
||||
Reference in New Issue
Block a user