Skip to content

Commit d4d83f3

Browse files
authored
Merge pull request #179 from micimize/vscode-env-resolution
VSCode extension: Include defaultInterpreterPath in env resolution
2 parents 8c1d816 + f6dfb3f commit d4d83f3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

editor-plugins/vscode/src/extension.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ export async function run_formatter(
8282
let options = PythonShell.defaultOptions;
8383
options.scriptPath = SCRIPT_PATH;
8484

85-
const pythonPath: string | undefined = vscode.workspace
86-
.getConfiguration("python")
87-
.get("pythonPath");
88-
if (!!pythonPath) {
89-
options.pythonPath = pythonPath;
85+
const pythonConfig = vscode.workspace.getConfiguration("python");
86+
for (const pathSettingKey of ["defaultInterpreterPath", "pythonPath"]) {
87+
const pythonPath: string | undefined = pythonConfig.get(pathSettingKey);
88+
if (!!pythonPath) {
89+
options.pythonPath = pythonPath;
90+
break;
91+
}
9092
}
9193

9294
let input = script;

0 commit comments

Comments
 (0)