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

[VSCode] Allow customisation of inlay hint styling #6405

Closed
matthewsanetra opened this issue Oct 29, 2020 · 8 comments
Closed

[VSCode] Allow customisation of inlay hint styling #6405

matthewsanetra opened this issue Oct 29, 2020 · 8 comments
Labels
A-inlay-hints inlay/inline hints A-vscode vscode plugin issues E-has-instructions Issue has some instructions and pointers to code to get started S-actionable Someone could pick this issue up and work on it right now

Comments

@matthewsanetra
Copy link
Contributor

I personally don't like the new smaller inlay hints, and I think it would be great to be able to customise it.

It was introduced here: #6394
Discussion of customising was held here: #6380

@staninprague
Copy link

If there are any options like Regular, Small, Smallest, I'd consider the current inlays being the "Smallest" - really hurts an eye in the reading glasses. Never thought I'll be crying out for some "accessibility".

@flodiebold flodiebold added A-vscode vscode plugin issues S-actionable Someone could pick this issue up and work on it right now labels Dec 21, 2020
@gdmachado
Copy link

would also be nice to be able to configure the font size directly, as well as color. I'd like to take a crack at this

@lnicola
Copy link
Member

lnicola commented Jul 10, 2021

Code might support these natively at some point, so we might throw away your work, though.

@SomeoneToIgnore
Copy link
Contributor

Also note, that this feature is 100% about VSCode plugin *.ts files in https://github.com/rust-analyzer/rust-analyzer/tree/master/editors/code directory, no *.rs files are expected to be changed in the PR closing this issue.

But in case you still want to do that, here's a very related PR that changed hint styles: #8617
that you can use as a base and maybe even replace the old font configuration with yours?

Anyway, you have to do something essentially similar: adjust editor related decorations' styles here

Also consider:

  • adding simple to adjust settings with good defaults (adjust extension's package.json directly)
  • VSCode-related performance implications: currently for our small-big hint style toggle we keep two separate collections otherwise the hint style update lags noticeably on the setting toggle.

@SomeoneToIgnore SomeoneToIgnore added the E-has-instructions Issue has some instructions and pointers to code to get started label Jul 10, 2021
@Veykril Veykril added the A-inlay-hints inlay/inline hints label Dec 17, 2021
@ian-h-chamberlain
Copy link
Contributor

With the changes of #11445 is this no longer an issue? I came looking to see if anyone had tips for customizing inlay hints but ended up just finding them myself... leaving this here in case others come looking, these are the various VSCode settings I have found related to inlay hint styling:

  • editor.inlayHints.enabled
  • editor.inlayHints.fontFamily
  • editor.inlayHints.fontSize
  • workbench.colorCustomizations (these appear to support RGBA colors like #00000000 if you want e.g. transparent background)
    • editorInlayHint.background
    • editorInlayHint.foreground
    • editorInlayHint.parameterBackground
    • editorInlayHint.parameterForeground
    • editorInlayHint.typeBackground
    • editorInlayHint.typeForeground

I think this means this issue can be closed, but perhaps is helpful for others looking for the settings to customize their hints as they wish. Maybe there could be a documentation change that could point people to the right settings that would be a little more discoverable?

@lnicola
Copy link
Member

lnicola commented Mar 14, 2022

@ian-h-chamberlain good summary. Do you want to file a PR to the manual (it's in this repository, under docs/user)?

@ian-h-chamberlain
Copy link
Contributor

@ian-h-chamberlain good summary. Do you want to file a PR to the manual (it's in this repository, under docs/user)?

Sure, I'll see if I have some time to do this soon

@Veykril
Copy link
Member

Veykril commented Mar 15, 2022

We have changed to the native inlay hints of VSCode, changing font and font size is now possible via editor.inlayHints.fontSize and editor.inlayHints.font respectively.

@Veykril Veykril closed this as completed Mar 15, 2022
bors bot added a commit that referenced this issue Mar 15, 2022
11708: Update manual for inlay hint customization r=Veykril a=ian-h-chamberlain

Related to #6405, #6883 but not sure if they should be closed or not as this is just a documentation update.

This functionality was changed as of #11445 and now can be customized using native VSCode settings instead of `rust-analyzer`-specific ones.

Co-authored-by: Ian Chamberlain <ian-h-chamberlain@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inlay-hints inlay/inline hints A-vscode vscode plugin issues E-has-instructions Issue has some instructions and pointers to code to get started S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

8 participants