Skip to content

Commit 4235be0

Browse files
committed
fix: symbol name prefix can be trimmed twice
Signed-off-by: Zxilly <zxilly@outlook.com>
1 parent 4a9620b commit 4235be0

File tree

6 files changed

+7034
-52
lines changed

6 files changed

+7034
-52
lines changed

ui/src/Node.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ export const Node: React.FC<NodeProps> = (
4242
}, [children, height, width])
4343

4444
const title = useMemo(() => {
45-
const t = trimPrefix(node.data.getName(), node.parent?.data.getName() ?? "")
46-
return trimPrefix(t, "/")
47-
}, [node.data, node.parent?.data])
45+
const t = node.data.getName()
46+
let display = trimPrefix(t, "/")
47+
if (node.data.getType() === "symbol") {
48+
display = trimPrefix(display, ".")
49+
}
50+
return display
51+
}, [node.data])
4852

4953
useLayoutEffect(() => {
5054
if (width == 0 || height == 0 || !textRef.current) {

0 commit comments

Comments
 (0)