Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

How to see global variables in visual studio for golang while debugging? #1854

Closed
Sai-Venky opened this issue Aug 17, 2018 · 4 comments
Closed
Labels

Comments

@Sai-Venky
Copy link

While debugging in GoLang using delve only the local variables are shown. Cant see all the global variables. Is there any settings change to see the list of all variables
screen shot 2018-08-17 at 11 12 09 am
Here a is not showing Even when I hover mouse over it its value is not coming.

I also added this setting :-
"go.delveConfig": {
"useApiV1": false,
"dlvLoadConfig": {
"followPointers": true,
"maxVariableRecurse": 2,
"maxStringLen": 64,
"maxArrayValues": 64,
"maxStructFields": -1
}
}
Still not coming

@ramya-rao-a
Copy link
Contributor

Displaying global variables is not supported at the moment, but this should be do-able

Delve supports listing of global variables across all packages. We can provide the current package name in a regex and should be able to get the global variables.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Aug 22, 2018

@Sai-Venky I have the changes required for this feature in a branch. Can you try it out and give some feedback on how it works?

  • Download https://github.com/Microsoft/vscode-go/blob/master/Go-latest.vsix
  • Run code --install-extension Go-latest.vsix or code-insiders --install-extension Go-latest.vsix based on whether you are using Stable or the Insiders
  • If the above fails with Error: end of central directory record signature not found, then clone this repo and use the Go-latest.vsix file from the cloned repo
  • Reload VS Code
  • The version of the Go extension should show as 0.6.89-beta.1

@ramya-rao-a
Copy link
Contributor

cc @lggomez

@Sai-Venky
Copy link
Author

Its working now .Thanks

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants