Adding support for Debug Adapters to Visual Studio IDE
Since its release, Visual Studio Code’s extension model, based on well-known web technologies such as TypeScript and JSON, has attracted a great deal of participation from the community, with hundreds of extensions published to provide support for exciting new languages and technologies. Visual Studio 2017 took the first steps towards participating in this ecosystem in November, with the release of the Language Server Protocol preview. Now, in Visual Studio 2017 version 15.6, we’re excited to announce support for another Visual Studio Code extension component – the debug adapter. If you’ve previously written a debugging extension for Visual Studio Code, you can now use it in Visual Studio as well, generally with only minor modifications. If you’re considering implementing debugging support for a language or runtime, doing so via a debug adapter will allow you to reach both Visual Studio and Visual Studio Code customers without having to support two separate codebases.
What is a Debug Adapter?
A debug adapter is a program that can communicate with a debugger UI using the Debug Adapter Protocol. An adapter can act as a bridge between the UI and a separate debugger (such as GDB or LLDB), or can be a debugger in and of itself (such as “vsdbg”, which supports CoreCLR debugging on Linux and macOS). The Debug Adapter Protocol is JSON-based, and libraries for working with it are available in many languages, including Node.JS and C#/VB.Net.
How do I get started?
You will need to have Visual Studio 2017 version 15.6 installed.
On the Debug Adapter Host wiki, you’ll find walkthroughs that demonstrate testing and packaging a debug adapter for use in Visual Studio. After following the walkthrough, you’ll be able to debug with Visual Studio Code’s “Mock Debug” adapter in Visual Studio:
The wiki also contains documentation on new functionality added to the Debug Adapter Protocol to support Visual Studio scenarios, such as the ability to edit values in the “Watch” window, control the formatting of data and stack traces, and more.
If your extension also contains a Language Server, you may also be interested in the preview release of Visual Studio’s Language Server Protocol support.
How do I provide feedback?
|Andrew Crawley Sr. Software Engineer, Visual Studio
Andrew is an engineer on the Visual Studio IDE Debugger team, where he works on the Visual Studio Debug Adapter Host.