-
Notifications
You must be signed in to change notification settings - Fork 38
fix: deduplicate workspaceSearchPaths error and skip PET resolve for unresolved variables (Fixes #1289) #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b1c55e9
2b2aee9
e41b013
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,20 +107,32 @@ async function resolvePriorityChainCore( | |
| const userInterpreterPath = getUserConfiguredSetting<string>('python', 'defaultInterpreterPath', scope); | ||
| if (userInterpreterPath) { | ||
| const expandedInterpreterPath = resolveVariables(userInterpreterPath, scope); | ||
| const resolved = await tryResolveInterpreterPath(nativeFinder, api, expandedInterpreterPath, envManagers); | ||
| if (resolved) { | ||
| traceVerbose(`${logPrefix} Priority 3: Using defaultInterpreterPath: ${userInterpreterPath}`); | ||
| return { result: resolved, errors }; | ||
| if (expandedInterpreterPath.includes('${')) { | ||
| traceWarn( | ||
| `${logPrefix} defaultInterpreterPath '${userInterpreterPath}' contains unresolved variables, falling back to auto-discovery`, | ||
| ); | ||
| const error: SettingResolutionError = { | ||
| setting: 'defaultInterpreterPath', | ||
| configuredValue: userInterpreterPath, | ||
| reason: l10n.t('Path contains unresolved variables'), | ||
| }; | ||
| errors.push(error); | ||
| } else { | ||
| const resolved = await tryResolveInterpreterPath(nativeFinder, api, expandedInterpreterPath, envManagers); | ||
| if (resolved) { | ||
| traceVerbose(`${logPrefix} Priority 3: Using defaultInterpreterPath: ${userInterpreterPath}`); | ||
| return { result: resolved, errors }; | ||
| } | ||
| const error: SettingResolutionError = { | ||
| setting: 'defaultInterpreterPath', | ||
| configuredValue: userInterpreterPath, | ||
| reason: `Could not resolve interpreter path '${userInterpreterPath}'`, | ||
| }; | ||
|
Comment on lines
+126
to
+130
|
||
| errors.push(error); | ||
| traceWarn( | ||
| `${logPrefix} defaultInterpreterPath '${userInterpreterPath}' unresolvable, falling back to auto-discovery`, | ||
| ); | ||
| } | ||
| const error: SettingResolutionError = { | ||
| setting: 'defaultInterpreterPath', | ||
| configuredValue: userInterpreterPath, | ||
| reason: `Could not resolve interpreter path '${userInterpreterPath}'`, | ||
| }; | ||
| errors.push(error); | ||
| traceWarn( | ||
| `${logPrefix} defaultInterpreterPath '${userInterpreterPath}' unresolvable, falling back to auto-discovery`, | ||
| ); | ||
| } | ||
|
|
||
| // PRIORITY 4: Auto-discovery (no user-configured settings matched) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.