File tree 2 files changed +10
-5
lines changed
pythonEnvironments/base/info
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ function isUri(resource?: Uri | any): resource is Uri {
60
60
/**
61
61
* Create a filter func that determine if the given URI and candidate match.
62
62
*
63
- * The scheme must match, as well as path.
63
+ * Only compares path.
64
64
*
65
65
* @param checkParent - if `true`, match if the candidate is rooted under `uri`
66
66
* or if the candidate matches `uri` exactly.
@@ -80,9 +80,8 @@ export function getURIFilter(
80
80
}
81
81
const uriRoot = `${ uriPath } /` ;
82
82
function filter ( candidate : Uri ) : boolean {
83
- if ( candidate . scheme !== uri . scheme ) {
84
- return false ;
85
- }
83
+ // Do not compare schemes as it is sometimes not available, in
84
+ // which case file is assumed as scheme.
86
85
let candidatePath = candidate . path ;
87
86
while ( candidatePath . endsWith ( '/' ) ) {
88
87
candidatePath = candidatePath . slice ( 0 , - 1 ) ;
Original file line number Diff line number Diff line change @@ -87,7 +87,13 @@ export function areEnvsDeepEqual(env1: PythonEnvInfo, env2: PythonEnvInfo): bool
87
87
env2Clone . source = env2Clone . source . sort ( ) ;
88
88
const searchLocation1 = env1 . searchLocation ?. fsPath ?? '' ;
89
89
const searchLocation2 = env2 . searchLocation ?. fsPath ?? '' ;
90
- return isEqual ( env1Clone , env2Clone ) && arePathsSame ( searchLocation1 , searchLocation2 ) ;
90
+ const searchLocation1Scheme = env1 . searchLocation ?. scheme ?? '' ;
91
+ const searchLocation2Scheme = env2 . searchLocation ?. scheme ?? '' ;
92
+ return (
93
+ isEqual ( env1Clone , env2Clone ) &&
94
+ arePathsSame ( searchLocation1 , searchLocation2 ) &&
95
+ searchLocation1Scheme === searchLocation2Scheme
96
+ ) ;
91
97
}
92
98
93
99
/**
You can’t perform that action at this time.
0 commit comments