Has anyone found a way to create toggles for snippet files in their vscode extension project?

28 Views Asked by At

I am creating a vscode extension, and I want to toggle the usage of different snippet files within my package.json. The reason being, each snippet file in the project has a different scope of use for the users. Is there a way to toggle the usage of certain snippet files via the extension settings page, or any other work arounds that yall might have thought of?

I have a toggle already added to the vscode extension settings page, but it has no functionality attached to it. I am yet to find a solution

1

There are 1 best solutions below

0
boocs On

In your extension you can rename the snippet files based on your needs.

I tested this. Created a test.code-snippets and test2.code-snippets in my project's .vscode directory.

Both file's snippets showed up.

If I rename the file extensions to test.ode-snippets and test2.ode-snippets then none of the snippets show up.

This works without reloading/restarting VSCode.