Files
vscode/extensions/copilot/test/simulation/fixtures/multiFileEdit/filepaths/2.ts
T
kieferrm 333d9a4053 Hello Copilot
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-06-27 11:35:20 +02:00

13 lines
394 B
TypeScript

import * as path from 'path';
import * as vscode from 'vscode';
export function getRelativeFilePath(uri: vscode.Uri): string | undefined {
const workspaceFolder = vscode.workspace.getWorkspaceFolder(uri);
if (!workspaceFolder) {
return undefined;
}
const workspaceRoot = workspaceFolder.uri.fsPath;
const absolutePath = uri.fsPath;
return path.relative(workspaceRoot, absolutePath);
}