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

Allow changing showGlobalVariables in settings #2323

Closed
aschade92 opened this issue Feb 11, 2019 · 7 comments
Closed

Allow changing showGlobalVariables in settings #2323

aschade92 opened this issue Feb 11, 2019 · 7 comments

Comments

@aschade92
Copy link
Contributor

aschade92 commented Feb 11, 2019

If I'm using the extension version 0.8.1-beta.7 debugging is very fast and only local appears in the variable window:
image
config:

{
    "go.delveConfig": {
        "apiVersion": 1,
        "dlvLoadConfig": {
            "followPointers": true,
            "maxVariableRecurse": 1,
            "maxStringLen": 600,
            "maxArrayValues": 64,
            "maxStructFields": -1,
            "showGlobalVariables": false
        },
    }
}

Now if I install 0.8.1-beta.12 or 0.9.1, debugging is slightly to significantly slower depending on the amount of variables that are getting collected by the debugger. Setting showGlobalVariables to false (as mentioned here: #2133 (comment)) doesn't really seem to do anything for me (there might be a slight improvement but there is noticeable lag here that is not present in the beta version 0.8.1-beta.7 I mentioned above). Regardless of whether or not showGlobalVariables is set to false, global still appears in the frame:

image

I'm guessing that there is still some other processing being done here in the latest versions that wasn't being done in versions where the debugger works much more fluidly. Is there a way to just completely disable global variables? Is this even expected when showGlobalVariables is set to true? Global variables aren't really recommended in general by the go community anyways so an option to disable them completely in favor of higher performance would be appreciated.

Steps to Reproduce:

  1. Run debug session with above config
  2. Debugging is slow, global variables still appear in the variables pane.
@aschade92 aschade92 reopened this Feb 11, 2019
@ramya-rao-a
Copy link
Contributor

@aschade92 The showGlobalVariables needs to be set in the debug configuration in your launch.json file and not in the go.delveConfig setting. Can you try doing that?

Global variables aren't really recommended in general by the go community anyways

Can you point us to some docs or discussion around this?

@aschade92
Copy link
Contributor Author

aschade92 commented Feb 18, 2019

Cool yeah that worked for me. Is there any way to apply this settings in the workspace settings so that it can be used for running tests? (ie pressing the test or debug button above a test?)

Can you point us to some docs or discussion around this?

Here are a couple that discuss this issue but I don't think that's super important for the purposes of the thread anymore:

@mhr3
Copy link
Contributor

mhr3 commented Feb 19, 2019

I'd be also interested in a way to disable the global variables when using the "Debug test" code lens.

@ramya-rao-a ramya-rao-a changed the title Debugging still pretty slow even with showGlobalVariables=false Allow changing showGlobalVariables in settings Feb 21, 2019
@ramya-rao-a
Copy link
Contributor

Is there any way to apply this settings in the workspace settings?

Not at the moment, but we should be able to enable add it to the go.delveConfig setting.

PRs are welcome to do this
Code Pointers:

  • See Build and Debug Extension to set up local dev environment
  • The delveConfig property in the package.json file needs to be updated to support showGlobalVariables setting
  • goDebugConfiguration.ts can then be updated to read this setting and update the debug configuration

@aschade92
Copy link
Contributor Author

@ramya-rao-a easy enough, I made a PR for this one

@ramya-rao-a
Copy link
Contributor

In the latest beta version (0.9.3-beta.2) of this extension, showGlobalVariables is now configurable in the go.delveConfig and is disabled by default as well

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 18, 2019
@ramya-rao-a
Copy link
Contributor

This feature is out in the latest release(0.10.0) of the Go extension

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants