Skip to content

Commit 02e5ce1

Browse files
committed
fix error
1 parent faa2fb0 commit 02e5ce1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/features/projectManager.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class PythonProjectManagerImpl implements PythonProjectManager {
6767

6868
// For each override, resolve its path and add as a project if not already present
6969
for (const o of overrides) {
70-
let uri: Uri | undefined = undefined;
70+
let UriFromWorkspace: Uri | undefined = undefined;
7171
// if override has a workspace property, resolve the path relative to that workspace
7272
if (o.workspace) {
7373
//
@@ -76,14 +76,13 @@ export class PythonProjectManagerImpl implements PythonProjectManager {
7676
if (workspaceFolder.uri.toString() !== w.uri.toString()) {
7777
continue; // skip if the workspace is not the same as the current workspace
7878
}
79-
uri = Uri.file(path.resolve(workspaceFolder.uri.fsPath, o.path));
79+
UriFromWorkspace = Uri.file(path.resolve(workspaceFolder.uri.fsPath, o.path));
8080
}
8181
}
82-
if (uri === undefined) {
83-
uri = Uri.file(path.resolve(w.uri.fsPath, o.path));
84-
}
82+
const uri = UriFromWorkspace ? UriFromWorkspace : Uri.file(path.resolve(w.uri.fsPath, o.path));
83+
8584
// Check if the project already exists in the newProjects array
86-
if (!newProjects.some((p) => p.uri.toString() === uri.toString())) {
85+
if (!newProjects.some((p) => p.uri.toString() === uri.toString())) {
8786
newProjects.push(new PythonProjectsImpl(o.path, uri));
8887
}
8988
}

0 commit comments

Comments
 (0)