emacs-lsp / dap-mode

Emacs :heart: Debug Adapter Protocol
https://emacs-lsp.github.io/dap-mode
GNU General Public License v3.0
1.3k stars 182 forks source link

How to display global variables in dap-ui-locals #246

Open f4nyc opened 4 years ago

f4nyc commented 4 years ago

Description :octocat: Using wonderful dap-mode with spacemacs, typed M-x dap-ui-locals and got this 图片 I wonder if there are any specific setting steps to display globals? Thanks for your help!

yyoncho commented 4 years ago

As per https://github.com/microsoft/vscode-go/issues/1854 you are supposed to pass delve settings to the adapter. In any case, this is not something specific to dap-mode but the golang debug adapter.

f4nyc commented 4 years ago

Oh, I see . So I just need to check the problem in my ms-vscode.go configuration file. Thx !

f4nyc commented 4 years ago

I just copied the extension from vscode where globals are displayed normally. Still not globals. Should I add some delve settings to dap template? But my template is basically the same as launch.json

(dap-register-debug-template
  "Launch File"
  (list :type "go"
        :request "launch"
        :name "Launch File"
        :mode "auto"
        :program nil
        :buildFlags nil
        :args nil
        :env nil
        :envFile nil))
 {   
    "version": "0.2.0",
    "configurations": [

        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${fileDirname}",
            "env": {},
            "args": []
        }
    ]
}
nbfalcon commented 4 years ago

Can you still reproduce? This should be a server-side issue.

f4nyc commented 3 years ago

Can you still reproduce? This should be a server-side issue.

yep , I can still reproduce, and this is log via setting dap-print-io to t.

Sending: 
{
  "command": "variables",
  "arguments": {
    "variablesReference": 1000
  },
  "type": "request",
  "seq": 15
}
Received:
{
  "body": {
    "variables": [
      {
        "variablesReference": 0,
        "evaluateName": "str1",
        "value": "\"word\"",
        "name": "str1"
      }
    ]
  },
  "success": true,
  "command": "variables",
  "request_seq": 15,
  "type": "response",
  "seq": 19
}
f4nyc commented 3 years ago

Can you still reproduce? This should be a server-side issue.

My Delve is lastest version 1.5.0 , and vscode extension is 0.15.0 set by dap-mode.