Skip to content

Inlay hints for compilation conditions #1732

@MahdiBM

Description

@MahdiBM

Is your feature request related to a problem? Please describe.
Add a setting to show inlay hints at the end of compilation conditions.
Basically like Xcode has recently added.

Apparently Xcode tries to be smart and doesn't show the hint in certain situations if it thinks it would be obvious, but I kind of like the behavior to be consistent and show it at all times.

I'd also like to have a button or something to be able to jump to the definition site. Maybe also the text should mention the line number of the definition site, or maybe a visual way to indicate from start to end of a compilation condition code branch.

We also need to consider what would be shown for #else branches ... Xcode simply shows nothing.

VSCode:

Image

Xcode:

Image

Xcode wouldn't show the inlay hint if the situation was exactly the same as the VSCode image, meaning when the whole condition contained only 2 lines.

Describe alternatives you've considered
Manually using comments at the end of each condition.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions