Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/cpx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
}
},
"python.linting.pylintArgs": [
"--init-hook",
"import sys; sys.path.extend([\"\"c:\\\\Users\\\\luabud\\\\.vscode\\\\extensions\\\\ms-python.devicesimulatorexpress-2020.0.36321\\\\out\"\",\"\"c:\\\\Users\\\\luabud\\\\.vscode\\\\extensions\\\\ms-python.devicesimulatorexpress-2020.0.36321\\\\out\\\\micropython\"\",\"\"c:\\\\Users\\\\luabud\\\\.vscode\\\\extensions\\\\ms-python.devicesimulatorexpress-2020.0.36321\\\\out\\\\clue\"\",\"\"c:\\\\Users\\\\luabud\\\\.vscode\\\\extensions\\\\ms-python.devicesimulatorexpress-2020.0.36321\\\\out\\\\base_circuitpython\"\"])"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is your local path, please remove

],
"python.pythonPath": "c:\\Users\\luabud\\.vscode\\extensions\\ms-python.devicesimulatorexpress-2020.0.36321\\venv\\Scripts\\python.exe"
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"publisher": "__PUBLISHER__",
"instrumentationKey": "__AIKEY__",
"icon": "assets/icon.png",
"featureFlags": {
"usingNewPythonInterpreterPathApi": true
},
"engines": {
"vscode": "^1.43.0"
},
Expand Down
15 changes: 14 additions & 1 deletion src/service/setupService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,20 @@ export class SetupService {
: GLOBAL_ENV_VARS.PYTHON;
// try to get name from interpreter
try {
originalPythonExecutablePath = getConfig(CONFIG.PYTHON_PATH);
const extension = vscode.extensions.getExtension("ms-python.python");
const usingNewInterpreterStorage = extension.packageJSON?.featureFlags?.usingNewInterpreterStorage;
if (usingNewInterpreterStorage) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment explaining that the python extension is deprecating the old path? As we are still falling back to it if the new interpreter storage is not set

if (!extension.isActive) {
await extension.activate();
}
const execCommand = extension.exports.settings.getExecutionDetails ?
extension.exports.settings.getExecutionDetails().execCommand :
extension.exports.settings.getExecutionCommand();
originalPythonExecutablePath = execCommand.join(" ");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
originalPythonExecutablePath = execCommand.join(" ");
originalPythonExecutablePath = execCommand.join(" ");

nit: extra tab 😁

}
else {
originalPythonExecutablePath = getConfig(CONFIG.PYTHON_PATH);
}
} catch (err) {
originalPythonExecutablePath = systemPythonVar;
}
Expand Down