Open sean-mcmanus opened 2 years ago
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
@jrieken this does not have to be a new setting, but we could follow what editor.codeLensFontSize
is doing and by default be slightly smaller than the editor.
Have there been other requests like this, or have users mostly been happy about the font? Any other feedback that inlay hints gets easily confused with editor content?
Yeah, 90% like editor.codeLensFontSize
seems good to me (i.e. it's what the next version of our extension is setting editor.inlayHint.fontSize to: https://github.com/microsoft/vscode-cpptools/pull/9480). I don't know if it's desirable for all languages or not, but for C++ it can look like:
, so the smaller font size helps.
However, we're also adding a setting that moves the hint to the right side of the variable identifier, like TypeScript, so it's less confusing in that case.
Our extension's inlay hint feature is currently only shipping in our "pre-release" version and is off by default, so we've received very little feedback on it, i.e. so far bugs are mostly being found/reported by our own team. VS ships with a font that I consider too small (80%, size 11), and I don't know if they've received feedback on that (they're also off by default).
but we could follow what editor.codeLensFontSize is doing and by default be slightly smaller than the editor.
The difference with code lens is that inlay hints intermix with the code and that alignment is weird when font sizes change (for one line). The background color is meant to differentiate inlays from actual code - there has been feedback on making those colors "more different". There is also the editor.inlayHints.padding
-setting to inset inlay hints a little. Altogether there is editor.inlayHints.padding
, editor.inlayHints.fontFamily
, and editor.inlayHints.fontSize
I also want to point out that these are user-settings. @sean-mcmanus I think language specific styling-defaults (as pushed with https://github.com/microsoft/vscode-cpptools/pull/9480) aren't useful. Stylistic expectations, like font size or face, shouldn't be determined the language. Things aren't defined by c++ programmers vs rust or TS programmers but by folks that like small or large inlay hint text.
Sure, we've undone the change -- as mentioned previously the reason we wanted a different font for our language is that unlike TypeScript, we had our inlay hints on the left side so it looked like 2 types right next to each other and it was unclear if the hint was applying to the "auto" on the left or the identifier on the right (we also had padding bugs we fixed); however, our next release will put the "auto" inlay hints on the right side by default (i.e. looking like TypeScript), so it's less confusing that way.
Thanks. We have also created https://github.com/microsoft/vscode/issues/153889 to improve color contrasts
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
Being able to specify a font size relative to the main text size would be greatly appreciated - this could be in terms of
My own use case is being able de-emphasize inlays (type information) added by the rust-analyzer extension, to make them easier to ignore.
And yet, I'd love to make those inlays appear more visually distinctive, by having them rendered in italics style (there's probably also an issue for that).
So, for me: smaller (centered on the bounding box of the line) and "override font family to only add italics", please.
Das Leben ist ein Wunschkonzert, no?
The font size of inlay hints for VS 2022 is 80% of the editor font size, so our C++ extension would prefer a editor.inlayHint.defaultFontSizePercentage setting (or whatever alternative naming), so that our extension could set the default font size for inlay hints to be 80% of the editor.fontSize (for the [cpp] language only). Our current workaround is to set editor.inlayHint.fontSize to 11 for [cpp], but that potentially has the unwanted effect if the user changes their editor.fontSize away from 15.
The editor.codeLensFontSize appears to set the default to a hardcoded 90%.
UPDATE: The 11 font size seems slightly too small and it sounds like the VS UI is still in flux, so we may go with a 12 font or 90% instead, which would match the 90% for editor.codeLensFontSize -- so maybe we'd be satisfied if the existing editor.inlayHint.fontSize matched the 90% default like the editor.codeLensFontSize.