Skylark debugger: don't quote or escape strings when serializing.
A minor serialization improvement. I'm planning to refactor this code
significantly, but wanted to get this in before I forgot.
@@ -36,11 +36,18 @@ final class DebuggerSerialization {
.setLabel(label)
// TODO(bazel-team): omit type details for non-Skylark values
.setType(EvalUtils.getDataTypeName(value))
- .setDescription(Printer.repr(value))
+ .setDescription(getDescription(value))
.addAllChild(getChildren(value))
.build();
}
+ private static String getDescription(Object value) {
+ if (value instanceof String) {
+ return (String) value;
+ }
+ return Printer.repr(value);
+ }
+
private static Value errorValue(String errorMessage) {
return Value.newBuilder().setLabel("Error").setDescription(errorMessage).build();
}
