Skip to content

Inlay hints inherit style of tokens they are attached to #3207

@Veetaha

Description

@Veetaha

From the following example you can see that reparsed_len hint is displayed bold, though other hints are of normal weight.
image

This is because the corresponding parameter value is integer literal 3 and I have a custom TextMate rule that makes constants bold, but with this, the parameter hint is also displayed bold.
The fix to this would be to force all hints to have normal font weight on the following lines of code:
https://github.com/rust-analyzer/rust-analyzer/blob/326556b09078a398e641dd221ab870ee0fe47f68/editors/code/src/inlay_hints.ts#L51-L61

There is a dedicated fontWeight option you can pass to these functions.
But the issue is a bit more general, users can have arbitrary TextMate rules and inlay hints will inherit them according to the token they are attached to, but I don't see a good general solution here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions