Skip to content

Commit 465bde1

Browse files
author
beicause
committed
replace fsPath with path in graph label
because graph labels don't display '\' in windows
1 parent b5a9458 commit 465bde1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/dot.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import * as vscode from 'vscode'
44
import { isDeepStrictEqual } from "util"
55
import { output } from "./extension"
66

7-
export function generateDot(graph: CallHierarchyNode,path:string) {
7+
export function generateDot(graph: CallHierarchyNode, path: string) {
88
const dot = new Graph()
9-
const root = vscode.workspace.workspaceFolders?.[0].uri.fsPath??''
9+
const root = vscode.workspace.workspaceFolders?.[0].uri.path ?? ''
1010
dot.addAttr({ rankdir: "LR" })
1111
const getNode = (n: CallHierarchyNode) => {
1212
return {
13-
name: `"${n.item.uri.fsPath}#${n.item.name}@${n.item.range.start.line}:${n.item.range.start.character}"`,
13+
name: `"${n.item.uri.path}#${n.item.name}@${n.item.range.start.line}:${n.item.range.start.character}"`,
1414
attr: { label: n.item.name },
15-
subgraph: { name: n.item.uri.fsPath, attr: { label: n.item.uri.fsPath.replace(root,'${workspace}') } },
15+
subgraph: { name: n.item.uri.path, attr: { label: n.item.uri.path.replace(root, '${workspace}') } },
1616
next: []
1717
} as Node
1818
}
@@ -40,7 +40,7 @@ export function generateDot(graph: CallHierarchyNode,path:string) {
4040
insertNode(node, graph)
4141
dot.addNode(node)
4242
fs.writeFileSync(path, dot.toString())
43-
output.appendLine('generate dot file: '+ path)
43+
output.appendLine('generate dot file: ' + path)
4444
return dot
4545
}
4646

0 commit comments

Comments
 (0)