You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make debugger respect "files.exclude" or introduce a hiding mechanic #3215
Currently the debugger doesn't seem to care for settings.json:files.exclude. For example if I exclude **\node_modules (I assume that 99% of all errors are caused by me and things like Q, mongoose, lodash are relyible enough to not spend half of my time on clickfesting step out of these files) - the folder gets removed from the navigator, but when I traverse through breakpoints in the debugger - the node_modules files are still shown (not in the navigation column, but in the editor). I understand that files.exclude belongs to project settings, while everything debugger-related is controlled via lounch.json. These are 2 completely different entities or workflow layers that in theory shouldn't ever collide. So I guess there should be a separate config option in the lounch.json for debugger to silently jump over the excluded files. Like the --hidden flag in https://www.npmjs.com/package/node-inspector. Optionally, if so - there should be a level of control over the hiding for unhandled Exceptions:
"files.exclude": {"**/my_modules": false//always shown,"**/libs": true//always hidden,"**/node_modules": "normal"// jumps over the file if there is no breakpoint or unhandled ,"**/trusted_node_modules": ["normal","exception"]// jumps over the file if there is no breakpoint, or any other stopper except for the defined ones}
Also I think there should be a way to make the debugger ignore core modules either through a dedicated option or through a files.exclude key with a path-forbidden character, like "?core_module": true or something.
Thank you.
Reacted by Itay Shakury, Nicolò Ribaudo, Eli Golderg and Morten Christensen
As for the syntax of the new attribute I suggest to use the same glob pattern approach as for outFiles. The name of the attribute could be blackboxFiles or blackboxCode. I don't like libraryCode because it tags code as 'library code' but that doesn't reveal what it really means.
Concerning the name however if I didn't know what this option would do I would think of something completely different if it would be called blackbox*. Frankly I probably wouldn't be able to make sense out of it because blackbox in my book is tightly linked with some input and output values. So I would think it somehow connected to variable inspection. I mean it's not like it is illogical, just not straightforward intuitive. Maybe something like bypass* or skip* or something like that. Also I don't like library*as well, but since it is already in use maybe introduce them as alias?..
This is really important,
what most bothers me personally is the lack of ability to make the debugger ignore exceptions in certain paths (like Q throwing random exceptions).
Great! I didn't implement negative patterns for the glob though. I convert these to regexes and pass them to Chrome. Is there a general-purpose way to write a regex that says "matches A and does not match B"?
well, kinda... But you have to perfirm additional checks on the both negative and positive subpatterns so that they don't collide. Checking that they do not match is easy, but that the negative is partially overlaps with the positive is hard. if not impossible... Don't take my word though, that's just from the top of my head. I think normally this type of problems are devided in steps rather than encapsulated in one general purpose pattern.
Ok I see how I can do that using "negative lookahead". I'm inclined to print a warning if someone passes a ! glob, and ignore them, until someone complains. I don't know that I would need that level of precision in skipFiles.
IMHO, the most common use case would be a negative glob on node_modules, unless the source isnt in the root (src folder).
But if that would cause the feature to delay, the warning suggestion is probably the best one.
ahm... but wouldn't "!node_modules/thingToAllowDebugging" mean "skip everything except node_modules/thingToAllowDebugging"? like absolutely everything?..
and what if you have "skipFiles": ["foo/**/*", "!bar/**/baz.js"]? If you always substract all negative patterns from all positive - that would work. but this would also mean people would think they could do "skipFiles": ["!my_code/**/*"] - in this case without any positive patterns it wouldn't do anything.
Yes, I've investigated this issue across various npm modules that support multiple glob patterns (or the exclude/include logic), and all of them use a model where an initial include patterns is required before exclude patterns can be applied on top of that. So just using a sole "!node_modules/thingToAllowDebugging" with various node modules results in an empty set.
Activity
Spown commentedon Feb 22, 2016
yaah, as I mentioned in #3260 there is an additional inconvenience: the recently opened list gets cluttered with a ton of unwanted files...
weinand commentedon Nov 22, 2016
The individual feature requests for node-debug and node-debug2 are:
microsoft/vscode-node-debug#16 and microsoft/vscode-chrome-debug-core#7
weinand commentedon Nov 22, 2016
As for the syntax of the new attribute I suggest to use the same glob pattern approach as for
outFiles. The name of the attribute could beblackboxFilesorblackboxCode. I don't likelibraryCodebecause it tags code as 'library code' but that doesn't reveal what it really means.Spown roblourens do you have better ideas for a good name?
Spown commentedon Nov 22, 2016
Glob pattern is obvious.
Concerning the name however if I didn't know what this option would do I would think of something completely different if it would be called
blackbox*. Frankly I probably wouldn't be able to make sense out of it because blackbox in my book is tightly linked with some input and output values. So I would think it somehow connected to variable inspection. I mean it's not like it is illogical, just not straightforward intuitive. Maybe something likebypass*orskip*or something like that. Also I don't likelibrary*as well, but since it is already in use maybe introduce them as alias?..Eli-Goldberg commentedon Nov 23, 2016
This is really important,
what most bothers me personally is the lack of ability to make the debugger ignore exceptions in certain paths (like Q throwing random exceptions).
weinand commentedon Nov 23, 2016
Eli Golderg (@Eli-Goldberg) it will be pretty simple to include exceptions in this option as well. We could even make this the default.
weinand commentedon Nov 23, 2016
My short list is now:
hideFiles,skipFiles(because both align nicely with the existingoutFiles).Spown roblourens Isidor Nikolic (@isidorn) Eli Golderg (@Eli-Goldberg) opinons?
isidorn commentedon Nov 23, 2016
skip sounds better than hide imho, since the user can still navigate to them (thus they are not hidden). But they get skipped when stepping
10 remaining items
weinand commentedon Nov 29, 2016
Spown since this issue has been promoted to the VS Code November plan, let's roblourens close it.
roblourens commentedon Nov 29, 2016
Great! I didn't implement negative patterns for the glob though. I convert these to regexes and pass them to Chrome. Is there a general-purpose way to write a regex that says "matches A and does not match B"?
Spown commentedon Nov 29, 2016
well, kinda... But you have to perfirm additional checks on the both negative and positive subpatterns so that they don't collide. Checking that they do not match is easy, but that the negative is partially overlaps with the positive is hard. if not impossible... Don't take my word though, that's just from the top of my head. I think normally this type of problems are devided in steps rather than encapsulated in one general purpose pattern.
roblourens commentedon Nov 29, 2016
Ok I see how I can do that using "negative lookahead". I'm inclined to print a warning if someone passes a
!glob, and ignore them, until someone complains. I don't know that I would need that level of precision in skipFiles.Eli-Goldberg commentedon Nov 30, 2016
IMHO, the most common use case would be a negative glob on node_modules, unless the source isnt in the root (src folder).
But if that would cause the feature to delay, the warning suggestion is probably the best one.
roblourens commentedon Nov 30, 2016
You mean if someone wants to add
"skipFiles": ["node_modules", "!node_modules/thingToAllowDebugging"]? I can see that.Eli-Goldberg commentedon Nov 30, 2016
Yes, like having one lib throwing endless exceptions, and the other vital information.
Spown commentedon Nov 30, 2016
ahm... but wouldn't
"!node_modules/thingToAllowDebugging"mean "skip everything except node_modules/thingToAllowDebugging"? like absolutely everything?..roblourens commentedon Nov 30, 2016
No, from the test item above,
So I would be skipping everything in node_modules except things that match the negative patterns.
Spown commentedon Nov 30, 2016
and what if you have
"skipFiles": ["foo/**/*", "!bar/**/baz.js"]? If you always substract all negative patterns from all positive - that would work. but this would also mean people would think they could do"skipFiles": ["!my_code/**/*"]- in this case without any positive patterns it wouldn't do anything.weinand commentedon Nov 30, 2016
Yes, I've investigated this issue across various npm modules that support multiple glob patterns (or the exclude/include logic), and all of them use a model where an initial include patterns is required before exclude patterns can be applied on top of that. So just using a sole
"!node_modules/thingToAllowDebugging"with various node modules results in an empty set.roblourens commentedon Dec 5, 2016
Closing this, microsoft/vscode-chrome-debug-core#135 is still pending