Source File Checksums - microsoft/VSDebugAdapterHost GitHub Wiki

Source File Checksums

Visual Studio can provide checksums for files to the debug adapter when setting breakpoints to ensure that the file open in the editor matches the one available to the debug adapter. The debug adapter can provide checksums for files to help Visual Studio locate and open the correct version of a source file.

Required Implementation

To support checksums, a debug adapter must:

  • Return a set of supported checksum algorithms in the supportedChecksumAlgorithms field in the Capabilities object returned in response to the initialize request.
  • Include a set of Checksum objects in the checksums field of any Source object sent to Visual Studio.
  • Verify that the checksums contained in the Source object passed as an argument to the setBreakpoints request match the file available to the debug adapter, and return a Breakpoint object with the verified field set to false if they do not match.

Remarks

Visual Studio may provide zero, one, or more than one checksum of a given algorithm, depending on user settings. If no checksums are provided, or if any of the provided checksums match, the debug adapter should consider it a valid match.