| 1 | import { slash } from '@antfu/utils' |
| 2 | import { relative } from 'pathe' |
| 3 | import { workspace } from 'vscode' |
| 4 | |
| 5 | export function toRelativePath(path: string) { |
| 6 | const workspaceRoot = workspace.workspaceFolders?.[0]?.uri.fsPath ?? '' |
| 7 | return slash(relative(workspaceRoot, path)) |
| 8 | } |
| 9 |