-
Notifications
You must be signed in to change notification settings - Fork 68
Excluding files from being debugged #997
Comments
Was this ever supported? |
Yes it was |
@int19h I don't see |
Yes, that was a 3.x thing, and it was never intended to be a public API. If we need this, we should do it right - i.e. expose some opaque functions to register such files. |
Can we increase the priority of this issue, thanks. |
This is important for VS Code so adding back P1 |
I'll take a look at this. The suggestion is being able to configure through the launch config:
Some notes:
Does that sound reasonable? Is a Python API required too? |
That sound good. We will need python API as well. |
My understanding at this time is that we only need the python API at this time. We have another proposal for more specific include/exclude rules here: Copying:
If you want to go ahead and implement the includePaths/excludePaths part of the proposal you are welcome to! /cc @DonJayamanne |
@karthiknadig @qubitron The Python VSC Extension will not need the python api. Here's what I propose: {
"name": "AttachLaunch",
"type": "python",
"request": "attach|launch",
"excludePaths": ["*bar.py", "*dir3*", "/project/tests/bar"]
"includePaths": ["/home/user/dir2", "/home/user/dir4/*.py"]
}
|
I believe python API is needed to provide exclusions. I understand this can be achieved via attach/launch settings, but being able to set this in python is needed. If the python API work can be separated from the inclusion/exclusion support. Then python API is of lower priority. |
The one downside I see with an If only an Ideas? |
I thought about it a bit more and I have a suggestion: Let's go with the Also, the excludePaths/includePaths would always have priority over the So, it'd be something as:
As a note, by default anything not considered to be a library is considered to be part of the project. |
Do we need Personally I find that confusing. As for the excludes, I would have expected that to take precedence. E.g. include everything in the current folder (default), but exclude a sub directory. |
Ok, let's revisit later for the library/project roots if needed... Regarding the include/exclude priority, let me give an example:
Does it seem ok or am I missing something? Note that if there's an additional level on any case the rules wouldn't work because the rules aren't flexible enough (but that's probably a reasonable limitation). |
This doesn't feel intuitive to me, that's not how I would expect this setting to work. The way I'd solve your case is as follows:
Besides, I would have thought the primary use case of |
I agree that it's a good approach, as it doesn't have a conflict and the
priority doesn't really matter in this solution, but as the issue is when
there's a conflict, do you see some case where it's more useful for the
exclude to have priority over the include?
…On Friday, January 18, 2019, Don Jayamanne ***@***.***> wrote:
/dont_trace <- don't want to trace (add to exclude)
/dont_trace/my_code <- want to trace (add to include: only works if include has priority)
This doesn't feel intuitive to me, that's not how I would expect this
setting to work.
It just add complications in explaining how this works to end users.
The way I'd solve your case is as follows:
/dont_trace/a <- don't want to trace (add to exclude)
/dont_trace/b <- don't want to trace (add to exclude)
/dont_trace/c <- don't want to trace (add to exclude)
/dont_trace/*.py <- don't want to trace (add to exclude)
/dont_trace/my_code <- want to trace (add to include)
Besides, I would have thought the primary use case of includePaths is to
include files/folders that sit outside of the current project.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#997 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHLdX_LkC-0m7dw69KYE_UFwB6CNsSJks5vEkUAgaJpZM4YVV36>
.
|
Any case where you want to include a directory while excluding both its parent and some subdirectories in it. It feels like the easiest way to do this is to just apply rules in order. This way, priority is explicit, and is controlled by the user. They would need to ensure that the more generic rules are at the beginning, ahead of more specific ones, but it is flexible enough to cover any scenario. |
Ok, just provided a pull request based on that configuration. Some notes on the implementation:
|
FYI, please have a look at debugging nodejs in VSC, in particular the tooltips for files excluded in the stack Trace We might want to do the same |
@karthiknadig can we do the same for files excluded when using justmycode/debugStdLib? |
@DonJayamanne it should be possible (ideally it should be done once I think this would be a separate issue thought. |
@DonJayamanne Certainly that can be done for excluding files that way. @fabio we have See https://github.com/Microsoft/ptvsd/issues/579 where we talk a bit more details about this. |
Please note, by this i am referring to the tooltips. |
I have not closed this item because we currently exclude files/dirs/modules only from stepping. The stack still shows frames from excluded files/dirs/modules. |
@karthiknadig from what I understood that @DonJayamanne said, the idea was just graying them out and not really excluding (i.e.: add a Note that I'm already on the process of porting the |
Yes, that is correct. Graying the frames from excluded files. |
Doesn't seem to work, I've tested this at my end, and here are the logs:
Note:
|
@DonJayamanne I've been able to reproduce the issue related to the Now, related to the issue on Now, the case I tested wasn't a unit-test... I couldn't discover where to specify the Also, is it working for you on a regular launch? Which Python version/OS are you testing? |
Please do not hard code this, I'm currently using the API to pass in the "rules":[
{"path":"/Users/donjayamanne/.vscode-insiders/extensions/pythonVSCode","include":false},
{"path":"/Users/donjayamanne/.vscode-insiders/extensions/pythonVSCode/pythonFiles/visualstudio_py_testlauncher.py","include":false},
{"path":"/Users/donjayamanne/.vscode-insiders/extensions/pythonVSCode/pythonFiles/","include":false}]
}
There's no way to do this, that's why I've uploaded the
Have not tested.
OSX, Python 3.7 |
I've created a different issue to address this: #1268 (so, closing this one). |
Environment data
Actual behavior
Unable to prevent files from being excluded from the debugger.
Expected behavior
Should be able to exclude files from being debugged.
Steps to reproduce:
Currently VSC is using the following API to exclude a file from being debugged:
The text was updated successfully, but these errors were encountered: