-
-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore VS Code default exclusions #38
Comments
Actually, my bad, I think |
Okay, thanks. FYI, I use this extension with Node apps all the time and never get hits from In the meantime, if there is a public repository you can point me to that reproduces the problem, I would be happy to have a look. Thank you! |
Maybe this is a problem with my Code then, I'll try to repro without extensions and put up a repro if I can get it. |
This is probably an issue with my setup somehow. I was not at all able to discern how, but it must be. I will continue trying to figure this out in the linked issue and am closing this one as it doesn't appear to be a problem with this (awesome, BTW) extension, but general glob filtering in my VS Code installation. |
Ok, thanks, good luck! :) |
Am I possibly hitting the same issue as @TomasHubelbauer? I get thousands of errors if I open any Markdown file and press The Ctrl+T operation takes relatively long and I get about 9 thousand markdownlint errors in our monorepo, with many hits from |
I ended up having to do this hack: The default exclusions just didn't work for me and I wasn't sure it was my setup or a general problem but to have a little more control (and be in line with what I consider to be a more reasonable behavior, I just copy paste the above code to all my extensions. This is still open as a feature request from me to make the |
Thanks, Tomas. And do you understand why doing Ctrl+T would kick in markdownlint on all MD files in my workspace? |
I think Ctrl+T is dogfed by the extension APIs which don't seem to use the right excludes (I may be totally wrong on this) and as a result you are seeing this behavor. I think you can "fix it" by adding |
Thanks. I still don't understand why Ctrl+T would start markdownlint-ing anything to be honest, seems like two unrelated things to me. |
That's probably because the symbol search runs the symbol-thingy provider API for all documents in the scope of the workspace (so even the incorrectly not-ignored ones) and as a result of these API invocations/documents being open (even if editors are not shown), hooks in MarkDown lint kick in and run the diagnostics provider so you see stuff in the Problems pane. But I am only speculating here, I didn't look into it further, the reason I'm sharing this is that I think your experience shares the root of the issue with my original problem. |
BTW, in my case, It is less clear to me whether VSCode should treat various MD headings in So maybe there might be two small issues here?
|
Sorry for the trouble, I’m not sure why you are hitting this but others (like me) are not. The markdownlint extension will lint any file that gets opened by VS Code and claims to be a Markdown file. My current guess is that one of your other extensions or maybe VS Code itself is deciding to open everything in node_modules? Regardless, markdownlint can now ignore files and directories and that should help here. If you add |
Note: I typed that glob on my phone, it may need tweaking to work for real. |
I'm trying to reproduce on a small example repo and everything behaves correctly. I also have two larger repos where I can reproduce.. As usual :) Thanks @DavidAnson for trying to help! |
Oh, I was wrong! I thought that most of the invalid hits are in How does the default ignore behavior look like, please? What would make Markdown files in Here are our workspace settings:
Is .gitignore considered somehow? Our root .gitignore is just:
There is just
Does this possibly matter? |
Could you maybe create a small repo that shows the problem and I will clone it and have a look? There is still a lot going on above that I’d like to filter out. :) |
Could this option be relevant? |
v1 published: https://github.com/borekb/markdownlint-vendor-demo |
My plan:
Good plan or a waste of time? :) |
I won’t have time to look till this evening. Anything you do between now and then is pure goodness in my book. :) |
Feature request: Can you please put some files in place so I don’t need to run Composer or Docker? |
I could but then it eliminates the option that it could be caused by |
Just a couple files. Keep it simple, please! |
And this is where I stop understanding it. I have copied both settings to my user settings and added vendor: but I'm still getting hits from and it is checked by linter while Ok, I'm giving up for tonight :) Hopefully you'll be able to make better sense of this than me. |
Looking at VS Code on my machine, I see the following behavior (always re-open the folder when testing). Prevents linting *.md from vendor directory, but hides directory in explorer:
Does not exclude *.md from vendor directory:
Also does not exclude:
Which brings me back to suggesting Prevents linting *.md from vendor directory, no effect on explorer, no effect on
Code-wise, I confirm that VS Code's handling of I can't yet see a way to tell the
|
Thanks, great research! Do you have any idea why Markdown files in |
@TomasHubelbauer Is your extension impacted similarly? I tried to install it and it reports missing links in various unopened Markdown files. |
FYI, I think VS Code does have special knowledge and handling. I spent a couple of minutes yesterday and found these things that may be relevant: |
More FYI, @chrmarti kindly opened an issue for VS Code to look into this: microsoft/vscode#50874 What we’re seeing may not be entirely expected. |
Hey, I notice that
createFileSystemWatcher
does not allow for inserting the list of default VS Code exclusions unlike for examplefindFiles
with itsexclude
argument you can set toundefined
to make it use the default built-in excludes. That means currently this extension reports errors from evennode_modules
and such and in my case that blows some of my projects up to thousands of errors. You might want to consider trying to somehow extract this exclusion list from VS Code and adjusting your glob (either statically or even better dynamically based on the exclusion list) to ignore these.The text was updated successfully, but these errors were encountered: