File tree 2 files changed +8
-3
lines changed
pythonEnvironments/creation/common 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ export namespace Common {
97
97
export const useCommandPrompt = localize ( 'Common.useCommandPrompt' , 'Use Command Prompt' ) ;
98
98
export const download = localize ( 'Common.download' , 'Download' ) ;
99
99
export const showLogs = localize ( 'Common.showLogs' , 'Show logs' ) ;
100
+ export const openFolder = localize ( 'Common.openFolder' , 'Open Folder...' ) ;
100
101
}
101
102
102
103
export namespace CommonSurvey {
@@ -567,7 +568,7 @@ export namespace CreateEnv {
567
568
568
569
export const noWorkspace = localize (
569
570
'createEnv.noWorkspace' ,
570
- 'Please open a directory when creating an environment using venv.' ,
571
+ 'Please open a folder when creating an environment using venv.' ,
571
572
) ;
572
573
573
574
export const pickWorkspacePlaceholder = localize (
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ import * as path from 'path';
6
6
import { CancellationToken , QuickPickItem , WorkspaceFolder } from 'vscode' ;
7
7
import { showErrorMessage , showQuickPick } from '../../../common/vscodeApis/windowApis' ;
8
8
import { getWorkspaceFolders } from '../../../common/vscodeApis/workspaceApis' ;
9
- import { CreateEnv } from '../../../common/utils/localize' ;
9
+ import { Common , CreateEnv } from '../../../common/utils/localize' ;
10
+ import { executeCommand } from '../../../common/vscodeApis/commandApis' ;
10
11
11
12
function hasVirtualEnv ( workspace : WorkspaceFolder ) : Promise < boolean > {
12
13
return Promise . race ( [
@@ -39,7 +40,10 @@ export async function pickWorkspaceFolder(
39
40
const workspaces = getWorkspaceFolders ( ) ;
40
41
41
42
if ( ! workspaces || workspaces . length === 0 ) {
42
- showErrorMessage ( CreateEnv . noWorkspace ) ;
43
+ const result = await showErrorMessage ( CreateEnv . noWorkspace , Common . openFolder ) ;
44
+ if ( result === Common . openFolder ) {
45
+ await executeCommand ( 'vscode.openFolder' ) ;
46
+ }
43
47
return undefined ;
44
48
}
45
49
You can’t perform that action at this time.
0 commit comments