Skip to content

Commit f206433

Browse files
committed
better presentation for slices and arrays
1 parent 55d15a9 commit f206433

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/com/goide/dlv/DlvXValue.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ public void renderValue(@NotNull XValueTextRenderer renderer) {
141141
};
142142
}
143143
String type = myVariable.type;
144+
if (myVariable.isSliceOrSlice()) {
145+
return new XRegularValuePresentation(value, type.replaceFirst("struct ", ""));
146+
}
144147
String prefix = myVariable.type + " ";
145148
return new XRegularValuePresentation(StringUtil.startsWith(value, prefix) ? value.replaceFirst(Pattern.quote(prefix), "") : value,
146149
type);

src/com/goide/dlv/protocol/DlvApi.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ private enum Kind {
161161
private boolean isNumber() {
162162
return compareTo(Int) >= 0 && compareTo(Complex128) <= 0;
163163
}
164+
165+
}
166+
public boolean isSliceOrSlice() {
167+
Kind kind = getKind();
168+
return kind == Kind.Slice || kind == Kind.Array;
164169
}
165170

166171
public boolean isNumber() { return getKind().isNumber(); }

0 commit comments

Comments
 (0)