Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DebugServer: Fixes variable names for evaluation expression when next token is an array #1449

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,16 @@ private List<Map<String, Object>> variables(Long frameId) {
map.put("value", "(unknown)");
}
map.put("type", v.type.name());
// remove last dot before an array
String pathExpression = k.startsWith("[") ? finalParentExpression.replaceAll("\\.$", "") : finalParentExpression;
if (v.type == LIST || v.type == MAP) {
VARIABLES.put(++nextVariablesReference, new SimpleEntry(finalParentExpression + k + ".", v));
VARIABLES.put(++nextVariablesReference, new SimpleEntry(pathExpression + k + ".", v));
map.put("presentationHint", "data");
map.put("variablesReference", nextVariablesReference);
} else {
map.put("variablesReference", 0);
}
map.put("evaluateName", finalParentExpression + k);
map.put("evaluateName", pathExpression + k);
list.add(map);
}
});
Expand Down