go.lua 816 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. local dap = require 'dap'
  2. require('dap-go').setup({})
  3. dap.adapters.delve = {
  4. type = 'server',
  5. port = '${port}',
  6. executable = {
  7. command = 'dlv',
  8. args = { 'dap', '-l', '127.0.0.1:${port}' },
  9. }
  10. }
  11. -- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
  12. dap.configurations.go = {
  13. -- {
  14. -- type = "delve",
  15. -- name = "Debug test", -- configuration for debugging test files
  16. -- request = "launch",
  17. -- mode = "test",
  18. -- program = "${file}"
  19. -- },
  20. -- works with go.mod packages and sub packages
  21. {
  22. type = "delve",
  23. name = "Debug test (go.mod)",
  24. request = "launch",
  25. mode = "test",
  26. program = "./${relativeFileDirname}",
  27. },
  28. -- {
  29. -- type = "delve",
  30. -- name = "Debug",
  31. -- request = "launch",
  32. -- program = "${file}"
  33. -- },
  34. }