Skip to content

Commit 415597b

Browse files
committed
Set -> Select, add Copy to Clipboard functionality
1 parent 078afad commit 415597b

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
},
6060
{
6161
"command": "python.setInterpreter",
62-
"title": "Set Workspace Interpreter",
62+
"title": "Select Workspace Interpreter",
6363
"category": "Python"
6464
},
6565
{
@@ -236,7 +236,7 @@
236236
"type": "python",
237237
"request": "launch",
238238
"stopOnEntry": true,
239-
"pythonPath" :"${config.python.pythonPath}",
239+
"pythonPath": "${config.python.pythonPath}",
240240
"program": "${file}",
241241
"debugOptions": [
242242
"WaitOnAbnormalExit",
@@ -249,7 +249,7 @@
249249
"type": "python",
250250
"request": "launch",
251251
"stopOnEntry": true,
252-
"pythonPath" :"${config.python.pythonPath}",
252+
"pythonPath": "${config.python.pythonPath}",
253253
"program": "${file}",
254254
"externalConsole": true,
255255
"debugOptions": [
@@ -262,7 +262,7 @@
262262
"type": "python",
263263
"request": "launch",
264264
"stopOnEntry": true,
265-
"pythonPath" :"${config.python.pythonPath}",
265+
"pythonPath": "${config.python.pythonPath}",
266266
"program": "${workspaceRoot}/manage.py",
267267
"args": [
268268
"runserver",
@@ -280,7 +280,7 @@
280280
"type": "python",
281281
"request": "launch",
282282
"stopOnEntry": true,
283-
"pythonPath" :"${config.python.pythonPath}",
283+
"pythonPath": "${config.python.pythonPath}",
284284
"program": "${workspaceRoot}/console.py",
285285
"args": [
286286
"dev",
@@ -301,7 +301,7 @@
301301
"remoteRoot": "${workspaceRoot}",
302302
"port": 3000,
303303
"secret": "my_secret",
304-
"host":"localhost"
304+
"host": "localhost"
305305
}
306306
]
307307
}
@@ -599,6 +599,7 @@
599599
"test": "node ./node_modules/vscode/bin/test"
600600
},
601601
"dependencies": {
602+
"copy-paste": "^1.3.0",
602603
"diff-match-patch": "^1.0.0",
603604
"fs-extra": "^0.30.0",
604605
"line-by-line": "^0.1.4",
@@ -618,4 +619,4 @@
618619
"typescript": "^1.8.5",
619620
"vscode": "^0.11.0"
620621
}
621-
}
622+
}

src/client/providers/setInterpreterProvider.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as path from "path";
44
import * as vscode from "vscode";
55
import * as settings from "./../common/configSettings";
66
import * as utils from "./../common/utils";
7+
let ncp = require("copy-paste");
78

89
// where to find the Python binary within a conda env
910
const CONDA_RELATIVE_PY_PATH = utils.IS_WINDOWS ? ['python'] : ['bin', 'python']
@@ -69,10 +70,16 @@ function suggestPythonPaths(): Promise<vscode.QuickPickItem[]> {
6970
);
7071
}
7172

72-
function setPythonPath(path: String) {
73+
function setPythonPath(path: string) {
7374
// Waiting on https://github.com/Microsoft/vscode/issues/1396
74-
// For now, just a stub.
75-
vscode.window.showInformationMessage(`Setting pythonPath: ${path}`);
75+
// For now, just let the user copy this to clipboard
76+
const copy_msg = "Copy to Clipboard"
77+
vscode.window.showInformationMessage(path, copy_msg)
78+
.then(item => {
79+
if (item === copy_msg) {
80+
ncp.copy(path)
81+
}
82+
})
7683
}
7784

7885
function setInterpreter() {

0 commit comments

Comments
 (0)