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

offering When Clause context for snippet activation #211980

Open
adhamfarrag opened this issue May 3, 2024 · 2 comments
Open

offering When Clause context for snippet activation #211980

adhamfarrag opened this issue May 3, 2024 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality snippets
Milestone

Comments

@adhamfarrag
Copy link

adhamfarrag commented May 3, 2024

I'd like to have when clause for snippets. This can he useful in these contexts:

  • Some frameworks/languages offer snippets that change from one version to the other. And no need to release extensions for each version.
  • Some extensions do not just offer snippets, and in this case Snippets can still work even when the extension is deactivated.
  • Programmatically injected snippets do not work for embedded languages. Offering that can be a solution too.

Workaround for this issue can be enabling/disabling snippets by moving files from VSCode Extension directory to another path. But this requires users to refresh it, so doing it programmatically doesn't really work unless users want to enable/disable them.

 {
  "when": "language.versionFour",
  "language": "html",
  "path": "./snippets/lang/components.json"
 },
@jrieken jrieken added feature-request Request for new features or functionality snippets labels May 6, 2024
@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone May 6, 2024
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@VSCodeTriageBot
Copy link
Collaborator

🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

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

No branches or pull requests

3 participants