File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import {} from '../common/errors/utils';
2121import { pickEnvironment } from '../common/pickers/environments' ;
2222import { pickCreator , pickEnvironmentManager , pickPackageManager } from '../common/pickers/managers' ;
2323import { pickProject , pickProjectMany } from '../common/pickers/projects' ;
24- import { activeTextEditor , showErrorMessage } from '../common/window.apis' ;
24+ import { activeTextEditor , showErrorMessage , showInformationMessage } from '../common/window.apis' ;
2525import { quoteArgs } from './execution/execUtils' ;
2626import { runAsTask } from './execution/runAsTask' ;
2727import { runInTerminal } from './terminal/runInTerminal' ;
@@ -271,6 +271,16 @@ export async function setEnvironmentCommand(
271271 } ) ;
272272
273273 if ( selected ) {
274+ // Check if the selected environment is already the current one
275+ // Only show notification when we have exactly one project and it already has this environment
276+ if ( uris . length === 1 ) {
277+ const currentEnv = await em . getEnvironment ( uris [ 0 ] ) ;
278+ if ( currentEnv ?. envId . id === selected . envId . id ) {
279+ // The environment is already selected for this project
280+ showInformationMessage ( 'This environment is already selected for the workspace.' ) ;
281+ return ;
282+ }
283+ }
274284 await em . setEnvironments ( uris , selected ) ;
275285 }
276286 } else {
You can’t perform that action at this time.
0 commit comments