We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4acb66b commit 146aa64Copy full SHA for 146aa64
1 file changed
libs/shared/src/lib/idl-file-helper.class.ts
@@ -62,10 +62,23 @@ export class IDLFileHelper {
62
static notebookCellUriToFSPath(uri: URI) {
63
return join(
64
CleanPath(dirname(uri.fsPath)),
65
- `${basename(uri.fsPath, IDL_NOTEBOOK_EXTENSION).replace(
66
- /\s/g,
67
- '_'
+ `${basename(
+ uri.fsPath,
+ IDL_NOTEBOOK_EXTENSION
68
)}_${NOTEBOOK_CELL_BASE_NAME}_${uri.fragment}.pro`
69
);
70
}
71
+
72
+ /**
73
+ * Converts a file system path for a notebook call back to a URI for
74
+ * a notebook cell
75
+ */
76
+ static notebookCellFSPathToUri(fsPath: string) {
77
+ const split = fsPath.split(`_${NOTEBOOK_CELL_BASE_NAME}_`);
78
+ return URI.from({
79
+ scheme: 'vscode-notebook-cell',
80
+ path: `/${split[0].replace(/\\/g, '/')}${IDL_NOTEBOOK_EXTENSION}`,
81
+ fragment: basename(split[1], `.pro`),
82
+ });
83
+ }
84
0 commit comments