Skip to content

Commit

Permalink
restore accidentially deleted vscode.editorChat.start command (#212068
Browse files Browse the repository at this point in the history
)

fixes #211988
  • Loading branch information
jrieken authored May 6, 2024
1 parent c20c2ab commit ccba2fc
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/vs/workbench/api/common/extHostApiCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Schemas, matchesSomeScheme } from 'vs/base/common/network';
import { URI } from 'vs/base/common/uri';
import { IPosition } from 'vs/editor/common/core/position';
import { IRange } from 'vs/editor/common/core/range';
import { ISelection } from 'vs/editor/common/core/selection';
import * as languages from 'vs/editor/common/languages';
import { decodeSemanticTokensDto } from 'vs/editor/common/services/semanticTokensDto';
import { validateWhenClauses } from 'vs/platform/contextkey/common/contextkey';
Expand Down Expand Up @@ -512,8 +513,43 @@ const newCommands: ApiCommand[] = [
return value ? typeConverters.WorkspaceEdit.to(value) : null;
})
),
// --- inline chat
new ApiCommand(
'vscode.editorChat.start', 'inlineChat.start', 'Invoke a new editor chat session',
[new ApiCommandArgument<InlineChatEditorApiArg | undefined, InlineChatRunOptions | undefined>('Run arguments', '', _v => true, v => {

if (!v) {
return undefined;
}

return {
initialRange: v.initialRange ? typeConverters.Range.from(v.initialRange) : undefined,
initialSelection: types.Selection.isSelection(v.initialSelection) ? typeConverters.Selection.from(v.initialSelection) : undefined,
message: v.message,
autoSend: v.autoSend,
position: v.position ? typeConverters.Position.from(v.position) : undefined,
};
})],
ApiCommandResult.Void
)
];

type InlineChatEditorApiArg = {
initialRange?: vscode.Range;
initialSelection?: vscode.Selection;
message?: string;
autoSend?: boolean;
position?: vscode.Position;
};

type InlineChatRunOptions = {
initialRange?: IRange;
initialSelection?: ISelection;
message?: string;
autoSend?: boolean;
position?: IPosition;
};

//#endregion


Expand Down

0 comments on commit ccba2fc

Please sign in to comment.