Skip to content

Commit 46b756b

Browse files
authored
show inline chat content widget above selection (microsoft#208992)
1 parent 7caf8b6 commit 46b756b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class InlineChatContentWidget implements IContentWidget {
124124
}
125125
return {
126126
position: this._position,
127-
preference: [ContentWidgetPositionPreference.BELOW]
127+
preference: [ContentWidgetPositionPreference.ABOVE]
128128
};
129129
}
130130

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -935,12 +935,14 @@ export class InlineChatController implements IEditorContribution {
935935

936936
} else if (initialRender) {
937937
const selection = this._editor.getSelection();
938-
widgetPosition = selection.getEndPosition();
939-
if (Range.spansMultipleLines(selection) && widgetPosition.column === 1) {
940-
// selection ends on "nothing" -> move up to match the
941-
// rendered/visible part of the selection
942-
widgetPosition = this._editor.getModel().validatePosition(widgetPosition.delta(-1, Number.MAX_SAFE_INTEGER));
943-
}
938+
widgetPosition = selection.getStartPosition();
939+
// TODO@jrieken we are not ready for this
940+
// widgetPosition = selection.getEndPosition();
941+
// if (Range.spansMultipleLines(selection) && widgetPosition.column === 1) {
942+
// // selection ends on "nothing" -> move up to match the
943+
// // rendered/visible part of the selection
944+
// widgetPosition = this._editor.getModel().validatePosition(widgetPosition.delta(-1, Number.MAX_SAFE_INTEGER));
945+
// }
944946
this._input.value.show(widgetPosition);
945947

946948
} else {

0 commit comments

Comments
 (0)