Delete a specific Intellisense suggestion in VS Code
Asked Answered
Q

2

16

Intellisense sometimes comes up with irrelevant suggestions that I will never use in my project. Those can get in the way of the valuable other suggestions.

They also prevent VS Code features like "Add all missing imports" from working.

For example:

enter image description here

The first DocumentType is a low-level module that I will never use. The second is one that I need in most of my files.

So how can I get rid of the first one?

Quipster answered 22/9, 2019 at 13:8 Comment(2)
The 2nd link isn't really related because it's for Visual Studio, which is a completely different IDE than Visual Studio Code (despite the name).Fantoccini
Maybe try #57917441 if you are using javascript or typescript (tsconfig then).Boston
P
5

You cannot disable specific IntelliSense completion options, however, there are a few other relevant caveats.

Answer to not your question: You can filter whole classes of keywords with the editor setting editor.suggest.filteredTypes. See more about this here.

IntelliSense does not allow you to configure or filter specific keywords. The list of all IntelliSense options is here. It also appears this is impossible with other major options. For example, the language server protocol does not support this(GitHub thread abt this). That being said, there is a plethora of autocomplete extensions and I'm certain this feature exists for some.

Something like intellicode might also be an answer, as it will look through other files you've edited to try to learn your practices.

If you're 100% sold on IntelliSense, and you're willing to sink several hours into this, you could set up a discrete language server, and then use something like this to filter completions as they are sent to the editor. While this would work, I think it's a terrible idea.

Preservative answered 11/3, 2021 at 15:59 Comment(0)
B
1

After spending several hours with no satisfying result, I created my own IntelliSense snippets. I used another keyword to make sure, it will show on top.

I used the Easy Snippet plugin for this.

Belding answered 27/7, 2022 at 6:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.