Skip to content

Commit

Permalink
Merge pull request microsoft#210769 from microsoft/tyriar/210757_inte…
Browse files Browse the repository at this point in the history
…rrupt__cmdline

Set 633 E command line in PromptInputModel
  • Loading branch information
Tyriar authored and sergioengineer committed Apr 23, 2024
2 parents a396a69 + 5a55d08 commit 0bca799
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
this._continuationPrompt = value;
}

setConfidentCommandLine(value: string): void {
if (this._value !== value) {
this._value = value;
this._onDidChangeInput.fire(this._createStateObject());
}
}

getCombinedString(): string {
const value = this._value.replaceAll('\n', '\u23CE');
if (this._cursorIndex === -1) {
Expand Down Expand Up @@ -152,6 +159,7 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
this._onDidInterrupt.fire(event);
}


this._state = PromptInputState.Execute;
this._onDidFinishInput.fire(event);
this._onDidChangeInput.fire(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ export class CommandDetectionCapability extends Disposable implements ICommandDe
this._currentCommand.command = commandLine;
this._currentCommand.commandLineConfidence = 'high';
this._currentCommand.isTrusted = isTrusted;

if (isTrusted) {
this._promptInputModel.setConfidentCommandLine(commandLine);
}
}

serialize(): ISerializedCommandDetectionCapability {
Expand Down

0 comments on commit 0bca799

Please sign in to comment.