-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Make debugger respect "files.exclude" or introduce a hiding mechanic #3215
Comments
yaah, as I mentioned in #3260 there is an additional inconvenience: the recently opened list gets cluttered with a ton of unwanted files... |
The individual feature requests for node-debug and node-debug2 are: |
As for the syntax of the new attribute I suggest to use the same glob pattern approach as for @Spown @roblourens do you have better ideas for a good name? |
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 |
This is really important, |
@Eli-Goldberg it will be pretty simple to include exceptions in this option as well. We could even make this the default. |
My short list is now: @Spown @roblourens @isidorn @Eli-Goldberg opinons? |
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 |
There is precedent for 'blackbox' in Chrome devtools, but How does this transfer to other strings? "Skip this file" to mark as "skipped". Stack frames show "skipped code" on frames that are skipped. In Chrome/Node's implementation, this includes exceptions as well, so it will work that way for our extensions. |
@roblourens what is the exact behaviour of this feature with CDP?
|
maybe |
|
And I should mention the caveat that if a blackboxed script throws an exception immediately when it's loaded, and the script is eval'ed or blackboxed by its sourcemapped source's name, then the blackboxing "probably" won't apply, as the debug adapter has to blackbox it by ID after it's loaded. This is Chrome Devtools' behavior as well. |
@roblourens I've implemented this for node-debug and created a Test plan item. |
@weinand thank you so much ! |
@Spown since this issue has been promoted to the VS Code November plan, let's @roblourens close it. |
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 |
IMHO, the most common use case would be a negative glob on node_modules, unless the source isnt in the root (src folder). |
You mean if someone wants to add |
Yes, like having one lib throwing endless exceptions, and the other vital information. |
ahm... but wouldn't |
No, from the test item above,
So I would be skipping everything in node_modules except things that match the negative patterns. |
and what if you have |
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 |
Closing this, microsoft/vscode-chrome-debug-core#135 is still pending |
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 likeQ, mongoose, lodash
are relyible enough to not spend half of my time on clickfestingstep 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 thatfiles.exclude
belongs to project settings, while everything debugger-related is controlled vialounch.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 thelounch.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:Also I think there should be a way to make the debugger ignore
core modules
either through a dedicated option or through afiles.exclude
key with a path-forbidden character, like"?core_module": true
or something.Thank you.
The text was updated successfully, but these errors were encountered: