MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / getFilePath

Function getFilePath

src/platform/common/platform/fs-paths.ts:29–43  ·  view source on GitHub ↗
(file: Uri | undefined)

Source from the content-addressed store, hash-verified

27 return undefined;
28}
29export function getFilePath(file: Uri | undefined) {
30 const isWindows = getOSType() === OSType.Windows;
31 if (file) {
32 const fsPath = uriPath.originalFSPath(file);
33
34 // Remove separator on the front if not a network drive.
35 // Example, if you create a URI with Uri.file('hello world'), the fsPath will come out as '\Hello World' on windows. We don't want that
36 // However if you create a URI from a network drive, like '\\mydrive\foo\bar\python.exe', we want to keep the \\ on the front.
37 if (fsPath && fsPath.startsWith(path.sep) && fsPath.length > 1 && fsPath[1] !== path.sep && isWindows) {
38 return fsPath.slice(1);
39 }
40 return fsPath || '';
41 }
42 return '';
43}
44
45export function getDisplayPath(
46 filename: Uri | string | undefined,

Callers 15

tracebackLinkifyMethod · 0.90
fileInputChooseFileMethod · 0.90
openNotebookFunction · 0.90
setActiveInterpreterFunction · 0.90
matchMethod · 0.90
preSwitchFunction · 0.90
getKernelIdFunction · 0.90
expandWorkingDirFunction · 0.90

Calls 1

getOSTypeFunction · 0.90

Tested by 1

preSwitchFunction · 0.72