qdk icon indicating copy to clipboard operation
qdk copied to clipboard

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

Open minestarks opened this issue 1 year ago • 0 comments

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

minestarks avatar Oct 16 '24 21:10 minestarks