Skip to content

Commit 5376d85

Browse files
authored
Merge pull request microsoft#227189 from microsoft/joh/distinctive-lobster
The `move` request should set the editor selection
2 parents 11ad426 + a7cad7d commit 5376d85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ export class InlineChatController implements IEditorContribution {
629629

630630
// if there's already a tab open for targetUri, show it and move inline chat to that tab
631631
// otherwise, open the tab to the side
632-
const editorPane = await this._editorService.openEditor({ resource: e.target }, SIDE_GROUP);
632+
const initialSelection = Selection.fromRange(Range.lift(e.range), SelectionDirection.LTR);
633+
const editorPane = await this._editorService.openEditor({ resource: e.target, options: { selection: initialSelection } }, SIDE_GROUP);
633634

634635
if (!editorPane) {
635636
log('opening editor failed');
@@ -655,9 +656,8 @@ export class InlineChatController implements IEditorContribution {
655656
},
656657
CancellationToken.None); // TODO@ulugbekna: add proper cancellation?
657658

658-
const initialSelection = Selection.fromRange(Range.lift(e.range), SelectionDirection.LTR);
659659

660-
InlineChatController.get(newEditor)?.run({ initialSelection, existingSession: newSession });
660+
InlineChatController.get(newEditor)?.run({ existingSession: newSession });
661661

662662
next = State.CANCEL;
663663
responsePromise.complete();

0 commit comments

Comments
 (0)