@@ -8,27 +8,23 @@ import * as nls from 'vs/nls';
8
8
import * as dom from 'vs/base/browser/dom' ;
9
9
import { basename } from 'vs/base/common/resources' ;
10
10
import { isCodeEditor , isDiffEditor } from 'vs/editor/browser/editorBrowser' ;
11
- import { IInstantiationService , ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
11
+ import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
12
12
import { IThemeService } from 'vs/platform/theme/common/themeService' ;
13
13
import { CommentNode , ResourceWithCommentThreads , ICommentThreadChangedEvent } from 'vs/workbench/contrib/comments/common/commentModel' ;
14
14
import { IWorkspaceCommentThreadsEvent , ICommentService } from 'vs/workbench/contrib/comments/browser/commentService' ;
15
15
import { IEditorService , ACTIVE_GROUP , SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService' ;
16
- import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
17
16
import { textLinkForeground , textLinkActiveForeground , focusBorder , textPreformatForeground } from 'vs/platform/theme/common/colorRegistry' ;
18
17
import { ResourceLabels } from 'vs/workbench/browser/labels' ;
19
- import { CommentsList , COMMENTS_VIEW_ID , COMMENTS_VIEW_TITLE , Filter } from 'vs/workbench/contrib/comments/browser/commentsTreeViewer' ;
20
- import { IViewPaneOptions , ViewAction , FilterViewPane } from 'vs/workbench/browser/parts/views/viewPane' ;
18
+ import { CommentsList , COMMENTS_VIEW_TITLE , Filter } from 'vs/workbench/contrib/comments/browser/commentsTreeViewer' ;
19
+ import { IViewPaneOptions , FilterViewPane } from 'vs/workbench/browser/parts/views/viewPane' ;
21
20
import { IViewDescriptorService } from 'vs/workbench/common/views' ;
22
- import { IViewsService } from 'vs/workbench/services/views/common/viewsService' ;
23
21
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
24
- import { ContextKeyExpr , IContextKey , IContextKeyService , RawContextKey } from 'vs/platform/contextkey/common/contextkey' ;
22
+ import { IContextKey , IContextKeyService , RawContextKey } from 'vs/platform/contextkey/common/contextkey' ;
25
23
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView' ;
26
24
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
27
25
import { IOpenerService } from 'vs/platform/opener/common/opener' ;
28
26
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
29
27
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity' ;
30
- import { MenuId , registerAction2 } from 'vs/platform/actions/common/actions' ;
31
- import { Codicon } from 'vs/base/common/codicons' ;
32
28
import { IEditor } from 'vs/editor/common/editorCommon' ;
33
29
import { TextModel } from 'vs/editor/common/model/textModel' ;
34
30
import { CommentsViewFilterFocusContextKey , ICommentsView } from 'vs/workbench/contrib/comments/browser/comments' ;
@@ -44,8 +40,8 @@ import { Range } from 'vs/editor/common/core/range';
44
40
import { registerNavigableContainer } from 'vs/workbench/browser/actions/widgetNavigationCommands' ;
45
41
import { CommentsModel , ICommentsModel } from 'vs/workbench/contrib/comments/browser/commentsModel' ;
46
42
47
- const CONTEXT_KEY_HAS_COMMENTS = new RawContextKey < boolean > ( 'commentsView.hasComments' , false ) ;
48
- const CONTEXT_KEY_SOME_COMMENTS_EXPANDED = new RawContextKey < boolean > ( 'commentsView.someCommentsExpanded' , false ) ;
43
+ export const CONTEXT_KEY_HAS_COMMENTS = new RawContextKey < boolean > ( 'commentsView.hasComments' , false ) ;
44
+ export const CONTEXT_KEY_SOME_COMMENTS_EXPANDED = new RawContextKey < boolean > ( 'commentsView.someCommentsExpanded' , false ) ;
49
45
const VIEW_STORAGE_ID = 'commentsViewState' ;
50
46
51
47
function createResourceCommentsIterator ( model : ICommentsModel ) : Iterable < ITreeElement < ResourceWithCommentThreads | CommentNode > > {
@@ -505,53 +501,3 @@ export class CommentsPanel extends FilterViewPane implements ICommentsView {
505
501
return false ;
506
502
}
507
503
}
508
-
509
- CommandsRegistry . registerCommand ( {
510
- id : 'workbench.action.focusCommentsPanel' ,
511
- handler : async ( accessor ) => {
512
- const viewsService = accessor . get ( IViewsService ) ;
513
- viewsService . openView ( COMMENTS_VIEW_ID , true ) ;
514
- }
515
- } ) ;
516
-
517
- registerAction2 ( class Collapse extends ViewAction < CommentsPanel > {
518
- constructor ( ) {
519
- super ( {
520
- viewId : COMMENTS_VIEW_ID ,
521
- id : 'comments.collapse' ,
522
- title : nls . localize ( 'collapseAll' , "Collapse All" ) ,
523
- f1 : false ,
524
- icon : Codicon . collapseAll ,
525
- menu : {
526
- id : MenuId . ViewTitle ,
527
- group : 'navigation' ,
528
- when : ContextKeyExpr . and ( ContextKeyExpr . and ( ContextKeyExpr . equals ( 'view' , COMMENTS_VIEW_ID ) , CONTEXT_KEY_HAS_COMMENTS ) , CONTEXT_KEY_SOME_COMMENTS_EXPANDED ) ,
529
- order : 100
530
- }
531
- } ) ;
532
- }
533
- runInView ( _accessor : ServicesAccessor , view : CommentsPanel ) {
534
- view . collapseAll ( ) ;
535
- }
536
- } ) ;
537
-
538
- registerAction2 ( class Expand extends ViewAction < CommentsPanel > {
539
- constructor ( ) {
540
- super ( {
541
- viewId : COMMENTS_VIEW_ID ,
542
- id : 'comments.expand' ,
543
- title : nls . localize ( 'expandAll' , "Expand All" ) ,
544
- f1 : false ,
545
- icon : Codicon . expandAll ,
546
- menu : {
547
- id : MenuId . ViewTitle ,
548
- group : 'navigation' ,
549
- when : ContextKeyExpr . and ( ContextKeyExpr . and ( ContextKeyExpr . equals ( 'view' , COMMENTS_VIEW_ID ) , CONTEXT_KEY_HAS_COMMENTS ) , ContextKeyExpr . not ( CONTEXT_KEY_SOME_COMMENTS_EXPANDED . key ) ) ,
550
- order : 100
551
- }
552
- } ) ;
553
- }
554
- runInView ( _accessor : ServicesAccessor , view : CommentsPanel ) {
555
- view . expandAll ( ) ;
556
- }
557
- } ) ;
0 commit comments