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] Feature request: allow modifyable font size for type hints #6883

Closed
SKyletoft opened this issue Dec 14, 2020 · 5 comments
Closed

[VSCode] Feature request: allow modifyable font size for type hints #6883

SKyletoft opened this issue Dec 14, 2020 · 5 comments
Labels
A-inlay-hints inlay/inline hints A-vscode vscode plugin issues S-actionable Someone could pick this issue up and work on it right now

Comments

@SKyletoft
Copy link

Currently type hints/annotations are in a slightly smaller size than regular text. The setting for this is seemingly fixed at 2 (?) sizes smaller than the Editor: Font Size (editor.fontSize) setting in VSC settings. This leads to the following text being slightly offset from lines above and below, as can be seen in the screenshot. Please let us detach the sizes or have an option for how different they can be.

image

@kjeremy
Copy link
Contributor

kjeremy commented Dec 15, 2020

The reason it is smaller is that it stands out more from the surrounding text to give the user the hint that it has been placed there by the editor. This is a convention in both IntelliJ and Visual Studio.

That said if you would like to change it the relevant code is here:

https://github.com/rust-analyzer/rust-analyzer/blob/39aae835fd70d06092c1be1add6eef3984439529/editors/code/src/inlay_hints.ts#L64

@flodiebold flodiebold added the A-vscode vscode plugin issues label Dec 15, 2020
@SKyletoft
Copy link
Author

But IntelliJ adds padding so that it still conforms to the spacing of the normal font, does it not?

@kjeremy
Copy link
Contributor

kjeremy commented Dec 16, 2020

Ahh... Maybe! PRs welcome!

@lnicola lnicola added the S-actionable Someone could pick this issue up and work on it right now label Dec 20, 2020
@atombender
Copy link

atombender commented Jan 2, 2021

Is there a workaround to change the decoration (e.g. some local CSS change I can make to VSCode) until the extension has been corrected?

bors bot added a commit that referenced this issue Apr 27, 2021
8617: Add option to opt out of smaller font size for inlay hints. r=SomeoneToIgnore a=jmederosalvarado

As requested on issue #6883 this PR provides an option for users to opt out of the smaller font size for inlay hints. Part of #6883.

Co-authored-by: Jorge Mederos Alvarado <jmederosalvarado@gmail.com>
@Veykril Veykril added the A-inlay-hints inlay/inline hints label Dec 17, 2021
ian-h-chamberlain added a commit to ian-h-chamberlain/rust-analyzer that referenced this issue Mar 14, 2022
Closes rust-lang#6883 

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

Veykril commented Mar 15, 2022

With the change to native inlay hints, this is now doable via editor.inlayHints.fontSize

@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>
HKalbasi pushed a commit to HKalbasi/rust-analyzer that referenced this issue Mar 17, 2022
Closes rust-lang#6883 

This functionality was changed as of rust-lang#11445 and now can be customized using native VSCode settings instead of `rust-analyzer`-specific ones.
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 S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

6 participants