Closed mikeseese closed 1 year ago
Sounds like a useful feature, but if I read this correctly it's not just ignoring things in folders named "Saved" by default, but also any files that have "Saved" in the filename. Could you change the pattern so it only ignores folders literally named that?
Turns out ignore: ["Saved"]
only ignores files in the root directory named Saved
exactly (not just part of the name). To ignore wildcard directories, it would need to be ignore: ["**/Saved/**/*"]
. It's a glob pattern that is compared against the full file path rather than individual file/folder names like a .gitignore does. I verified this with a test script:
here it is with ["**/Saved/**/*"]
const glob = require("glob");
glob("test/**/*.as", { ignore: ["**/Saved/**/*"]}, (err, files) => {
console.log(files);
});
$ node test.js
[ 'test/1.as', 'test/2Saved.as', 'test/Saved.as' ]
here it is with just ["Saved"]
:
$ node test.js
[ 'test/1.as', 'test/2Saved.as', 'test/Saved.as', 'test/Saved/3.as' ]
Though it seems it can be shortened down to ["**/Saved/**"]
(also tested this by adding a test/Saved/test/4.as
file which was also ignored):
$ node test.js
[ 'test/1.as', 'test/2Saved.as', 'test/Saved.as' ]
Looks good 👍 Thanks for the pull requests!
This PR adds a setting to ignore an array of glob patterns to prevent picking up duplicate files. For example, when I try to "Go to Definition" sometimes the language server will bring me to
Saved/StagedBuilds/.../File.as
,.plastic/fileCache/.../File.as
(the VSCode extension for PlasticSCM uses this directory to enable file diffs in VSCode), orbuilds/.../File.as
(which is where I put packaged builds). I addedSaved
and.plastic
as defaults as are not specific to me; happy to change as you see fit.