Skip to content

Commit be0573d

Browse files
committed
feat: introduce Select Python Environment command and deprecate robotcode.python
See [here](https://github.com/microsoft/vscode-python/wiki/Setting-descriptions#pythondefaultinterpreterpath) for an explanation. resolve #222
1 parent ee256ce commit be0573d

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,9 @@
440440
"robotcode.python": {
441441
"type": "string",
442442
"default": "",
443-
"description": "Specifies the python executable to be used for RobotCode. If no path is specified, try to get it from \"python\" extension.",
444-
"scope": "resource"
443+
"markdownDescription": "Specifies the python executable to be used for RobotCode.\n\n**Note:** This is normally not necessary and should only be used if you want to use a completely different Python interpreter than the interpreter that can be selected via VSCode. Please use the `RobotCode: Select Python Environment` command to select the python interpreter.\n\nIf you want to define a default interpreter for your workspace use the `python.defaultInterpreterPath` setting. See [here](https://github.com/microsoft/vscode-python/wiki/Setting-descriptions#pythondefaultinterpreterpath) for an explanation.",
444+
"scope": "resource",
445+
"markdownDeprecationMessage": "This setting is deprecated in favor of using `python.defaultInterpreterPath`"
445446
}
446447
}
447448
},
@@ -1025,6 +1026,11 @@
10251026
"category": "RobotCode",
10261027
"command": "robotcode.reportIssue"
10271028
},
1029+
{
1030+
"title": "Select Python Environment",
1031+
"category": "RobotCode",
1032+
"command": "robotcode.selectPythonEnvironment"
1033+
},
10281034
{
10291035
"title": "Clear Cache and Restart Language Servers",
10301036
"category": "RobotCode",

vscode-client/languageToolsManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export class LanguageToolsManager {
220220
}),
221221
vscode.commands.registerCommand(
222222
"robotcode.selectPythonEnvironment",
223-
async (folder?: vscode.WorkspaceFolder, showRetry?: boolean) => {
223+
async (folder: vscode.WorkspaceFolder | undefined = undefined, showRetry: boolean = false) => {
224224
await this.languageClientsManager.selectPythonEnvironment(
225225
`Select Environment for workspace folder '${folder?.name}'`,
226226
folder,

vscode-client/languageclientsmanger.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ export class LanguageClientsManager {
341341
break;
342342
case "retry":
343343
return;
344+
default:
345+
if (!showRetry) return;
344346
}
345347

346348
if (folder !== undefined && !this.inselectPythonEnvironment) {

0 commit comments

Comments
 (0)