Skip to content
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

add InteractiveEditorSession.input #196045

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vs/workbench/api/common/extHostInlineChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class ExtHostInteractiveEditor implements ExtHostInlineChatShape {
return {
id,
placeholder: session.placeholder,
input: session.input,
slashCommands: session.slashCommands?.map(c => ({ command: c.command, detail: c.detail, refer: c.refer, executeImmediately: c.executeImmediately })),
wholeRange: typeConvert.Range.from(session.wholeRange),
message: session.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export class InlineChatController implements IEditorContribution {
this._updatePlaceholder();
this._zone.value.widget.updateInfo(this._activeSession.session.message ?? localize('welcome.1', "AI-generated code may be incorrect"));
this._zone.value.widget.preferredExpansionState = this._activeSession.lastExpansionState;
this._zone.value.widget.value = this._activeSession.lastInput?.value ?? this._zone.value.widget.value;
this._zone.value.widget.value = this._activeSession.session.input ?? this._activeSession.lastInput?.value ?? this._zone.value.widget.value;
this._sessionStore.add(this._zone.value.widget.onDidChangeInput(_ => {
const start = this._zone.value.position;
if (!start || !this._zone.value.widget.hasFocus() || !this._zone.value.widget.value || !this._editor.hasModel()) {
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/inlineChat/common/inlineChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface IInlineChatSlashCommand {
export interface IInlineChatSession {
id: number;
placeholder?: string;
input?: string;
message?: string;
slashCommands?: IInlineChatSlashCommand[];
wholeRange?: IRange;
Expand Down
1 change: 1 addition & 0 deletions src/vscode-dts/vscode.proposed.interactive.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ declare module 'vscode' {
// todo@API make classes
export interface InteractiveEditorSession {
placeholder?: string;
input?: string;
slashCommands?: InteractiveEditorSlashCommand[];
wholeRange?: Range;
message?: string;
Expand Down