Skip to content

Commit c6a529a

Browse files
author
beicause
committed
replace uri.toString to fsPath for correct file path in graph
1 parent 12b4b0b commit c6a529a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/dot.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@ import { CallHierarchyNode } from "./call"
22
import * as fs from 'fs'
33
import * as vscode from 'vscode'
44
import { isDeepStrictEqual } from "util"
5-
import * as path from "path"
65
import { output } from "./extension"
76

87
export function generateDot(graph: CallHierarchyNode,path:string) {
98
const dot = new Graph()
10-
const root = vscode.workspace.workspaceFolders?.[0].uri.toString()??''
9+
const root = vscode.workspace.workspaceFolders?.[0].uri.fsPath??''
1110
dot.addAttr({ rankdir: "LR" })
1211
const getNode = (n: CallHierarchyNode) => {
1312
return {
14-
name: `"${n.item.uri}#${n.item.name}@${n.item.range.start.line}:${n.item.range.start.character}"`,
13+
name: `"${n.item.uri.fsPath}#${n.item.name}@${n.item.range.start.line}:${n.item.range.start.character}"`,
1514
attr: { label: n.item.name },
16-
subgraph: { name: n.item.uri.toString(), attr: { label: n.item.uri.toString().replace(root,'${workspace}') } },
15+
subgraph: { name: n.item.uri.fsPath, attr: { label: n.item.uri.fsPath.replace(root,'${workspace}') } },
1716
next: []
1817
} as Node
1918
}

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function activate(context: vscode.ExtensionContext) {
114114
type === 'Incoming' ? 'call_graph_incoming' : 'call_graph_outgoing'
115115
const dotFile = type === 'Incoming' ? dotFileIncoming : dotFileOutgoing
116116
const existed = (p: string) =>
117-
vscode.window.showErrorMessage(`Already exists.\n${p} `)
117+
vscode.window.showErrorMessage(`Already exists, please delete it manually.\n${p} `)
118118

119119
if (msg.command === 'download') {
120120
const dir = vscode.workspace

0 commit comments

Comments
 (0)