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

Feature Request: enablement property on MessageItems and QuickPickItems #179023

Open
nturinski opened this issue Apr 3, 2023 · 2 comments
Open
Assignees
Labels
api feature-request Request for new features or functionality quick-pick Quick-pick widget issues
Milestone

Comments

@nturinski
Copy link
Member

nturinski commented Apr 3, 2023

Because our extensions are supporting multiple environments, it would be nice to have an enablement property on the vscode.MessageItem and vscode.QuickPickItem objects. Similar to context commands, it would be great if they could be grayed out and disabled.

Examples of enablement would be isWeb, isVirtualEnvironment, any condtional statement, etc.

The package.json has this implementation when you define the commands in the manifest. It would be perfect if that behavior could be duplicated because as of now, our extensions have to hide quick pick items that don't work in a web environment, but that can get confusing for users when options that were available in desktop suddenly disappear.

@TylerLeonhardt
Copy link
Member

I think this makes sense. I can't promise when it will actually come in, though PRs always welcome.

As a workaround, you can use vscode.window.createQuickPick() and then put all this disabled items under a quick pick separator called like "not available"... and then in your qp.onDidAccept handler you could just no-op for those items underneath that separator.

@TylerLeonhardt TylerLeonhardt added feature-request Request for new features or functionality api quick-pick Quick-pick widget issues labels Apr 3, 2023
@TylerLeonhardt TylerLeonhardt added this to the Backlog milestone Apr 3, 2023
@nturinski
Copy link
Member Author

Thanks, that's a clever workaround that I'll use in the meantime! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality quick-pick Quick-pick widget issues
Projects
None yet
Development

No branches or pull requests

2 participants