microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.51k stars 29.4k forks source link

Configure tooltip max width #14165

Closed OliverJAsh closed 1 year ago

OliverJAsh commented 8 years ago

When you hover over a type in a TypeScript file, the tooltip that appears has a very low max width, making it difficult to read long type signatures.

OliverJAsh commented 8 years ago

I would include a screenshot but it's not easy to take a screenshot keeping the tooltip on screen!

maxhoffmann commented 7 years ago

2017-01-03 14 38 46

Errors are quite unreadable if the width does not adapt to the font size.

rakkarage commented 7 years ago

2017-02-16 2 it would be nice if the tip used the available space instead of wrapping at an arbitrary point in c# too

rakkarage commented 7 years ago

2017-03-09 2

anowell commented 7 years ago

tooltip

Same problem using rust's language server.

crucialfelix commented 6 years ago

General styling control would be very helpful. Also line-height.

Another approach would be to have a bottom panel that displays the full error and the tooltip displays a shortened version.

rakkarage commented 6 years ago

2018-02-15

Tiedye commented 6 years ago

image

When using the auto import feature it is often impossible to differentiate whats what as the import path is cut off due to the limited width of the suggestions window.

Aggror commented 6 years ago

Is this something we can adjust with custom css? It makes snippet infoormation very difficult to read as well. small

MikhailArkhipov commented 6 years ago

Same in Python. We have to jump through hoops trying to flow doc nicely. And when it appears OK on Windows, it breaks on Mac...

image

And it is inconsistent. Ex, hover is OK

image

But completion list decides to wrap. What gives?

image

Looks like hover respects markdown while completion item doc is plain string and gets wrapped randomly.

rakkarage commented 6 years ago

2018-04-15_li

KaelWD commented 6 years ago

Someone say long type signatures? image

ShenHongFei commented 6 years ago

Here is a workaround by hacking the file "C:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\workbench.main.css"

    /* suggest-widget size */
        .monaco-editor .suggest-widget.docs-side {
            width: 1600px;
        }
        .monaco-editor .suggest-widget.docs-side > .details {
            width: 70%;
            max-height: 800px !important;
        }
        .monaco-editor .suggest-widget.docs-side > .tree {
            width: 30%;
            float: left;
        }

    /* parameter-hints-widget */
        .editor-widget.parameter-hints-widget.visible {
            max-height: 800px !important;
        }
        .monaco-editor .parameter-hints-widget > .wrapper {
            max-width: 1600px;
        }

    /* editor-hover */
        .monaco-editor-hover .monaco-editor-hover-content {
            max-width: 1600px;
        }

Simply append the code above after the original content of file, and restart VSCode. (Title bar may alert a warning message "Not Supported" and hacked changes would be overridden by updating VSCode)

0062

7sharp9 commented 6 years ago

It would be nice to have some control on the width.

The above does work but vscode presents the message your installation may be corrupt on restarting.

macintacos commented 6 years ago

Instead of hacking the CSS directly as @ShenHongFei mentioned above, I recommend using the Custom CSS and JS Loader extension to just override the current CSS. That way when VSCode updates, you can just reload the custom css file that you have specified (personally, I have a dotfiles project where I hold configurations for my shell, Spacemacs, etc. and this custom CSS file goes there).

Until it's officially supported, hacking the CSS is likely the best route. The suggested widths above were a bit much for me, so I settled on the following values for now:

/* suggest-widget size */

.monaco-editor .suggest-widget.docs-side {
  width: 1000px;
}

.monaco-editor .suggest-widget.docs-side > .details {
  width: 60%;
  max-height: 800px !important;
}

.monaco-editor .suggest-widget.docs-side > .tree {
  width: 30%;
  float: left;
}

/* parameter-hints-widget */

.editor-widget.parameter-hints-widget.visible {
  max-height: 800px !important;
}

.monaco-editor .parameter-hints-widget > .wrapper {
  max-width: 1000px;
}

/* editor-hover */

.monaco-editor-hover .monaco-editor-hover-content {
  max-width: 1000px;
}
joealden commented 6 years ago

What is preventing the devs from providing a configuration option for this? This issue has been open for almost 2 years, and it bugs me on a daily basis. Would love to see it fixed.

tecosaur commented 6 years ago

@roblourens (since you seem like the most relevant person to ping) is anything likely to be done about this?

Astrantia commented 6 years ago

@roblourens I would love to hear an explanation from devs too. What are the difficulties of implementing this? I imagine it's settings a dynamic max-width and adding some more lines to add it in Settings. Are there other design blockers?

Astrantia commented 6 years ago

@rebornix Will you take a look at this? In 3 days it will be a 2 year anniversary for this simple feature request.

rebornix commented 6 years ago

Assigned to @joaomoreno and @misolori as I remember we are going to have some UX improvements for editor tooltips and so on.

Astrantia commented 5 years ago

@joaomoreno @misolori @rebornix maybe now is the time to take this on? current iteration tries to solve parameter hints ux and this is not that much different

drewlustro commented 5 years ago

Result   🎉

screen shot 40


Instructions

I employed @macintacos's CSS and put together full instructions:

1. Install extension

Custom CSS and JS Loader extension

2. Set permissions

3. Create CSS override file

touch ~/.vscode-custom.css:


/* suggest-widget size */

.monaco-editor .suggest-widget.docs-side {
  width: 1000px;
}

.monaco-editor .suggest-widget.docs-side > .details {
  width: 60%;
  max-height: 800px !important;
}

.monaco-editor .suggest-widget.docs-side > .tree {
  width: 30%;
  float: left;
}

/* parameter-hints-widget */

.editor-widget.parameter-hints-widget.visible {
  max-height: 800px !important;
}

.monaco-editor .parameter-hints-widget > .wrapper {
  max-width: 1000px;
}

/* editor-hover */

.monaco-editor-hover .monaco-editor-hover-content {
  max-width: 1000px;
}

Apply CSS file path to settings.json


{
  "vscode_custom_css.imports": ["file:///Users/yourusername/.vscode-custom.css"],
  "vscode_custom_css.policy": true
}

4. Restart

macintacos commented 5 years ago

@drewlustro just as a disclaimer, if anyone modifies the CSS/JS of the app, it comes up at “corrupted” in diagnostic checks, and you’ll typically get pushback if you report issues and include diagnostic information. Or, at least, I received pushback when I had custom CSS/JS enabled, and wouldn’t receive help until I turned it off (even though it was harmless/not related to the issue I was having).

While this is indeed an okay workaround, we should just keep making our voices heard so that this is natively supported.

drewlustro commented 5 years ago

100% agree. This is just a workaround.

It's hard enough to read TypeScript lint as it is! :)

emlautarom1 commented 5 years ago

Currenlty using VSCode 1.30.2, followed @drewlustro instructions step by step, but it's not working. I don't even get the VSCode corrupt error. I'm running Windows 10 (V.1803).

Edit:

It was my mistake. For anyone who's having trouble, make sure to run Enable Custom CSS and JS from the command palette. Simply restarting won't work.

tamuratak commented 5 years ago

This issue seems to be fixed in 1.32.0-insider (1.32.0-insider) 2e4d4a6bb16a65303b460795fa4ac734f9aea43e. I hope this is an intended behavior.

I want to thank the developers.

tamuratak commented 5 years ago

This change is related to #67076.

I confirmed that the max width of CompletionItem.documentation is still small as mentioned above.

2019-02-22 17 06 19
tamuratak commented 5 years ago

Update: in #69388, only the hovers for problems and the hovers with code blocks become to have larger width. Others have smaller width.

JoeyRxy commented 5 years ago

@ShenHongFei Hello there,your solution is great,but I want to ask how to get rid of the word [Unsupported] at the title.As sort of OCD,sufferring from that.

thx a lot!

szhu commented 5 years ago

沈鸿飞 Hello there,your solution is great,but I want to ask how to get rid of the word [Unsupported] at the title.As sort of OCD,sufferring from that.

This extension was created specifically for solving this: https://marketplace.visualstudio.com/items?itemName=lehni.vscode-fix-checksums

jpike88 commented 5 years ago

This has been a long standing annoyance, with an issue that's like 2 and a half year ago. It shouldn't take much effort to have a config property that overrides the width/height of the tooltip, surely? Like, 10 mins of effort?

Screen Shot 2019-07-18 at 6 41 15 PM
szhu commented 5 years ago

@jpike88 if it's really 10 mins of effort, then I'm sure you can submit a PR for this? I definitely can't do this in anywhere close to 10 mins, so it would be much appreciated!

GitClickOk commented 4 years ago

Seriously, I want instead of this: Capture 1735

At least something like this (with syntax highlighting it will be even better): Capture 1736

burner1024 commented 4 years ago

@jpike88 if it's really 10 mins of effort, then I'm sure you can submit a PR for this? I definitely can't do this in anywhere close to 10 mins, so it would be much appreciated!

There's already been a PR.

I really don't understand this. I figure most VScode devs develop VScode in VScode, are they comfortable with the current state?

miguelsolorio commented 4 years ago

@jrieken fyi, it would be great if the hover could be resized like the suggest widget

modo-lv commented 3 years ago

How is this issue 4 years old and such a basic thing still isn't implemented?

dons20 commented 3 years ago

Is there any word on whether we could see this added soon? The suggestion widget has had resizing enabled since v1.51 in October, 2020. Is this tooltip widget considerably harder to add this feature for or are there additional considerations to be made? Whether it's a click to resize, or a manual adjustment in settings, could we have an update on the status of this addition?

Opening new editor tabs just to properly read code annotations for some more descriptive components on my large monitors does feel like an unnecessary extra step.

arash-bizcover commented 3 years ago

https://github.com/microsoft/vscode/issues/69388

arash-bizcover commented 3 years ago

https://github.com/microsoft/vscode/issues/69835

arash-bizcover commented 3 years ago

@jrieken might be very related and close to what you did here: https://github.com/microsoft/vscode/pull/109094

GilShoshan94 commented 2 years ago

Hi, Instead of configuring the max width as the title says, could the tooltip hover be resizable like the suggest widget ?

(Also check #29126 for more info on what was done with the suggest widget)

Arxareon commented 2 years ago

It's sad to see that it's still not a thing.. I would really like to adjust the height of hover description tooltips.. The big brother Visual Studio does a much better job already. Let VS Code catch up a little..

suspectinside commented 2 years ago

another possible view for this issue https://github.com/microsoft/vscode/issues/153984

js1m commented 2 years ago

It is 2022/11/11. Christmas is close and I made sure Santa knows what I want!

TFLXX commented 1 year ago

"Excuse me, it's 2023" 🙂

a-saven commented 1 year ago

This one will be my favorite. Copilot suggestions and TS errors just can't be seen in this tooltip. It's time to fix it.

ryneandal commented 1 year ago

If this is still open and no one is looking at it, I'll take a crack at it. Feel free to assign it to me if that's alright.

aiday-mar commented 1 year ago

Hey all, thank you for your patience. A PR has been made which is currently under work but nearing its completion. You may find it here: https://github.com/microsoft/vscode/pull/176744. Once this PR is merged, you will be able to resize content hovers within Insiders.

svipas commented 1 year ago

@aiday-mar Would you add "Reset Hover Widget Size" command in Command Palette? Like we have for suggest widget: "Reset Suggest Widget Size". It would be good if we could reset the size to the initial one.

ShalokShalom commented 1 year ago

@aiday-mar Thank you very much.

1 Is it correct, that this would not stay across different sessions?

2 The default max width is very small, is there any consideration, of increasing that?