Warm tip: This article is reproduced from serverfault.com, please click

Set .history folder as ignored by intellisense

发布于 2017-06-12 08:02:08

I need to ignore .history folder from intellisense.
Now it looks like this when I start typing Focus:

enter image description here

As you can see intellisense will offer me every Identical class found in .history folder and this is very very confusing (and find correct one).

I try find something in vscode settings, and on editor site but no success.

.history folder is ignored from git, display in explorer, and tslint:

"files.exclude": {
    "**/.history": true ...
},
"files.watcherExclude": {
    "**/.history/**": true ...
},
"tslint.exclude": ["**/.history/**"] ...

How to achieve ignore .history from intellisense?


Next part is based on the answer from Matt

An important assumption:

Visual Studio Code itself does not contain automatic import and you need an extension for it.

Solution:

I am using extension Auto Import (steoates.autoimport) which contains the setting autoimport.filesToScan. I changed default value from "**/*.{ts,tsx}" to "{src,e2e,node_modules}/**/*.{ts,tsx}" and now everything work as I expected.

Questioner
Atiris
Viewed
0
Matt Bierner 2017-06-14 08:03:30

Those suggestions are coming whatever extension you have installed that is providing auto-import functionality. Please check to see if that extension has its own exclude setting that you also need to configure