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

Expand nested content only for non array, maps #2301

Merged
merged 2 commits into from
Feb 6, 2019

Conversation

ramya-rao-a
Copy link
Contributor

Delve doesn't load strings or arrays or slices whose length is greater than 64. This value can be changed by using the setting dlvLoadConfig whose default values are as follows

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

In #2198, we added the ability to expand nested content in the variables pane to fix #1010.

But while providing the feature to expand nested content, we also ended up expanding arrays and strings that have length > 64 if the said arrays/strings are children of one of the variable.

This PR restricts such expansion to just structs and interfaces

@jhendrixMSFT
Copy link
Member

Not that I'm pushing back but curious what prompted this change?

@ramya-rao-a
Copy link
Contributor Author

I had this point in my head the first time we went through your PR, but I hadnt sorted my thoughts yet and didnt get a chance to actually try the various scenarios.

Yesterday, I did get some time, and so the prompt for the change :)

@jhendrixMSFT
Copy link
Member

Do you have a test case where you see it loading more than the 64 items? For me it only loads 64 even if there are more in the array. Maybe I need to update my test.

@ramya-rao-a
Copy link
Contributor Author

Hmm... now that I check it, I do see that it loads only 64.

Do you have a test case, where we would need to expand the arrays/slices/maps ?
With mine, they expanded just fine even after the changes in this PR

@ramya-rao-a ramya-rao-a merged commit d75d4f0 into microsoft:master Feb 6, 2019
@ramya-rao-a ramya-rao-a deleted the nested-variable branch February 6, 2019 22:10
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debugger does not display values in array of struct on VARIABLES pane and debug: Evaluate command.
2 participants