Skip to content

Truncate long inlay hints #199610

@mjbvz

Description

@mjbvz

Problem

See microsoft/TypeScript#56541

TypeScript's inlay hints can be rather long. Previously we truncate these inlay hints at 30 characters. However we disabled this truncation when adding support for interactive inlay hints

While discussing this problem with the TS team, we realized that it would likely make more sense for VS Code to control the truncation instead of leaving it up to individual languages/extensions. That way the user experience is more consistent and an extension can't break us by sending extremely long inlay hints

The Rust extension also currently has logic to truncate their inlay hints

Proposal

Add a default length limit to inlay hints. We could also add a setting that let's users control this limit

In addition, perhaps we can provide a way to view the full hint if you really want to. Either showing it in on hover or in a tooltip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions