Skip to content

Dap types command#4246

Draft
ljluestc wants to merge 3 commits intogo-delve:masterfrom
ljluestc:dap-types-command
Draft

Dap types command#4246
ljluestc wants to merge 3 commits intogo-delve:masterfrom
ljluestc:dap-types-command

Conversation

@ljluestc
Copy link

service/dap: support 'types' command

This PR adds support for the types command in the DAP service, enabling clients (like VS Code) to query the list of available types in the debugged program.

Fixes #3729

Description

The types command is available in the Delve CLI but was missing from the DAP implementation. This change:

  • Adds the types command to the list of supported debug commands in service/dap/command.go.
  • Implements the types handler in Session which delegates to the underlying debugger's Types method.
  • Adds verification tests in service/dap/server_test.go to ensure dlv types returns expected output and handles arguments correctly.

Verification

  • Added new test cases in TestEvaluateCommandRequest in service/dap/server_test.go.
  • Verified that dlv types returns the list of types.
  • Verified that dlv types <regex> filters the list correctly.


msgTypes = `Print list of types.

dlv types [<regex>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs one more tab of indentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support dlv types from DAP (the same way types is supported in the command line dlv REPL)

2 participants