Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
minestarks opened this issue Oct 16, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers language server

Comments

@minestarks
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers language server
Projects
None yet
Development

No branches or pull requests

2 participants