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

Add debug configuration options for test debug codelens #1749

Merged
merged 7 commits into from
Jun 27, 2018

Conversation

lggomez
Copy link
Contributor

@lggomez lggomez commented Jun 21, 2018

This PR adds a new runtest.debugConfig setting inside of go.enableCodeLens that mimicks the launch.json options for delve, so we can configure the test debugger
Fixes #1735

An example user setting using this feature:

    "go.enableCodeLens": {
        "runtest": true,
        "runtest.debugConfig": {
            "useApiV1": false,
            "dlvLoadConfig": {
                "followPointers": true,
                "maxVariableRecurse": 1,
                "maxStringLen": 128,
                "maxArrayValues": 128,
                "maxStructFields": -1
            }
        }
    },

@lggomez
Copy link
Contributor Author

lggomez commented Jun 21, 2018

@ramya-rao-a PTAL

@ramya-rao-a
Copy link
Contributor

@lggomez This will not help the case where we can debug programs even without the presence of the launch.json file

I would suggest to add a new setting called go.delveConfig which has the below properties

  • useApiV1
  • dlvLoadConfig

@lggomez
Copy link
Contributor Author

lggomez commented Jun 25, 2018

@ramya-rao-a Done. Regarding the launch config, actually this doesn't depend on launch.json, it was just a bad variable naming from a previous test


private getDebugConfig(vsConfig: vscode.WorkspaceConfiguration): any {
let debugConfig: any = this.defaultDebugConfig;
let delveConfig: any = vsConfig.get('delveConfig');
Copy link
Contributor

Choose a reason for hiding this comment

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

The same needs to be done in the resolveDebugConfiguration method at https://github.com/Microsoft/vscode-go/blob/master/src/goDebugConfiguration.ts. So we should probably move this to the util.ts file

This is what is used when we debug "main" programs without any launch.json files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, so I unified the default configurations for both normal and test codelens debug. This should get rid of the confusion caused by this difference, plus being configurable for delve

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jun 27, 2018

@lggomez While testing this I realized that all debug configurations (whether the ones from launch.json, or the ones we create for debug tests codelens or the default ones) pass through resolveDebugConfiguration. So that single location is more than enough to read the dlv config from the configuration/settings.

Sorry about all the churn

@merlijn-sebrechts
Copy link

For anyone here to show long strings in the inspector; add this to vscode user settings. You need to increase both maxStringLen and maxArrayValues to show longer strings.

    "go.delveConfig": {
        "useApiV1": false,
        "dlvLoadConfig": {
            "maxStringLen": 600,
            "maxArrayValues": 600,
        }
    },

@lggomez lggomez deleted the test_config branch May 8, 2019 23:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants