Skip to content

Grey out conditionally compiled items in the editor when they don't match the current target profile #1966

Open
@minestarks

Description

@minestarks

In Q# we can use @Config attributes to mark a particular item as not being applicable to the current target.

@Config(Adaptive)
operation Foo() : Unit {
}

@Config(not Adaptive)
operation Foo() : Unit {
}

It would be nice to report the ranges for any of the code that is NOT included in the current compilation, to the editor, so that the editor can display them as grayed out.

VS Code does have support for this, but I'm not sure which property we need to set exactly. My guess is the Unnecessary DiagnosticTag (this is from LSP, but the VS Code equivalent should exist)

For reference, this is how Q# looks today in VS Code:

Image

Compare to how conditionally compiled out code looks in Rust in VS Code:

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions