Skip to content

Commit

Permalink
Dont allocate space for details when there is none microsoft#27868 mi…
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jun 8, 2018
1 parent 2e0a564 commit 7f6c0ae
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/vs/editor/contrib/suggest/suggestWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
private storageServiceAvailable: boolean = true;
private expandSuggestionDocs: boolean = false;

private firstFocusInCurrentList: boolean = false;

constructor(
private editor: ICodeEditor,
@ITelemetryService private telemetryService: ITelemetryService,
Expand Down Expand Up @@ -566,6 +568,7 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
const item = e.elements[0];
this._ariaAlert(this._getSuggestionAriaAlertLabel(item));

this.firstFocusInCurrentList = !this.focusedItem;
if (item === this.focusedItem) {
return;
}
Expand Down Expand Up @@ -1006,11 +1009,17 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
}

private expandSideOrBelow() {
if (!canExpandCompletionItem(this.focusedItem) && this.firstFocusInCurrentList) {
removeClass(this.element, 'docs-side');
removeClass(this.element, 'docs-below');
return;
}

let matches = this.element.style.maxWidth.match(/(\d+)px/);
if (!matches || Number(matches[1]) < this.maxWidgetWidth) {
addClass(this.element, 'docs-below');
removeClass(this.element, 'docs-side');
} else {
} else if (canExpandCompletionItem(this.focusedItem)) {
addClass(this.element, 'docs-side');
removeClass(this.element, 'docs-below');
}
Expand Down

0 comments on commit 7f6c0ae

Please sign in to comment.