Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellisense suggestions should display an horizontal scrollbar if needed #29757

Closed
fbricon opened this issue Jun 28, 2017 · 40 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach ux User experience issues
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Jun 28, 2017

  • VSCode Version: 1.13.0
  • OS Version: macOS Sierra 10.12.5

Steps to Reproduce:

  1. install java extension
  2. open java file
  3. type import o, wait for suggestions to show up
    suggestions are truncated because the package names don't fit in the suggestion window, there's no way to scroll horizontally

See redhat-developer/vscode-java#249
https://gyazo.com/9f0b536a9f71d72a4939ffbb4834340d

Reproduces without extensions: Maybe

@vscodebot vscodebot bot added the extensions Issues concerning extensions label Jun 28, 2017
@ramya-rao-a ramya-rao-a added suggest IntelliSense, Auto Complete ux User experience issues and removed extensions Issues concerning extensions labels Jun 30, 2017
@ramya-rao-a ramya-rao-a added this to the Backlog milestone Jun 30, 2017
@ramya-rao-a ramya-rao-a added feature-request Request for new features or functionality under-discussion Issue is under discussion for relevance, priority, approach labels Nov 16, 2017
@stevencl
Copy link
Member

I am not sure how well a horizontal scroll bar would work. How difficult would it be to increase the width to accomodate these longer strings, if the string is longer than would fit in the default width?

The problem with the scroll bar is that once you scroll to the right, you need to scroll back to the left if you arrow down and the next item is much shorter in length. A solution to that would be to auto scroll back to the left after making another selection but then that could run into problems if the list looks like the screenshot above.

@fbricon
Copy link
Contributor Author

fbricon commented Nov 16, 2017

The problem with the scroll bar is that once you scroll to the right, you need to scroll back to the left if you arrow down and the next item is much shorter in length

This is the behaviour I see in Eclipse. With a trackpad, it's absolutely manageable.
I think this would give users less surprises than trying to autoscroll back when changing the selection.
A better solution would probably be to scroll left only if the selection text size is lower than the x-position of the currently visible pane, but that's probably too complicated

@hdorgeval
Copy link

One of my colleague shows me that, in the css that drives the suggestion list, there is a width:50% that is set. when forced to 100%, the width of the suggestion list is then ok (no cropping). It could be great if the suggestion-list max width could be parameterized directly in the workspace settings

@hdorgeval
Copy link

Here is a screenshot of this css rule:
screen shot 2017-11-16 at 22 39 27

When I set the value to 70%:
screen shot 2017-11-16 at 22 41 37

@hdorgeval
Copy link

I have also discovered that if you reduce the width of the VS Code editor window, then suddenly there is no more cropping as shown by the following sceenshot:
screen shot 2017-11-16 at 22 51 12

@emeentag
Copy link

emeentag commented Dec 24, 2017

This is definitely a usability issue and please take care of it. I am pretty sure you can solve it in a good way. Also as @fbricon said in eclipse and others there is horizontal scroll bar appears if horizontal scroll bar needed. Also you can resize the suggestion bubble with catching it and dragging from bottom right corner.

@emeentag
Copy link

emeentag commented Dec 24, 2017

@hdorgeval mentioned a quick hack, i will try to explain this quick hack until a solution is shipped in later releases. I also want to say that, suggestions became way better for me after this hack, especially while programming in java.

Steps:

  • Open VsCode's package contents folder. It is the folder where you installed VsCode on your machine. Could be different for each operating systems.
  • In mac i went through this path for the css file:
    Your Package Contents/Resources/app/out/vs/workbench/workbench.main.css
  • Search for this line:
    .monaco-editor .suggest-widget.docs-side>.tree
  • Edit width css property from 50% to 100%
  • Save and restart vscode. You will get a warning like Your Code installation appears to be corrupt. Please reinstall. Just ignore it because with doing this way, we broke the md5 checksum of the installation. For me a proper suggestion much more important than this warning.

Before:
screen shot 2017-12-25 at 00 09 07

After:
screen shot 2017-12-25 at 00 01 25

@darkgem666
Copy link

Hi @hopbalabi , for some reason the hack didn't work for me.

  • VsCode versio: Version 1.19.3 (1.19.3)
  • MacOsX version: 10.13.2

@emeentag
Copy link

emeentag commented Feb 1, 2018

@darkgem666 please make sure you are editing workbench.main.css After you change this css you must restart the vscode.

@darkgem666
Copy link

I did.

screen shot 2018-02-02 at 11 53 31 am

@Aggror
Copy link

Aggror commented Apr 5, 2018

Hi @hopbalabi. Thanks for the tip. I even set it to 200%. Wish we could customize this using the settings or something.

@StephenOTT
Copy link

StephenOTT commented Apr 8, 2018

REALLY NEEDED! +1

At the very least have tooltip hover show the fully value when the mouse is hovering over a item...
or have the full value shown in the details window on the right... Right now there seems to be no way to see the value..

@poliarush
Copy link

+1

@s-shamesmuhametov-parc
Copy link

This hack works for me, but the VS Code version: 1.23.1 seems to have broken something. I want to configure without the hack

@akaroml
Copy link
Member

akaroml commented Nov 18, 2019

Here to share a related issue microsoft/vscode-java-pack#255. Java classes often have longer full names. And the current completion list is showing ellipsis which omits the most important message, e.g. the class name.
image

Showing the horizontal scroll bar is definitely a nice workaround. But it would be nicer to ask the language server. Here are two options:

  1. Vscode asks the language server to provide a short name by specifying the max length.
    a. Full name: org.hibernate.validator.internal.constraintvalidators.bv
    b. Parameter: maxLength: 50
    c: Result: org.hibernate.validator.internal.constraint...bv
  2. Vscode asks the language server to mark the most significant part in the name (with a range), and then generates better short names.
    a. Full name: org.hibernate.validator.internal.constraintvalidators.bv
    b. Significant part: (54, 56) -> bv
    c. Result: org.hibernate.validator.internal.constraint...bv

@jrieken
Copy link
Member

jrieken commented Nov 18, 2019

@akaroml Did you experiment with only using the last part as label, e.g. FooValidatorFactory, and to use the fully qualified name in the detail or description only? I am asking because I think that even adding a scrollbar or label-shorting won't help much with being able to quickly grasp what's showing on the screen. In addition to the short-labels you can still suggest package names, like so

label: FooValidator, detail: org.hip.hop. FooValidator
label: FooValidatorFactory, detail: org.hip.hop. FooValidatorFactory
label: org, detail: package

That would allow to type package names and type names and would make the IntelliSense widget less busy.

@muhd-ali
Copy link

muhd-ali commented Dec 1, 2019

@hdorgeval mentioned a quick hack, i will try to explain this quick hack until a solution is shipped in later releases. I also want to say that, suggestions became way better for me after this hack, especially while programming in java.

Steps:

  • Open VsCode's package contents folder. It is the folder where you installed VsCode on your machine. Could be different for each operating systems.
  • In mac i went through this path for the css file:
    Your Package Contents/Resources/app/out/vs/workbench/workbench.main.css
  • Search for this line:
    .monaco-editor .suggest-widget.docs-side>.tree
  • Edit width css property from 50% to 100%
  • Save and restart vscode. You will get a warning like Your Code installation appears to be corrupt. Please reinstall. Just ignore it because with doing this way, we broke the md5 checksum of the installation. For me a proper suggestion much more important than this warning.

Before:
screen shot 2017-12-25 at 00 09 07

After:
screen shot 2017-12-25 at 00 01 25

The directory structure on v1.40.2 seems to have changed. The css files in the stated directory are named differently. Also setting it to 100% did not work for me. Not sure why.

@akaroml
Copy link
Member

akaroml commented Dec 4, 2019

@akaroml Did you experiment with only using the last part as label, e.g. FooValidatorFactory, and to use the fully qualified name in the detail or description only? I am asking because I think that even adding a scrollbar or label-shorting won't help much with being able to quickly grasp what's showing on the screen. In addition to the short-labels you can still suggest package names, like so

label: FooValidator, detail: org.hip.hop. FooValidator
label: FooValidatorFactory, detail: org.hip.hop. FooValidatorFactory
label: org, detail: package

That would allow to type package names and type names and would make the IntelliSense widget less busy.

Just tried to put the short name in the front and it looks good enough for me. What do you think? @fbricon
image

@akaroml
Copy link
Member

akaroml commented Dec 4, 2019

Further playing with my modification, there is actually a new problem. As I keep on typing "spring" to limit the search scope, the highlighting works in a weird way. I was expecting the term "org.spring" to be highlighted, but only "spring" is. I guess it has something to do with the string match algorithm in vscode.

image

@hxuanhung
Copy link

In case anyone wants to use the hack above, on Mac and vscode (1.41.0-insider) file name is changed to workbench.desktop.main.css

Steps:
Open VsCode's package contents folder. It is the folder where you installed VsCode on your machine. Could be different for each operating systems.
In mac i went through this path for the css file:
Your Package Contents/Resources/app/out/vs/workbench/workbench.main.css
Search for this line:
.monaco-editor .suggest-widget.docs-side>.tree
Edit width css property from 50% to 100%
Save and restart vscode. You will get a warning like Your Code installation appears to be corrupt. Please reinstall. Just ignore it because with doing this way, we broke the md5 checksum of the installation. For me a proper suggestion much more important than this warning.

@mahop-net
Copy link

What is the situation right now? Also for JS Development this box is pretty small? Resizing the Box with the mouse and remembering the width and hight for the next time would be great...

2020-03-11_1812

Or a setting somewhere here: (Workspace and User)

grafik

@ValentinH
Copy link

A pretty similar issue is with the "auto-import" labels which are way too short:
image

When you are importing a type with a common name, it's really hard to know which one to import.

@ValentinH
Copy link

I actually noticed that if you hover the row, there is an "i" icon.
image

If you click on it, the description will be shown in a new popup attached to the first one:
image

The best part is that once you clicked it, it will stay in this mode for the next time.

@jayjun
Copy link
Contributor

jayjun commented May 19, 2020

To everyone resorting to the CSS hack, upvote #30140 to make bottom suggestion details permanent.

@chetrf
Copy link

chetrf commented Jun 14, 2020

To anyone having trouble getting the CSS hack to work, one more detail that finally made it work for me: I had to change the Editor: Suggest Font Size from zero to something smaller than my default font. I had almost given up on getting the CSS hack to work. After I did that the change from 50% to 100% worked. This is on MacOs Catalina.

suggestFontSize

It seems I can make it bigger, smaller, or zero and the CSS hack now works. Something about changing it made the change start working.

@Jonathan0wh
Copy link

waiting for feature request #29126

@JCKodel
Copy link

JCKodel commented Jul 18, 2020

  1. Create the following css in your user folder (figure out paths if you are not on Windows):
.monaco-editor .suggest-widget.docs-side{
  left: 32px !important;
  right: 32px !important;
  width: calc(100vw - 64px) !important;
}

  .monaco-editor .suggest-widget.docs-side .tree {
    width: 34% !important;
  }

  .monaco-editor .suggest-widget.docs-side .details {
    width: 66% !important;
  }
  1. Install be5invis.vscode-custom-css extension

  2. Insert this on your settings.json:

  "vscode_custom_css.imports": [
    "file://C:/Users/jckod/vscode.css"
  ],
  "vscode_custom_css.policy": true
  1. Press F1 to get the command palette and run Reload custom CSS and JS

  2. Restart VSCode when requested in the notification

  3. Ignore the "VSCode install is corrupt"

image

Nice full screen intellisense, with no jumping.

See? Is not that hard, Microsoft. I don't care if it is not right on the cursor position. I just care about being able to read the f☠ documentation ¬¬

@jrieken
Copy link
Member

jrieken commented Oct 26, 2020

The suggestions and the details part are going to be resizable (see #29126 (comment)). I am closing this as a related/duplicated issue.

@jrieken jrieken closed this as completed Oct 26, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach ux User experience issues
Projects
None yet
Development

No branches or pull requests