Open ericdrobinson opened 3 years ago
Seems like if something is missing here, maybe it's a better description of some features in DAP. The protocol should not define what a feature is used for- a client can use breakpoint locations for whatever breakpoint locations might be useful for. And if you want to know what that looks like in vscode, the source is the only reference. But maybe a little more detail would help in some cases.
I’ve been trying to work my way through Debugger Extension documentation to improve an existing debugger extension. My resources so far have been:
I would love to add "Documentation for VS Code's DAP Implementation" to that list, but I have unfortunately not been able to find it. The best I've found is using JSDoc-driven IntelliSense on this package, but that has been less helpful than expected.
When attempting to determine how to map DAP Capabilities to the debugger I'm integrating, it helps to have a good understanding of how VS Code is going to use a feature.
One good example would be the
supportsBreakpointLocationRequest
capability. Here is its JSDoc comment in its entirety:Okay... that sounds like a DAP reference. Let's look at what the specification has to say about BreakpointLocations Requests:
At this point I'm still confused. Looking at the members of the related
BreakpointLocationsArguments
type provides a bit of insight, but it doesn't definitively help me understand what the purpose of this capability is...A web search for related keywords finally turns up something helpful:
Ahh! This is how we enable column breakpoints! Got it! That helpful context was provided in VS Code release notes from September 2019...
Would it be possible to add this to some official documentation, whether that be in the DAP Specification or VS Code's specific implementation, or both?
Other examples that I've contended (or am still contending) with:
supportsSetExpression
capability. I found the necessary context in a previous GitHub Issue.LoggingDebugSession
class. This is the base class for the VS Code Mock Debug project'sMockDebugSession
class. That project appears to be how Debug Extension architecture is currently communicated. There is no discussion about what options exist for base classes here and no documentation about whatLoggingDebugSession
provides beyond its base class (yes logging, but via what mechanism exactly?). The only way to know is to look to the source code and learn it.In general, I think the documentation for the DAP and VS Code's specific implementation thereof could be greatly enhanced by providing deeper context for features. As someone newly interfacing with the API and familiar with my own debugger's capabilities, it would make my life much easier to understand what end-user experience is enabled by a feature/capability; to understand the "why" behind an API, rather than just the "what".