Open alexis- opened 3 years ago
The relevant code is in this lib: https://github.com/kortina/vscode-markdown-notes/blob/master/src/findNonIgnoredFiles.ts
Which I basically found all of the code for in this vscode issue: https://github.com/microsoft/vscode/issues/48674
Help appreciated on this one, as I'm not sure when I'll get around to it.
I was able to duplicate on macos, and I found more detail on the error by opening Log (Extension Host) in the Output Panel:
[2021-04-09 15:24:33.724] [exthost] [error] [kortina.vscode-markdown-notes] provider FAILED
[2021-04-09 15:24:33.724] [exthost] [error] Error: command failed with error code 2: error parsing glob '!/{**/node_modules,**/bower_components,**/*.code-search,**.{doc,docx},**/.git,**/.svn,**/.hg,**/CVS,**/.DS_Store}': nested alternate groups are not allowed
workaround
I was able to workaround by modifying search.exclude
as follows:
"search.exclude": {
"**.doc": true,
"**.docx": true,
},
which I believe is equivalent, just more verbose.
Hello Kortina,
I only had a cursory glance at the code you sent, please take my remarks with a grain of salt.
In your screenshot we can see the "alternate group" **.{doc.docs}
is nested within a larger one. The compilers gives off the error:
nested alternate groups are not allowed.
See my 2 comments in the code excerpt:
const exclude = [
// >> The next line includes **.{doc,docx} in the array
...Object.keys((await workspace.getConfiguration('search', null).get('exclude')) || {}),
...Object.keys((await workspace.getConfiguration('files', null).get('exclude')) || {}),
].join(',');
// >> The array containing **.{doc,docx} is nested within another alternate group {... ,**.{doc,docx}, ...}
const uris = await workspace.findFiles(pattern, `{${exclude}}`);
if (!checkGitIgnore) {
return uris;
}
As far as I understand, search.exclude
is only intended to exclude files from the search results (Ctrl+Shift+F, or search in the left panel).
Unless I am missing something, it seems like for MD Notes you'd only want to consider files.exclude
.
which I believe is equivalent, just more verbose.
That's the solution I've been using and it works well.
Hello,
Describe the bug While setting up your extension (great job!), I found out that using group notations such as
**.{docs,pdf}
insearch.exclude
breaks auto-suggestions.Hypothetically, the same could be true with
files.exclude
, although I haven't tested that option.To Reproduce
D:\Alexis\
D:\Alexis\**.md
vscodeMarkdownNotes.workspaceFilenameConvention
setting: Same behaviour with bothSteps to reproduce the behavior:
settings
:Expected behavior Suggestions
Versions