@@ -24,7 +24,7 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati
2424import { ITimelineService , TimelineChangeEvent , TimelineItem , TimelineOptions , TimelineProvidersChangeEvent , TimelineRequest , Timeline , TimelinePaneId } from 'vs/workbench/contrib/timeline/common/timeline' ;
2525import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
2626import { SideBySideEditor , toResource } from 'vs/workbench/common/editor' ;
27- import { ICommandService } from 'vs/platform/commands/common/commands' ;
27+ import { ICommandService , CommandsRegistry } from 'vs/platform/commands/common/commands' ;
2828import { IThemeService , LIGHT , ThemeIcon } from 'vs/platform/theme/common/themeService' ;
2929import { IViewDescriptorService } from 'vs/workbench/common/views' ;
3030import { basename } from 'vs/base/common/path' ;
@@ -34,7 +34,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
3434import { IActionViewItemProvider , ActionBar , ActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar' ;
3535import { IAction , ActionRunner } from 'vs/base/common/actions' ;
3636import { ContextAwareMenuEntryActionViewItem , createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem' ;
37- import { MenuItemAction , IMenuService , MenuId , registerAction2 , Action2 } from 'vs/platform/actions/common/actions' ;
37+ import { MenuItemAction , IMenuService , MenuId , registerAction2 , Action2 , MenuRegistry } from 'vs/platform/actions/common/actions' ;
3838import { fromNow } from 'vs/base/common/date' ;
3939import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
4040import { escapeRegExpCharacters } from 'vs/base/common/strings' ;
@@ -932,38 +932,35 @@ class TimelinePaneCommands extends Disposable {
932932 }
933933 } ) ) ;
934934
935- this . _register ( registerAction2 ( class extends Action2 {
936- constructor ( ) {
937- super ( {
938- id : 'timeline.toggleFollowActiveEditor' ,
939- title : { value : localize ( 'timeline.toggleFollowActiveEditorCommand' , "Toggle Active Editor Following" ) , original : 'Toggle Active Editor Following' } ,
940- category : { value : localize ( 'timeline' , "Timeline" ) , original : 'Timeline' } ,
941- menu : [ {
942- id : MenuId . TimelineTitle ,
943- command : {
944- // title: localize(`timeline.toggleFollowActiveEditorCommand.stop`, "Stop following the Active Editor"),
945- icon : { id : 'codicon/eye' }
946- } ,
947- group : 'navigation' ,
948- order : 98 ,
949- when : TimelineFollowActiveEditorContext
950- } ,
951- {
952- id : MenuId . TimelineTitle ,
953- command : {
954- // title: localize(`ToggleFollowActiveEditorCommand.follow`, "Follow the Active Editor"),
955- icon : { id : 'codicon/eye-closed' }
956- } ,
957- group : 'navigation' ,
958- order : 98 ,
959- when : TimelineFollowActiveEditorContext . toNegated ( )
960- } ]
961- } ) ;
962- }
963- run ( accessor : ServicesAccessor , ...args : any [ ] ) {
964- pane . followActiveEditor = ! pane . followActiveEditor ;
965- }
966- } ) ) ;
935+ this . _register ( CommandsRegistry . registerCommand ( 'timeline.toggleFollowActiveEditor' ,
936+ ( accessor : ServicesAccessor , ...args : any [ ] ) => pane . followActiveEditor = ! pane . followActiveEditor
937+ ) ) ;
938+
939+ this . _register ( MenuRegistry . appendMenuItem ( MenuId . TimelineTitle , ( {
940+ command : {
941+ id : 'timeline.toggleFollowActiveEditor' ,
942+ title : { value : localize ( 'timeline.toggleFollowActiveEditorCommand' , "Toggle Active Editor Following" ) , original : 'Toggle Active Editor Following' } ,
943+ // title: localize(`timeline.toggleFollowActiveEditorCommand.stop`, "Stop following the Active Editor"),
944+ icon : { id : 'codicon/eye' } ,
945+ category : { value : localize ( 'timeline' , "Timeline" ) , original : 'Timeline' } ,
946+ } ,
947+ group : 'navigation' ,
948+ order : 98 ,
949+ when : TimelineFollowActiveEditorContext
950+ } ) ) ) ;
951+
952+ this . _register ( MenuRegistry . appendMenuItem ( MenuId . TimelineTitle , ( {
953+ command : {
954+ id : 'timeline.toggleFollowActiveEditor' ,
955+ title : { value : localize ( 'timeline.toggleFollowActiveEditorCommand' , "Toggle Active Editor Following" ) , original : 'Toggle Active Editor Following' } ,
956+ // title: localize(`timeline.toggleFollowActiveEditorCommand.stop`, "Stop following the Active Editor"),
957+ icon : { id : 'codicon/eye-closed' } ,
958+ category : { value : localize ( 'timeline' , "Timeline" ) , original : 'Timeline' } ,
959+ } ,
960+ group : 'navigation' ,
961+ order : 98 ,
962+ when : TimelineFollowActiveEditorContext . toNegated ( )
963+ } ) ) ) ;
967964
968965 this . _register ( timelineService . onDidChangeProviders ( ( ) => this . updateTimelineSourceFilters ( ) ) ) ;
969966 this . updateTimelineSourceFilters ( ) ;
0 commit comments