@@ -30,14 +30,14 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
30
30
import { IEnvironmentService } from 'vs/platform/environment/common/environment' ;
31
31
import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration' ;
32
32
import { Extensions as ConfigurationExtensions , IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry' ;
33
- import { IQuickInputButton , IQuickInputService , IQuickPickItem } from 'vs/platform/quickinput/common/quickInput' ;
33
+ import { IQuickInputButton , IQuickInputService , IQuickPickItem , IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput' ;
34
34
import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry' ;
35
35
import { ContextKeyExpr , ContextKeyExpression , IContextKey , IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
36
36
import { ICommandService } from 'vs/platform/commands/common/commands' ;
37
37
import { getVirtualWorkspaceLocation } from 'vs/platform/workspace/common/virtualWorkspace' ;
38
38
import { Schemas } from 'vs/base/common/network' ;
39
39
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys' ;
40
- import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions' ;
40
+ import { IExtensionService , isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions' ;
41
41
import { EditSessionsLogService } from 'vs/workbench/contrib/editSessions/common/editSessionsLogService' ;
42
42
import { IViewContainersRegistry , Extensions as ViewExtensions , ViewContainerLocation , IViewsService } from 'vs/workbench/common/views' ;
43
43
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' ;
@@ -61,10 +61,14 @@ import { ILocalizedString } from 'vs/platform/action/common/action';
61
61
import { Codicon } from 'vs/base/common/codicons' ;
62
62
import { CancellationError } from 'vs/base/common/errors' ;
63
63
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
64
+ import { IExtensionsViewPaneContainer , VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions' ;
65
+ import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite' ;
66
+
64
67
65
68
registerSingleton ( IEditSessionsLogService , EditSessionsLogService , InstantiationType . Delayed ) ;
66
69
registerSingleton ( IEditSessionsStorageService , EditSessionsWorkbenchService , InstantiationType . Delayed ) ;
67
70
71
+
68
72
const continueWorkingOnCommand : IAction2Options = {
69
73
id : '_workbench.editSessions.actions.continueEditSession' ,
70
74
title : { value : localize ( 'continue working on' , "Continue Working On..." ) , original : 'Continue Working On...' } ,
@@ -82,6 +86,23 @@ const showOutputChannelCommand: IAction2Options = {
82
86
title : { value : localize ( 'show log' , 'Show Log' ) , original : 'Show Log' } ,
83
87
category : EDIT_SESSION_SYNC_CATEGORY
84
88
} ;
89
+ const installAdditionalContinueOnOptionsCommand = {
90
+ id : 'workbench.action.continueOn.extensions' ,
91
+ title : localize ( 'continueOn.installAdditional' , 'Install additional development environment options' ) ,
92
+ } ;
93
+ registerAction2 ( class extends Action2 {
94
+ constructor ( ) {
95
+ super ( { ...installAdditionalContinueOnOptionsCommand , f1 : false } ) ;
96
+ }
97
+
98
+ async run ( accessor : ServicesAccessor ) : Promise < void > {
99
+ const paneCompositePartService = accessor . get ( IPaneCompositePartService ) ;
100
+ const viewlet = await paneCompositePartService . openPaneComposite ( VIEWLET_ID , ViewContainerLocation . Sidebar , true ) ;
101
+ const view = viewlet ?. getViewPaneContainer ( ) as IExtensionsViewPaneContainer | undefined ;
102
+ view ?. search ( '@tag:continueOn' ) ;
103
+ }
104
+ } ) ;
105
+
85
106
const resumeProgressOptionsTitle = `[${ localize ( 'resuming working changes window' , 'Resuming working changes...' ) } ](command:${ showOutputChannelCommand . id } )` ;
86
107
const resumeProgressOptions = {
87
108
location : ProgressLocation . Window ,
@@ -124,6 +145,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
124
145
@IActivityService private readonly activityService : IActivityService ,
125
146
@IEditorService private readonly editorService : IEditorService ,
126
147
@IRemoteAgentService private readonly remoteAgentService : IRemoteAgentService ,
148
+ @IExtensionService private readonly extensionService : IExtensionService ,
127
149
) {
128
150
super ( ) ;
129
151
@@ -809,7 +831,8 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
809
831
if ( remoteGroup !== undefined ) {
810
832
MenuRegistry . appendMenuItem ( MenuId . StatusBarRemoteIndicatorMenu , {
811
833
group : remoteGroup ,
812
- command : command
834
+ command : command ,
835
+ when : command . precondition
813
836
} ) ;
814
837
}
815
838
}
@@ -851,14 +874,22 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
851
874
: this . contextService . getWorkspace ( ) . folders . map ( ( folder ) => folder . name ) . join ( ', ' ) ;
852
875
quickPick . placeholder = localize ( 'continueEditSessionPick.title.v2' , "Select a development environment to continue working on {0} in" , `'${ workspaceContext } '` ) ;
853
876
quickPick . items = this . createPickItems ( ) ;
877
+ this . extensionService . onDidChangeExtensions ( ( ) => {
878
+ quickPick . items = this . createPickItems ( ) ;
879
+ } ) ;
854
880
855
881
const command = await new Promise < string | undefined > ( ( resolve , reject ) => {
856
882
quickPick . onDidHide ( ( ) => resolve ( undefined ) ) ;
857
883
858
884
quickPick . onDidAccept ( ( e ) => {
859
885
const selection = quickPick . activeItems [ 0 ] . command ;
860
- resolve ( selection ) ;
861
- quickPick . hide ( ) ;
886
+
887
+ if ( selection === installAdditionalContinueOnOptionsCommand . id ) {
888
+ void this . commandService . executeCommand ( installAdditionalContinueOnOptionsCommand . id ) ;
889
+ } else {
890
+ resolve ( selection ) ;
891
+ quickPick . hide ( ) ;
892
+ }
862
893
} ) ;
863
894
864
895
quickPick . show ( ) ;
@@ -912,7 +943,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
912
943
}
913
944
}
914
945
915
- private createPickItems ( ) : ContinueEditSessionItem [ ] {
946
+ private createPickItems ( ) : ( ContinueEditSessionItem | IQuickPickSeparator ) [ ] {
916
947
const items = [ ...this . continueEditSessionOptions ] . filter ( ( option ) => option . when === undefined || this . contextKeyService . contextMatchesRules ( option . when ) ) ;
917
948
918
949
if ( getVirtualWorkspaceLocation ( this . contextService . getWorkspace ( ) ) !== undefined && isNative ) {
@@ -923,7 +954,8 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
923
954
) ) ;
924
955
}
925
956
926
- return items . sort ( ( item1 , item2 ) => item1 . label . localeCompare ( item2 . label ) ) ;
957
+ const sortedItems : ( ContinueEditSessionItem | IQuickPickSeparator ) [ ] = items . sort ( ( item1 , item2 ) => item1 . label . localeCompare ( item2 . label ) ) ;
958
+ return sortedItems . concat ( { type : 'separator' } , new ContinueEditSessionItem ( installAdditionalContinueOnOptionsCommand . title , installAdditionalContinueOnOptionsCommand . id ) ) ;
927
959
}
928
960
}
929
961
0 commit comments