mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
fix: bundling error makes terminal suggestions fail
Signed-off-by: Chapman Pendery <cpendery@microsoft.com>
This commit is contained in:
parent
0c5078aacd
commit
4580df9d4f
|
@ -296,7 +296,8 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
|
|||
// TODO: What do frozen and auto do?
|
||||
const xtermBox = this._screen!.getBoundingClientRect();
|
||||
const panelBox = this._panel!.offsetParent!.getBoundingClientRect();
|
||||
suggestWidget.showSuggestions(model, 0, false, false, {
|
||||
suggestWidget.setCompletionModel(model);
|
||||
suggestWidget.showSuggestions(0, false, false, {
|
||||
left: (xtermBox.left - panelBox.left) + this._terminal.buffer.active.cursorX * dimensions.width,
|
||||
top: (xtermBox.top - panelBox.top) + this._terminal.buffer.active.cursorY * dimensions.height,
|
||||
height: dimensions.height
|
||||
|
@ -467,7 +468,8 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
|
|||
// TODO: What do frozen and auto do?
|
||||
const xtermBox = this._screen!.getBoundingClientRect();
|
||||
const panelBox = this._panel!.offsetParent!.getBoundingClientRect();
|
||||
this._suggestWidget?.showSuggestions((this._suggestWidget as any)._completionModel, 0, false, false, {
|
||||
|
||||
this._suggestWidget?.showSuggestions(0, false, false, {
|
||||
left: (xtermBox.left - panelBox.left) + (this._terminal.buffer.active.cursorX + handledCursorDelta) * dimensions.width,
|
||||
top: (xtermBox.top - panelBox.top) + this._terminal.buffer.active.cursorY * dimensions.height,
|
||||
height: dimensions.height
|
||||
|
|
|
@ -204,7 +204,11 @@ export class SimpleSuggestWidget implements IDisposable {
|
|||
|
||||
private _cursorPosition?: { top: number; left: number; height: number };
|
||||
|
||||
showSuggestions(completionModel: SimpleCompletionModel, selectionIndex: number, isFrozen: boolean, isAuto: boolean, cursorPosition: { top: number; left: number; height: number }): void {
|
||||
setCompletionModel(completionModel: SimpleCompletionModel) {
|
||||
this._completionModel = completionModel;
|
||||
}
|
||||
|
||||
showSuggestions(selectionIndex: number, isFrozen: boolean, isAuto: boolean, cursorPosition: { top: number; left: number; height: number }): void {
|
||||
this._cursorPosition = cursorPosition;
|
||||
|
||||
// this._contentWidget.setPosition(this.editor.getPosition());
|
||||
|
@ -213,16 +217,12 @@ export class SimpleSuggestWidget implements IDisposable {
|
|||
// this._currentSuggestionDetails?.cancel();
|
||||
// this._currentSuggestionDetails = undefined;
|
||||
|
||||
if (this._completionModel !== completionModel) {
|
||||
this._completionModel = completionModel;
|
||||
}
|
||||
|
||||
if (isFrozen && this._state !== State.Empty && this._state !== State.Hidden) {
|
||||
this._setState(State.Frozen);
|
||||
return;
|
||||
}
|
||||
|
||||
const visibleCount = this._completionModel.items.length;
|
||||
const visibleCount = this._completionModel?.items.length;
|
||||
const isEmpty = visibleCount === 0;
|
||||
// this._ctxSuggestWidgetMultipleSuggestions.set(visibleCount > 1);
|
||||
|
||||
|
@ -241,7 +241,7 @@ export class SimpleSuggestWidget implements IDisposable {
|
|||
// this._onDidFocus.pause();
|
||||
// this._onDidSelect.pause();
|
||||
try {
|
||||
this._list.splice(0, this._list.length, this._completionModel.items);
|
||||
this._list.splice(0, this._list.length, this._completionModel?.items ?? []);
|
||||
this._setState(isFrozen ? State.Frozen : State.Open);
|
||||
this._list.reveal(selectionIndex, 0);
|
||||
this._list.setFocus([selectionIndex]);
|
||||
|
|
Loading…
Reference in a new issue