Closed OliverJAsh closed 1 year ago
I would include a screenshot but it's not easy to take a screenshot keeping the tooltip on screen!
Errors are quite unreadable if the width does not adapt to the font size.
it would be nice if the tip used the available space instead of wrapping at an arbitrary point in c# too
Same problem using rust's language server.
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.
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.
Is this something we can adjust with custom css? It makes snippet infoormation very difficult to read as well.
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...
And it is inconsistent. Ex, hover is OK
But completion list decides to wrap. What gives?
Looks like hover respects markdown while completion item doc is plain string and gets wrapped randomly.
Someone say long type signatures?
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)
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.
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;
}
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.
@roblourens (since you seem like the most relevant person to ping) is anything likely to be done about this?
@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?
@rebornix Will you take a look at this? In 3 days it will be a 2 year anniversary for this simple feature request.
Assigned to @joaomoreno and @misolori as I remember we are going to have some UX improvements for editor tooltips and so on.
@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
I employed @macintacos's CSS and put together full instructions:
Custom CSS and JS Loader extension
sudo chown -R $(whoami) /Applications/Visual Studio Code.app/Contents/MacOS/Electron
sudo chown -R $(whoami) /Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron
sudo chown -R $(whoami) /usr/share/code
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;
}
settings.json
{
"vscode_custom_css.imports": ["file:///Users/yourusername/.vscode-custom.css"],
"vscode_custom_css.policy": true
}
@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.
100% agree. This is just a workaround.
It's hard enough to read TypeScript lint as it is! :)
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.
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.
This change is related to #67076.
I confirmed that the max width of CompletionItem.documentation
is still small as mentioned above.
Update: in #69388, only the hovers for problems and the hovers with code blocks become to have larger width. Others have smaller width.
@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!
ć˛é¸żéŁ 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
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?
@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!
Seriously, I want instead of this:
At least something like this (with syntax highlighting it will be even better):
@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?
@jrieken fyi, it would be great if the hover could be resized like the suggest widget
How is this issue 4 years old and such a basic thing still isn't implemented?
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.
@jrieken might be very related and close to what you did here: https://github.com/microsoft/vscode/pull/109094
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)
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..
another possible view for this issue https://github.com/microsoft/vscode/issues/153984
It is 2022/11/11. Christmas is close and I made sure Santa knows what I want!
"Excuse me, it's 2023" đ
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.
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.
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.
@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.
@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?
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.