From 155fcfa5bb9aaebca0e1cb598160d7239f1bad15 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Fri, 28 Feb 2020 11:56:45 -0800 Subject: [PATCH] suggest: fix handling around long lines See: https://github.com/microsoft/vscode/issues/90552#issuecomment-592680419 `overflow: hidden` should have been `overflow: auto`. Auto displays a scrollbar which, depending on the platform, can make the items too high. Also fixes names being cut off (see the loooong) cutoff in the linked issue. `flex-shrink:0` is on the label, with a max-width of 100%. But on the left there was the 18px icon, so the right side of the label was 18px off the end and not visible. Fix it by moving the icon outside of the `.left` side. We could alternately `calc(100% - 18px)`, but since the icon was not a hardcoded size in CSS I didn't want to implicitly depend on that. --- src/vs/editor/contrib/suggest/media/suggest.css | 3 ++- src/vs/editor/contrib/suggest/suggestWidget.ts | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/contrib/suggest/media/suggest.css b/src/vs/editor/contrib/suggest/media/suggest.css index af01d6da5c5..be783ef5177 100644 --- a/src/vs/editor/contrib/suggest/media/suggest.css +++ b/src/vs/editor/contrib/suggest/media/suggest.css @@ -176,7 +176,7 @@ } .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left > .signature-label { - overflow: auto; + overflow: hidden; text-overflow: ellipsis; } @@ -228,6 +228,7 @@ .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left { flex-shrink: 1; + flex-grow: 1; overflow: hidden; } .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left > .monaco-icon-label { diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index 91b862f2982..3613e737d07 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -144,11 +144,10 @@ class ItemRenderer implements IListRenderer