Skip to content

Ligatures are formed between inlay hints and code as well as between separate inlay hints #170449

@Veykril

Description

@Veykril

Does this issue occur when all extensions are disabled?: Yes (though an extension that introduces inlay hints is required)

  • VS Code Version: 1.74.11.74.2
  • OS Version: Windows_NT x64 10.0.19044

Steps to Reproduce:

  1. Create a new rust project with cargo new vscode-bug.
  2. Use a font for VSCode that has a ligature for &&, install rust-analyzer and set the "rust-analyzer.inlayHints.expressionAdjustmentHints.enable": "reborrow", config.
  3. Open the cargo project in VSCode and paste the following snippet into the main.rs file:
fn main() {
    &true == &true;
}

Watch how there is an & inlay hint inserted in front of both &true which merges with the leading &.

Actual result:
image
Note that in my theme, inlay hints are dimmed image but due to the ligature forming, the inlay hint looks like its part of the default code.

Expected result (behavior after we insert a ZWNJ into all inlay hint parts as a workaround apparently this can depend on the theme):
image

(Different themes are due to running the rust-analyzer fix in the debugger without a custom theme)

This also occurs for when two different inlay hints follow each other, as seen in rust-lang/rust-analyzer#13816

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginline-completionsinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions