Ev0oD
Ev0oD

Reputation: 1861

How to remove IntelliSense suggested snippets introduced by extension (or built-in)

Normally, I want to see suggested IntelliSense snippets when typing and this works nicely. However, some extensions I installed introduce a lot of snippets I will never use and they bloat the IntelliSense suggested list.

I found no way so far to remove/disable snippets coming from an extension. Is there a way to do this?

Upvotes: 6

Views: 6445

Answers (5)

snnsnn
snnsnn

Reputation: 13620

I already add this answer to another question but since it is relevant, I will add here too.

You don't need any workarounds, there is a built-in way to disable a built-in snippet.

  1. Open a file that has the same file type as the one you would like to disable a built-in snippet to. This step is required because available snippets are listed based on file type.
  2. Bring up the command palette by pressing Ctrl+Shift+P or by clicking view > Command Palette on the application menu.
  3. Execute "Insert Snippet" command
  4. You can scroll down to locate the snippet you would like to disable, or use the search box.
  5. Hover over the item and you will see "Hide from Intellisense" icon
  6. Clik the icon.

Disable a built-in snippet

Currently you can not disable user-defined snippets, snippets you have added yourself. You have to remove or comment out them in your related snippets file.

Upvotes: 2

user16903071
user16903071

Reputation: 61

To remove all suggestion use "editor.snippetSuggestions": "none" in the settings.json

Upvotes: 6

Ev0oD
Ev0oD

Reputation: 1861

Alright, found a way to do this.

  1. Go to the folder where your extensions are installed for vscode.
  2. Find the folder for extension that adds the snippets (if you are not sure which one does it, peek the snippet in IntelliSense suggest list - the description will have the extension name in parenthesis at the end, some snippets are from built-in extensions).
  3. Rename snippets.json to _snippets.json, or just modify the file to contain only snippets you are interested in.
  4. Disable extension, reload vs code, enable the extension.

Upvotes: 3

Mark
Mark

Reputation: 180885

Coming in v1.52 is the ability to disable snippets, see https://github.com/microsoft/vscode/issues/10565#issuecomment-721832613. But you have to do it on a per-snippet basis which could be helpful if you just wanted to disable seeing certain snippets. The snippets won't show in the intellisense suggestions but can still be accessed through the Command Palette/Insert Snippet command.

Which is also where you go to remove them from appearing in the suggestions.

snippet ignore demo

Upvotes: 12

tHeSiD
tHeSiD

Reputation: 5333

There is no direct way to do this in VSCode unless the extension provides you an option to disable the snippets from it. However, I use an extension to manage all the snippet sets that are active in a workspace.

Control Snippets is the extension.

Control Snippets Manager for VSCode

Upvotes: 5

Related Questions