-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Source code downloaded via the debuggers sourceRequest creates lots of duplicate open files across debug sessions #131502
Comments
We use the |
@isidorn my understanding is that Or, could downloaded source files be closed when a debug session ends (or another is opened with the same name/path)? Otherwise, do you have any ideas for how a debug adapter could handle this? |
We could close all debug sources once a debug session ends I guess, but they will still be in history. We have uniqueness with the name, but we need the reference in the URI so we can get the content of that uri later on. Not for uniqueness. |
If these files were opened in "preview" mode, would that prevent this? It feels like these files make no sense to be open (or for a user to try to re-open) after the session ends, as the
The problem is that it's across debug sessions, so this would require the DA persist this mapping somewhere, which feels a bit odd. |
I agree. @TylerLeonhardt do you know whether there is a way to prevent some files from ending up in quickopen history, or clear them when the debug session is done? |
As far as I know, something like this isn't supported, right @bpasero? |
@TylerLeonhardt yup, |
I'll take this. Some notes:
|
What do you mean by "source reference" here? Most of the |
I think the combination of identical |
While it may be good for JS because it's already using hashes, I think it would be much better to leave this up to the debug adapter and use a field specifically for this (for example allowing using string URIs or similar). The DAP spec also says |
Yes, my thought was that if a path was not defined, we would not try to do any equivalency logic.
Would this be an opportunity to provide more info than what can be encoded in a And yes, we provide some clarity in DAP |
Yeah - maybe this ties into microsoft/debug-adapter-protocol#444. VS Code supports URIs but it's not documented very clearly, and there's this weird microsoft/debug-adapter-protocol#444 (comment) That said, maybe a URI is not enough. For example I might have:
So I feel like we really need an explicit flag to say whether a source might be stable - and we shouldn't couple the identifier to what the user sees (for example I might want to see dart:core/foo.dart |
If I debug into a source file that is downloaded from the debugger (via
sourceRequest
) and then stop the debug session and repeat the same thing again, VS Code opens a second copy of the source (even though the name/contents are identical).After a few debug sessions, I end up with this:
As far as I can tell, nothing is different about these files (besides the
sourceReference
) so I would expect VS Code to reuse the same existing file the next time they're required (I actually thought this is what it did in the past, though I'm not certain).The text was updated successfully, but these errors were encountered: