mirror of
https://github.com/Microsoft/vscode
synced 2024-10-06 03:17:00 +00:00
show inline chat content widget above selection (#208997)
This commit is contained in:
parent
94f7c1d971
commit
edfd5b8ba5
|
@ -124,7 +124,7 @@ export class InlineChatContentWidget implements IContentWidget {
|
|||
}
|
||||
return {
|
||||
position: this._position,
|
||||
preference: [ContentWidgetPositionPreference.BELOW]
|
||||
preference: [ContentWidgetPositionPreference.ABOVE]
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -935,12 +935,14 @@ export class InlineChatController implements IEditorContribution {
|
|||
|
||||
} else if (initialRender) {
|
||||
const selection = this._editor.getSelection();
|
||||
widgetPosition = selection.getEndPosition();
|
||||
if (Range.spansMultipleLines(selection) && widgetPosition.column === 1) {
|
||||
// selection ends on "nothing" -> move up to match the
|
||||
// rendered/visible part of the selection
|
||||
widgetPosition = this._editor.getModel().validatePosition(widgetPosition.delta(-1, Number.MAX_SAFE_INTEGER));
|
||||
}
|
||||
widgetPosition = selection.getStartPosition();
|
||||
// TODO@jrieken we are not ready for this
|
||||
// widgetPosition = selection.getEndPosition();
|
||||
// if (Range.spansMultipleLines(selection) && widgetPosition.column === 1) {
|
||||
// // selection ends on "nothing" -> move up to match the
|
||||
// // rendered/visible part of the selection
|
||||
// widgetPosition = this._editor.getModel().validatePosition(widgetPosition.delta(-1, Number.MAX_SAFE_INTEGER));
|
||||
// }
|
||||
this._input.value.show(widgetPosition);
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue