Skip to content

Commit 0df7f16

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: Ensure python path is not set if already set in user settings (#369) Use 'an' rather than 'a' before vowel words (#373)
2 parents c8db345 + cc86d10 commit 0df7f16

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

snippets/python.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,15 @@
200200
"async def ${1:funcname}(${2:parameter_list}):",
201201
"\t${3:pass}"
202202
],
203-
"description": "Code snippet for a async statement"
203+
"description": "Code snippet for an async statement"
204204
},
205205
"async/for": {
206206
"prefix": "async/for",
207207
"body": [
208208
"async for ${1:target} in ${2:iter}:",
209209
"\t${3:block}"
210210
],
211-
"description": "Code snippet for a async for statement"
211+
"description": "Code snippet for an async for statement"
212212
},
213213
"async/for/else": {
214214
"prefix": "async/for/else",
@@ -218,15 +218,15 @@
218218
"else:",
219219
"\t${4:block}"
220220
],
221-
"description": "Code snippet for a async for statement with else"
221+
"description": "Code snippet for an async for statement with else"
222222
},
223223
"async/with": {
224224
"prefix": "async/with",
225225
"body": [
226226
"async with ${1:expr} as ${2:var}:",
227227
"\t${3:block}"
228228
],
229-
"description": "Code snippet for a async with statement"
229+
"description": "Code snippet for an async with statement"
230230
},
231231
"ipdb": {
232232
"prefix": "ipdb",

src/client/interpreter/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export class InterpreterManager implements Disposable {
4747
const interpreters = await this.interpreterProvider.getInterpreters(activeWorkspace.folderUri);
4848
const workspacePathUpper = activeWorkspace.folderUri.fsPath.toUpperCase();
4949
const interpretersInWorkspace = interpreters.filter(interpreter => interpreter.path.toUpperCase().startsWith(workspacePathUpper));
50-
if (interpretersInWorkspace.length !== 1) {
50+
// Always pick the first available one.
51+
if (interpretersInWorkspace.length === 0) {
5152
return;
5253
}
5354

@@ -73,6 +74,10 @@ export class InterpreterManager implements Disposable {
7374
}
7475
const pythonConfig = workspace.getConfiguration('python', activeWorkspace.folderUri);
7576
const pythonPathInConfig = pythonConfig.inspect<string>('pythonPath');
77+
// If we have a value in user settings, then don't auto set the interpreter path.
78+
if (pythonPathInConfig && pythonPathInConfig!.globalValue !== undefined && pythonPathInConfig!.globalValue !== 'python') {
79+
return false;
80+
}
7681
if (activeWorkspace.configTarget === ConfigurationTarget.Workspace) {
7782
return pythonPathInConfig.workspaceValue === undefined || pythonPathInConfig.workspaceValue === 'python';
7883
}

0 commit comments

Comments
 (0)