mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Fix copilot quick fix (#200162)
This commit is contained in:
parent
e2e446669e
commit
673006e0e3
|
@ -346,12 +346,12 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
|
|||
inferFromBody.diagnostics = [diagnostic];
|
||||
inferFromBody.command = {
|
||||
command: EditorChatFollowUp.ID,
|
||||
arguments: [<EditorChatFollowUp_Args>{
|
||||
arguments: [{
|
||||
message: 'Add types to this code. Add separate interfaces when possible. Do not change the code except for adding types.',
|
||||
expand: { kind: 'navtree-function', pos: diagnostic.range.start },
|
||||
document,
|
||||
action: { type: 'quickfix', quickfix: action }
|
||||
}],
|
||||
} satisfies EditorChatFollowUp_Args],
|
||||
title: ''
|
||||
};
|
||||
actions.push(inferFromBody);
|
||||
|
@ -381,11 +381,12 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
|
|||
arguments: [codeAction.command, {
|
||||
command: EditorChatFollowUp.ID,
|
||||
title: '',
|
||||
arguments: [<EditorChatFollowUp_Args>{
|
||||
arguments: [{
|
||||
message,
|
||||
expand,
|
||||
document
|
||||
}],
|
||||
document,
|
||||
action: { type: 'quickfix', quickfix: action }
|
||||
} satisfies EditorChatFollowUp_Args],
|
||||
}],
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,16 +13,16 @@ import * as fileSchemes from '../configuration/fileSchemes';
|
|||
import { Schemes } from '../configuration/schemes';
|
||||
import { TelemetryReporter } from '../logging/telemetry';
|
||||
import { API } from '../tsServer/api';
|
||||
import { CachedResponse } from '../tsServer/cachedResponse';
|
||||
import type * as Proto from '../tsServer/protocol/protocol';
|
||||
import * as PConst from '../tsServer/protocol/protocol.const';
|
||||
import * as typeConverters from '../typeConverters';
|
||||
import { ClientCapability, ITypeScriptServiceClient } from '../typescriptService';
|
||||
import { coalesce } from '../utils/arrays';
|
||||
import { nulToken } from '../utils/cancellation';
|
||||
import FormattingOptionsManager from './fileConfigurationManager';
|
||||
import { CompositeCommand, EditorChatFollowUp, EditorChatFollowUp_Args } from './util/copilot';
|
||||
import { conditionalRegistration, requireSomeCapability } from './util/dependentRegistration';
|
||||
import { EditorChatFollowUp, EditorChatFollowUp_Args, CompositeCommand } from './util/copilot';
|
||||
import * as PConst from '../tsServer/protocol/protocol.const';
|
||||
import { CachedResponse } from '../tsServer/cachedResponse';
|
||||
|
||||
function toWorkspaceEdit(client: ITypeScriptServiceClient, edits: readonly Proto.FileCodeEdits[]): vscode.WorkspaceEdit {
|
||||
const workspaceEdit = new vscode.WorkspaceEdit();
|
||||
|
@ -645,7 +645,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
|
|||
copilotRename = info => ({
|
||||
title: '',
|
||||
command: EditorChatFollowUp.ID,
|
||||
arguments: [<EditorChatFollowUp_Args>{
|
||||
arguments: [{
|
||||
message: `Rename ${newName} to a better name based on usage.`,
|
||||
expand: Extract_Constant.matches(action) ? {
|
||||
kind: 'navtree-function',
|
||||
|
@ -656,7 +656,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
|
|||
},
|
||||
action: { type: 'refactor', refactor: action },
|
||||
document,
|
||||
}]
|
||||
} satisfies EditorChatFollowUp_Args]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue