File tree Expand file tree Collapse file tree
pythonEnvironments/creation/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ export namespace Common {
9797 export const useCommandPrompt = localize ( 'Common.useCommandPrompt' , 'Use Command Prompt' ) ;
9898 export const download = localize ( 'Common.download' , 'Download' ) ;
9999 export const showLogs = localize ( 'Common.showLogs' , 'Show logs' ) ;
100+ export const openFolder = localize ( 'Common.openFolder' , 'Open Folder...' ) ;
100101}
101102
102103export namespace CommonSurvey {
@@ -567,7 +568,7 @@ export namespace CreateEnv {
567568
568569 export const noWorkspace = localize (
569570 'createEnv.noWorkspace' ,
570- 'Please open a directory when creating an environment using venv.' ,
571+ 'Please open a folder when creating an environment using venv.' ,
571572 ) ;
572573
573574 export const pickWorkspacePlaceholder = localize (
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ import * as path from 'path';
66import { CancellationToken , QuickPickItem , WorkspaceFolder } from 'vscode' ;
77import { showErrorMessage , showQuickPick } from '../../../common/vscodeApis/windowApis' ;
88import { 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' ;
1011
1112function hasVirtualEnv ( workspace : WorkspaceFolder ) : Promise < boolean > {
1213 return Promise . race ( [
@@ -39,7 +40,10 @@ export async function pickWorkspaceFolder(
3940 const workspaces = getWorkspaceFolders ( ) ;
4041
4142 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+ }
4347 return undefined ;
4448 }
4549
You can’t perform that action at this time.
0 commit comments