use of com.intellij.xdebugger.frame.presentation.XRegularValuePresentation in project go-lang-idea-plugin by go-lang-plugin-org.
the class DlvXValue method getPresentation.
@NotNull
private XValuePresentation getPresentation() {
String value = myVariable.value;
if (myVariable.isNumber())
return new XNumericValuePresentation(value);
if (myVariable.isString())
return new XStringValuePresentation(value);
if (myVariable.isBool()) {
return new XValuePresentation() {
@Override
public void renderValue(@NotNull XValueTextRenderer renderer) {
renderer.renderValue(value);
}
};
}
String type = myVariable.type;
boolean isSlice = myVariable.isSlice();
boolean isArray = myVariable.isArray();
if (isSlice || isArray) {
return new XRegularValuePresentation("len:" + myVariable.len + (isSlice ? ", cap:" + myVariable.cap : ""), type.replaceFirst("struct ", ""));
}
String prefix = myVariable.type + " ";
return new XRegularValuePresentation(StringUtil.startsWith(value, prefix) ? value.replaceFirst(Pattern.quote(prefix), "") : value, type);
}
Aggregations