Skip to content

Commit ab09f36

Browse files
committed
fix for notebook path
1 parent 01eda1e commit ab09f36

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/common/utils/pathUtils.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { Uri } from 'vscode';
1+
import { Uri, workspace } from 'vscode';
22
import { isWindows } from '../../managers/common/utils';
33

44
export function checkUri(scope?: Uri | Uri[] | string): Uri | Uri[] | string | undefined {
55
if (scope instanceof Uri) {
66
if (scope.scheme === 'vscode-notebook-cell') {
7-
return Uri.from({
8-
scheme: 'vscode-notebook',
9-
path: scope.path,
10-
authority: scope.authority,
7+
workspace.notebookDocuments.find((doc) => {
8+
if (doc.uri.toString() === scope.toString()) {
9+
return doc;
10+
}
1111
});
12+
return scope;
1213
}
1314
}
1415
if (Array.isArray(scope)) {

0 commit comments

Comments
 (0)