@@ -35,7 +35,6 @@ import { InstantiationType, registerSingleton } from '../../../../platform/insta
3535import { IInstantiationService , ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js' ;
3636import * as jsonContributionRegistry from '../../../../platform/jsonschemas/common/jsonContributionRegistry.js' ;
3737import { INotificationService , Severity } from '../../../../platform/notification/common/notification.js' ;
38- import { ILogService } from '../../../../platform/log/common/log.js' ;
3938import product from '../../../../platform/product/common/product.js' ;
4039import { IProductService } from '../../../../platform/product/common/productService.js' ;
4140import { ProgressLocation } from '../../../../platform/progress/common/progress.js' ;
@@ -66,7 +65,7 @@ import { ILanguageModelToolsService } from '../../chat/common/languageModelTools
6665import { CONTEXT_KEYBINDINGS_EDITOR } from '../../preferences/common/preferences.js' ;
6766import { IWebview } from '../../webview/browser/webview.js' ;
6867import { Query } from '../common/extensionQuery.js' ;
69- import { AutoRestartConfigurationKey , AutoUpdateConfigurationKey , CONTEXT_EXTENSIONS_GALLERY_STATUS , CONTEXT_HAS_GALLERY , DefaultViewsContext , ExtensionEditorTab , ExtensionRuntimeActionType , EXTENSIONS_CATEGORY , extensionsFilterSubMenu , extensionsSearchActionsMenu , HasOutdatedExtensionsContext , IExtensionArg , IExtensionsViewPaneContainer , IExtensionsWorkbenchService , INSTALL_ACTIONS_GROUP , INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID , INSTALL_DEFAULT_EXTENSIONS_COMMAND_ID , IWorkspaceRecommendedExtensionsView , LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID , OUTDATED_EXTENSIONS_VIEW_ID , SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID , THEME_ACTIONS_GROUP , TOGGLE_IGNORE_EXTENSION_ACTION_ID , UPDATE_ACTIONS_GROUP , VIEWLET_ID , WORKSPACE_RECOMMENDATIONS_VIEW_ID } from '../common/extensions.js' ;
68+ import { AutoRestartConfigurationKey , AutoUpdateConfigurationKey , CONTEXT_EXTENSIONS_GALLERY_STATUS , CONTEXT_HAS_GALLERY , DefaultViewsContext , ExtensionEditorTab , ExtensionRuntimeActionType , EXTENSIONS_CATEGORY , extensionsFilterSubMenu , extensionsSearchActionsMenu , HasOutdatedExtensionsContext , IExtensionArg , IExtensionsViewPaneContainer , IExtensionsWorkbenchService , INSTALL_ACTIONS_GROUP , INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID , IWorkspaceRecommendedExtensionsView , LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID , OUTDATED_EXTENSIONS_VIEW_ID , SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID , THEME_ACTIONS_GROUP , TOGGLE_IGNORE_EXTENSION_ACTION_ID , UPDATE_ACTIONS_GROUP , VIEWLET_ID , WORKSPACE_RECOMMENDATIONS_VIEW_ID } from '../common/extensions.js' ;
7069import { ExtensionsConfigurationSchema , ExtensionsConfigurationSchemaId } from '../common/extensionsFileTemplate.js' ;
7170import { ExtensionsInput } from '../common/extensionsInput.js' ;
7271import { KeymapExtensions } from '../common/extensionsUtils.js' ;
@@ -926,115 +925,6 @@ class ExtensionsContributions extends Disposable implements IWorkbenchContributi
926925 }
927926 } ) ;
928927
929- this . registerExtensionAction ( {
930- id : INSTALL_DEFAULT_EXTENSIONS_COMMAND_ID ,
931- title : localize ( 'installDefaultExtensions' , "Install Default Extensions" ) ,
932- run : async ( accessor : ServicesAccessor ) => {
933- const extensionsWorkbenchService = accessor . get ( IExtensionsWorkbenchService ) ;
934- const hostService = accessor . get ( IHostService ) ;
935- const notificationService = accessor . get ( INotificationService ) ;
936- const logService = accessor . get ( ILogService ) ;
937- logService . info ( '++++ !!!!!!!! InstallDefaultExtensions' ) ;
938-
939- // Read extension paths from environment variable
940- // Use DEFAULT_EXTENSIONS_NEW to match the server-side installer
941- const defaultExtensionsEnv = typeof process !== 'undefined' && process . env ? process . env [ 'DEFAULT_EXTENSIONS_NEW' ] : undefined ;
942- logService . info ( '++++ !!!!!!!! InstallDefaultExtensions +++ defaultExtensionsEnv ' , defaultExtensionsEnv ) ;
943- if ( ! defaultExtensionsEnv ) {
944- logService . info ( 'InstallDefaultExtensions: DEFAULT_EXTENSIONS_NEW environment variable not set' ) ;
945- notificationService . info ( localize ( 'noDefaultExtensions' , "No default extensions to install. DEFAULT_EXTENSIONS_NEW environment variable is not set." ) ) ;
946- return ;
947- } else {
948- logService . info ( '++++ !!!!!!!! InstallDefaultExtensions +++ EXIST defaultExtensionsEnv ' , defaultExtensionsEnv ) ;
949- }
950-
951- const extensionPaths = defaultExtensionsEnv . split ( ';' ) . filter ( p => p . trim ( ) ) ;
952- if ( extensionPaths . length === 0 ) {
953- logService . info ( 'InstallDefaultExtensions: No extensions to install' ) ;
954- notificationService . info ( localize ( 'noDefaultExtensionsPaths' , "No default extensions to install." ) ) ;
955- return ;
956- }
957-
958- logService . info ( `InstallDefaultExtensions: Installing ${ extensionPaths . length } default extension(s) from environment variable` ) ;
959-
960- // Convert paths to URIs
961- const vsixs = extensionPaths
962- . filter ( p => p . trim ( ) )
963- . map ( p => URI . file ( p . trim ( ) ) ) ;
964-
965- if ( vsixs . length === 0 ) {
966- return ;
967- }
968-
969- // Install all extensions in parallel (same as installFromVSIX command)
970- const result = await Promise . allSettled ( vsixs . map ( async ( vsix ) => {
971- logService . info ( `InstallDefaultExtensions: Installing extension from ${ vsix . fsPath } ` ) ;
972- return await extensionsWorkbenchService . install ( vsix , { installGivenVersion : true } ) ;
973- } ) ) ;
974-
975- let error : Error | undefined , requireReload = false , requireRestart = false ;
976- const successful : number [ ] = [ ] ;
977- const failed : number [ ] = [ ] ;
978-
979- for ( let i = 0 ; i < result . length ; i ++ ) {
980- const r = result [ i ] ;
981- if ( r . status === 'rejected' ) {
982- failed . push ( i ) ;
983- logService . error ( `InstallDefaultExtensions: Failed to install extension from ${ vsixs [ i ] . fsPath } ` , r . reason ) ;
984- if ( ! error ) {
985- error = new Error ( r . reason ) ;
986- }
987- } else {
988- successful . push ( i ) ;
989- requireReload = requireReload || r . value . runtimeState ?. action === ExtensionRuntimeActionType . ReloadWindow ;
990- requireRestart = requireRestart || r . value . runtimeState ?. action === ExtensionRuntimeActionType . RestartExtensions ;
991- }
992- }
993-
994- if ( error && successful . length === 0 ) {
995- // All failed
996- notificationService . error ( localize ( 'installDefaultExtensionsFailed' , "Failed to install default extensions: {0}" , error . message ) ) ;
997- return ;
998- }
999-
1000- if ( failed . length > 0 ) {
1001- // Some failed
1002- notificationService . warn ( localize ( 'installDefaultExtensionsPartial' , "Installed {0} of {1} default extensions. {2} failed." , successful . length , vsixs . length , failed . length ) ) ;
1003- }
1004-
1005- if ( requireReload ) {
1006- notificationService . prompt (
1007- Severity . Info ,
1008- successful . length > 1 ? localize ( 'InstallDefaultExtensions.successReload' , "Completed installing {0} default extensions. Please reload Visual Studio Code to enable them." , successful . length )
1009- : localize ( 'InstallDefaultExtension.successReload' , "Completed installing default extension. Please reload Visual Studio Code to enable it." ) ,
1010- [ {
1011- label : localize ( 'InstallVSIXAction.reloadNow' , "Reload Now" ) ,
1012- run : ( ) => hostService . reload ( )
1013- } ]
1014- ) ;
1015- }
1016- else if ( requireRestart ) {
1017- notificationService . prompt (
1018- Severity . Info ,
1019- successful . length > 1 ? localize ( 'InstallDefaultExtensions.successRestart' , "Completed installing {0} default extensions. Please restart extensions to enable them." , successful . length )
1020- : localize ( 'InstallDefaultExtension.successRestart' , "Completed installing default extension. Please restart extensions to enable it." ) ,
1021- [ {
1022- label : localize ( 'InstallVSIXAction.restartExtensions' , "Restart Extensions" ) ,
1023- run : ( ) => extensionsWorkbenchService . updateRunningExtensions ( )
1024- } ]
1025- ) ;
1026- }
1027- else if ( successful . length > 0 ) {
1028- notificationService . prompt (
1029- Severity . Info ,
1030- successful . length > 1 ? localize ( 'InstallDefaultExtensions.successNoReload' , "Completed installing {0} default extensions." , successful . length )
1031- : localize ( 'InstallDefaultExtension.successNoReload' , "Completed installing default extension." ) ,
1032- [ ]
1033- ) ;
1034- }
1035- }
1036- } ) ;
1037-
1038928 this . registerExtensionAction ( {
1039929 id : 'workbench.extensions.action.installExtensionFromLocation' ,
1040930 title : localize2 ( 'installExtensionFromLocation' , 'Install Extension from Location...' ) ,
0 commit comments