@codingame/monaco-vscode-comments-service-override 11.1.2 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export { default } from 'vscode/service-override/comments';
1
+ import { type IEditorOverrideServices } from "vscode/vscode/vs/editor/standalone/browser/standaloneServices";
2
+ export default function getServiceOverride(): IEditorOverrideServices;
package/index.js CHANGED
@@ -1 +1,14 @@
1
- export { default } from './comments.js';
1
+
2
+ import 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
3
+ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
4
+ import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService.service';
5
+ import { CommentService } from './vscode/src/vs/workbench/contrib/comments/browser/commentService.js';
6
+ import './vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js';
7
+
8
+ function getServiceOverride() {
9
+ return {
10
+ [ICommentService.toString()]: new SyncDescriptor(CommentService, [], true)
11
+ };
12
+ }
13
+
14
+ export { getServiceOverride as default };
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-comments-service-override",
3
- "version": "11.1.2",
3
+ "version": "12.0.0",
4
+ "private": false,
5
+ "description": "VSCode public API plugged on the monaco editor - comments service-override",
4
6
  "keywords": [],
5
7
  "author": {
6
8
  "name": "CodinGame",
@@ -12,8 +14,22 @@
12
14
  "url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
13
15
  },
14
16
  "type": "module",
15
- "private": false,
16
- "description": "VSCode public API plugged on the monaco editor - comments service-override",
17
+ "dependencies": {
18
+ "@codingame/monaco-vscode-219d9a5f-b446-507b-a188-1178a0867c75-common": "12.0.0",
19
+ "@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common": "12.0.0",
20
+ "@codingame/monaco-vscode-9ee79c1a-3f03-568b-8eac-b02513a98b68-common": "12.0.0",
21
+ "@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common": "12.0.0",
22
+ "@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common": "12.0.0",
23
+ "vscode": "npm:@codingame/monaco-vscode-api@12.0.0"
24
+ },
25
+ "peerDependencies": {
26
+ "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common": "12.0.0"
27
+ },
28
+ "peerDependenciesMeta": {
29
+ "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common": {
30
+ "optional": true
31
+ }
32
+ },
17
33
  "main": "index.js",
18
34
  "module": "index.js",
19
35
  "types": "index.d.ts",
@@ -22,12 +38,12 @@
22
38
  "default": "./index.js"
23
39
  },
24
40
  "./vscode/*": {
25
- "default": "./vscode/src/*.js"
41
+ "default": "./vscode/src/*.js",
42
+ "types": "./vscode/src/*.d.ts"
43
+ },
44
+ "./*": {
45
+ "default": "./*.js",
46
+ "types": "./*.d.ts"
26
47
  }
27
- },
28
- "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@11.1.2",
30
- "@codingame/monaco-vscode-chat-comments-extensions-interactive-notebook-search-common": "11.1.2",
31
- "@codingame/monaco-vscode-comments-extensions-common": "11.1.2"
32
48
  }
33
49
  }
@@ -0,0 +1,18 @@
1
+ import { IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { Comment } from "vscode/vscode/vs/editor/common/languages";
3
+ import { IMenu } from "vscode/vscode/vs/platform/actions/common/actions";
4
+ import { IMenuService } from "vscode/vscode/vs/platform/actions/common/actions.service";
5
+ import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
6
+ export declare class CommentMenus implements IDisposable {
7
+ private readonly menuService;
8
+ constructor(menuService: IMenuService);
9
+ getCommentThreadTitleActions(contextKeyService: IContextKeyService): IMenu;
10
+ getCommentThreadActions(contextKeyService: IContextKeyService): IMenu;
11
+ getCommentEditorActions(contextKeyService: IContextKeyService): IMenu;
12
+ getCommentThreadAdditionalActions(contextKeyService: IContextKeyService): IMenu;
13
+ getCommentTitleActions(comment: Comment, contextKeyService: IContextKeyService): IMenu;
14
+ getCommentActions(comment: Comment, contextKeyService: IContextKeyService): IMenu;
15
+ getCommentThreadTitleContextActions(contextKeyService: IContextKeyService): IMenu;
16
+ private getMenu;
17
+ dispose(): void;
18
+ }
@@ -1,7 +1,7 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
3
4
  import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
4
- import { createAndFillInContextMenuActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
5
5
 
6
6
  let CommentMenus = class CommentMenus {
7
7
  constructor(menuService) {
@@ -17,7 +17,7 @@ let CommentMenus = class CommentMenus {
17
17
  return this.getMenu(MenuId.CommentEditorActions, contextKeyService);
18
18
  }
19
19
  getCommentThreadAdditionalActions(contextKeyService) {
20
- return this.getMenu(MenuId.CommentThreadAdditionalActions, contextKeyService);
20
+ return this.getMenu(MenuId.CommentThreadAdditionalActions, contextKeyService, { emitEventsForSubmenuChanges: true });
21
21
  }
22
22
  getCommentTitleActions(comment, contextKeyService) {
23
23
  return this.getMenu(MenuId.CommentTitle, contextKeyService);
@@ -28,13 +28,8 @@ let CommentMenus = class CommentMenus {
28
28
  getCommentThreadTitleContextActions(contextKeyService) {
29
29
  return this.getMenu(MenuId.CommentThreadTitleContext, contextKeyService);
30
30
  }
31
- getMenu(menuId, contextKeyService) {
32
- const menu = this.menuService.createMenu(menuId, contextKeyService);
33
- const primary = [];
34
- const secondary = [];
35
- const result = { primary, secondary };
36
- createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, result, 'inline');
37
- return menu;
31
+ getMenu(menuId, contextKeyService, options) {
32
+ return this.menuService.createMenu(menuId, contextKeyService, options);
38
33
  }
39
34
  dispose() {
40
35
  }
@@ -0,0 +1,159 @@
1
+ import { CommentThreadChangedEvent, CommentInfo, Comment, CommentReaction, CommentingRanges, CommentThread, CommentOptions, PendingCommentThread, CommentingRangeResourceHint } from "vscode/vscode/vs/editor/common/languages";
2
+ import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
3
+ import { Event } from "vscode/vscode/vs/base/common/event";
4
+ import { Disposable, IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
5
+ import { URI, UriComponents } from "vscode/vscode/vs/base/common/uri";
6
+ import { Range, IRange } from "vscode/vscode/vs/editor/common/core/range";
7
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
8
+ import { ICommentThreadChangedEvent } from "@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/common/commentModel";
9
+ import { CommentMenus } from "./commentMenus.js";
10
+ import { ICellRange } from "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/common/notebookRange";
11
+ import { IWorkbenchLayoutService } from "vscode/vscode/vs/workbench/services/layout/browser/layoutService.service";
12
+ import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
13
+ import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
14
+ import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
15
+ import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
16
+ import { ICommentsModel } from "@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsModel";
17
+ import { IModelService } from "vscode/vscode/vs/editor/common/services/model";
18
+ import { ICommentService } from "vscode/vscode/vs/workbench/contrib/comments/browser/commentService.service";
19
+ export interface IResourceCommentThreadEvent {
20
+ resource: URI;
21
+ commentInfos: ICommentInfo[];
22
+ }
23
+ export interface ICommentInfo<T = IRange> extends CommentInfo<T> {
24
+ uniqueOwner: string;
25
+ label?: string;
26
+ }
27
+ export interface INotebookCommentInfo {
28
+ extensionId?: string;
29
+ threads: CommentThread<ICellRange>[];
30
+ uniqueOwner: string;
31
+ label?: string;
32
+ }
33
+ export interface IWorkspaceCommentThreadsEvent {
34
+ ownerId: string;
35
+ ownerLabel: string;
36
+ commentThreads: CommentThread[];
37
+ }
38
+ export interface INotebookCommentThreadChangedEvent extends CommentThreadChangedEvent<ICellRange> {
39
+ uniqueOwner: string;
40
+ }
41
+ export interface ICommentController {
42
+ id: string;
43
+ label: string;
44
+ features: {
45
+ reactionGroup?: CommentReaction[];
46
+ reactionHandler?: boolean;
47
+ options?: CommentOptions;
48
+ };
49
+ options?: CommentOptions;
50
+ contextValue?: string;
51
+ owner: string;
52
+ activeComment: {
53
+ thread: CommentThread;
54
+ comment?: Comment;
55
+ } | undefined;
56
+ createCommentThreadTemplate(resource: UriComponents, range: IRange | undefined, editorId?: string): Promise<void>;
57
+ updateCommentThreadTemplate(threadHandle: number, range: IRange): Promise<void>;
58
+ deleteCommentThreadMain(commentThreadId: string): void;
59
+ toggleReaction(uri: URI, thread: CommentThread, comment: Comment, reaction: CommentReaction, token: CancellationToken): Promise<void>;
60
+ getDocumentComments(resource: URI, token: CancellationToken): Promise<ICommentInfo<IRange>>;
61
+ getNotebookComments(resource: URI, token: CancellationToken): Promise<INotebookCommentInfo>;
62
+ setActiveCommentAndThread(commentInfo: {
63
+ thread: CommentThread;
64
+ comment?: Comment;
65
+ } | undefined): Promise<void>;
66
+ }
67
+ export interface IContinueOnCommentProvider {
68
+ provideContinueOnComments(): PendingCommentThread[];
69
+ }
70
+ export declare class CommentService extends Disposable implements ICommentService {
71
+ protected readonly instantiationService: IInstantiationService;
72
+ private readonly layoutService;
73
+ private readonly configurationService;
74
+ private readonly storageService;
75
+ private readonly logService;
76
+ private readonly modelService;
77
+ readonly _serviceBrand: undefined;
78
+ private readonly _onDidSetDataProvider;
79
+ readonly onDidSetDataProvider: Event<void>;
80
+ private readonly _onDidDeleteDataProvider;
81
+ readonly onDidDeleteDataProvider: Event<string | undefined>;
82
+ private readonly _onDidSetResourceCommentInfos;
83
+ readonly onDidSetResourceCommentInfos: Event<IResourceCommentThreadEvent>;
84
+ private readonly _onDidSetAllCommentThreads;
85
+ readonly onDidSetAllCommentThreads: Event<IWorkspaceCommentThreadsEvent>;
86
+ private readonly _onDidUpdateCommentThreads;
87
+ readonly onDidUpdateCommentThreads: Event<ICommentThreadChangedEvent>;
88
+ private readonly _onDidUpdateNotebookCommentThreads;
89
+ readonly onDidUpdateNotebookCommentThreads: Event<INotebookCommentThreadChangedEvent>;
90
+ private readonly _onDidUpdateCommentingRanges;
91
+ readonly onDidUpdateCommentingRanges: Event<{
92
+ uniqueOwner: string;
93
+ }>;
94
+ private readonly _onDidChangeActiveEditingCommentThread;
95
+ readonly onDidChangeActiveEditingCommentThread: Event<CommentThread<IRange> | null>;
96
+ private readonly _onDidChangeCurrentCommentThread;
97
+ readonly onDidChangeCurrentCommentThread: Event<CommentThread<IRange> | undefined>;
98
+ private readonly _onDidChangeCommentingEnabled;
99
+ readonly onDidChangeCommentingEnabled: Event<boolean>;
100
+ private readonly _onDidChangeActiveCommentingRange;
101
+ readonly onDidChangeActiveCommentingRange: Event<{
102
+ range: Range;
103
+ commentingRangesInfo: CommentingRanges;
104
+ }>;
105
+ private _commentControls;
106
+ private _commentMenus;
107
+ private _isCommentingEnabled;
108
+ private _workspaceHasCommenting;
109
+ private _continueOnComments;
110
+ private _continueOnCommentProviders;
111
+ private readonly _commentsModel;
112
+ readonly commentsModel: ICommentsModel;
113
+ private _commentingRangeResources;
114
+ private _commentingRangeResourceHintSchemes;
115
+ constructor(instantiationService: IInstantiationService, layoutService: IWorkbenchLayoutService, configurationService: IConfigurationService, contextKeyService: IContextKeyService, storageService: IStorageService, logService: ILogService, modelService: IModelService);
116
+ private _updateResourcesWithCommentingRanges;
117
+ private _handleConfiguration;
118
+ private _handleZenMode;
119
+ private get _defaultCommentingEnablement();
120
+ get isCommentingEnabled(): boolean;
121
+ enableCommenting(enable: boolean): void;
122
+ setCurrentCommentThread(commentThread: CommentThread | undefined): void;
123
+ setActiveEditingCommentThread(commentThread: CommentThread | null): void;
124
+ get lastActiveCommentcontroller(): ICommentController | undefined;
125
+ private _lastActiveCommentController;
126
+ setActiveCommentAndThread(uniqueOwner: string, commentInfo: {
127
+ thread: CommentThread<IRange>;
128
+ comment?: Comment;
129
+ } | undefined): Promise<void>;
130
+ setDocumentComments(resource: URI, commentInfos: ICommentInfo[]): void;
131
+ private setModelThreads;
132
+ private updateModelThreads;
133
+ setWorkspaceComments(uniqueOwner: string, commentsByResource: CommentThread[]): void;
134
+ removeWorkspaceComments(uniqueOwner: string): void;
135
+ registerCommentController(uniqueOwner: string, commentControl: ICommentController): void;
136
+ unregisterCommentController(uniqueOwner?: string): void;
137
+ getCommentController(uniqueOwner: string): ICommentController | undefined;
138
+ createCommentThreadTemplate(uniqueOwner: string, resource: URI, range: Range | undefined, editorId?: string): Promise<void>;
139
+ updateCommentThreadTemplate(uniqueOwner: string, threadHandle: number, range: Range): Promise<void>;
140
+ disposeCommentThread(uniqueOwner: string, threadId: string): void;
141
+ getCommentMenus(uniqueOwner: string): CommentMenus;
142
+ updateComments(ownerId: string, event: CommentThreadChangedEvent<IRange>): void;
143
+ updateNotebookComments(ownerId: string, event: CommentThreadChangedEvent<ICellRange>): void;
144
+ updateCommentingRanges(ownerId: string, resourceHints?: CommentingRangeResourceHint): void;
145
+ toggleReaction(uniqueOwner: string, resource: URI, thread: CommentThread, comment: Comment, reaction: CommentReaction): Promise<void>;
146
+ hasReactionHandler(uniqueOwner: string): boolean;
147
+ getDocumentComments(resource: URI): Promise<(ICommentInfo | null)[]>;
148
+ getNotebookComments(resource: URI): Promise<(INotebookCommentInfo | null)[]>;
149
+ registerContinueOnCommentProvider(provider: IContinueOnCommentProvider): IDisposable;
150
+ private _saveContinueOnComments;
151
+ removeContinueOnComment(pendingComment: {
152
+ range: IRange;
153
+ uri: URI;
154
+ uniqueOwner: string;
155
+ isReply?: boolean;
156
+ }): PendingCommentThread | undefined;
157
+ private _addContinueOnComments;
158
+ resourceHasCommentingRanges(resource: URI): boolean;
159
+ }
@@ -1,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
3
4
  import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
4
5
  import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
@@ -7,12 +8,13 @@ import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
7
8
  import { CommentMenus } from './commentMenus.js';
8
9
  import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
9
10
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
10
- import { COMMENTS_SECTION } from '@codingame/monaco-vscode-chat-comments-extensions-interactive-notebook-search-common/vscode/vs/workbench/contrib/comments/common/commentsConfiguration';
11
+ import { COMMENTS_SECTION } from '@codingame/monaco-vscode-9ee79c1a-3f03-568b-8eac-b02513a98b68-common/vscode/vs/workbench/contrib/comments/common/commentsConfiguration';
11
12
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
13
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
12
14
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
13
15
  import { CommentContextKeys } from 'vscode/vscode/vs/workbench/contrib/comments/common/commentContextKeys';
14
16
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
15
- import { CommentsModel } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsModel';
17
+ import { CommentsModel } from '@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsModel';
16
18
  import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
17
19
 
18
20
  const CONTINUE_ON_COMMENTS = 'comments.continueOnComments';
@@ -60,12 +62,12 @@ let CommentService = class CommentService extends Disposable {
60
62
  this._handleZenMode();
61
63
  this._workspaceHasCommenting = CommentContextKeys.WorkspaceHasCommenting.bindTo(contextKeyService);
62
64
  const storageListener = this._register(( new DisposableStore()));
63
- const storageEvent = Event.debounce(this.storageService.onDidChangeValue(1 , CONTINUE_ON_COMMENTS, storageListener), (last, event) => last?.external ? last : event, 500);
65
+ const storageEvent = Event.debounce(this.storageService.onDidChangeValue(StorageScope.WORKSPACE, CONTINUE_ON_COMMENTS, storageListener), (last, event) => last?.external ? last : event, 500);
64
66
  storageListener.add(storageEvent(v => {
65
67
  if (!v.external) {
66
68
  return;
67
69
  }
68
- const commentsToRestore = this.storageService.getObject(CONTINUE_ON_COMMENTS, 1 );
70
+ const commentsToRestore = this.storageService.getObject(CONTINUE_ON_COMMENTS, StorageScope.WORKSPACE);
69
71
  if (!commentsToRestore) {
70
72
  return;
71
73
  }
@@ -312,7 +314,7 @@ let CommentService = class CommentService extends Disposable {
312
314
  commentsToSave.push(...pendingComments);
313
315
  }
314
316
  this.logService.debug(`Comments: URIs of continue on comments to add to storage ${( commentsToSave.map(thread => ( thread.uri.toString()))).join(', ')}.`);
315
- this.storageService.store(CONTINUE_ON_COMMENTS, commentsToSave, 1 , 0 );
317
+ this.storageService.store(CONTINUE_ON_COMMENTS, commentsToSave, StorageScope.WORKSPACE, StorageTarget.USER);
316
318
  }
317
319
  removeContinueOnComment(pendingComment) {
318
320
  const pendingComments = this._continueOnComments.get(pendingComment.uniqueOwner);
@@ -0,0 +1,14 @@
1
+ import { ICommentService } from "vscode/vscode/vs/workbench/contrib/comments/browser/commentService.service";
2
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
3
+ import { IWorkbenchContribution } from "vscode/vscode/vs/workbench/common/contributions";
4
+ import { IActivityService } from "vscode/vscode/vs/workbench/services/activity/common/activity.service";
5
+ export declare class UnresolvedCommentsBadge extends Disposable implements IWorkbenchContribution {
6
+ private readonly _commentService;
7
+ private readonly activityService;
8
+ private readonly activity;
9
+ private totalUnresolved;
10
+ constructor(_commentService: ICommentService, activityService: IActivityService);
11
+ private onAllCommentsChanged;
12
+ private onCommentsUpdated;
13
+ private updateBadge;
14
+ }
@@ -1,5 +1,7 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { localize } from 'vscode/vscode/vs/nls';
4
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
3
5
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
6
  import './commentsEditorContribution.js';
5
7
  import './commentService.js';
@@ -8,18 +10,20 @@ import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/confi
8
10
  import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
9
11
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
10
12
  import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
11
- import { NumberBadge } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
13
+ import { NumberBadge } from '@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common/vscode/vs/workbench/services/activity/common/activity';
12
14
  import { IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity.service';
13
- import { COMMENTS_VIEW_ID } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
15
+ import { COMMENTS_VIEW_ID } from '@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
14
16
  import { CommentThreadState } from 'vscode/vscode/vs/editor/common/languages';
17
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
15
18
  import { registerAction2, MenuId, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
16
- import { CONTEXT_KEY_HAS_COMMENTS, CONTEXT_KEY_SOME_COMMENTS_EXPANDED } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsView';
17
- import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
19
+ import { CONTEXT_KEY_HAS_COMMENTS, CONTEXT_KEY_SOME_COMMENTS_EXPANDED } from '@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsView';
20
+ import { ViewAction } from '@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane';
18
21
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
19
22
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
20
23
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
21
- import { revealCommentThread } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsController';
24
+ import { revealCommentThread } from '@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsController';
22
25
  import { accessibleViewIsShown, accessibleViewCurrentProviderId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
26
+ import { AccessibleViewProviderId } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
23
27
  import { AccessibleViewRegistry } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleViewRegistry';
24
28
  import { CommentsAccessibleView, CommentThreadAccessibleView } from './commentsAccessibleView.js';
25
29
  import { CommentsAccessibilityHelp } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsAccessibility';
@@ -29,16 +33,13 @@ registerAction2(class Collapse extends ViewAction {
29
33
  super({
30
34
  viewId: COMMENTS_VIEW_ID,
31
35
  id: 'comments.collapse',
32
- title: ( localize(2138, "Collapse All")),
36
+ title: ( localize(4817, "Collapse All")),
33
37
  f1: false,
34
38
  icon: Codicon.collapseAll,
35
39
  menu: {
36
40
  id: MenuId.ViewTitle,
37
41
  group: 'navigation',
38
- when: ( (ContextKeyExpr.and( (ContextKeyExpr.and(
39
- (ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)),
40
- CONTEXT_KEY_HAS_COMMENTS
41
- )), CONTEXT_KEY_SOME_COMMENTS_EXPANDED))),
42
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.and(( ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)), CONTEXT_KEY_HAS_COMMENTS)), CONTEXT_KEY_SOME_COMMENTS_EXPANDED)),
42
43
  order: 100
43
44
  }
44
45
  });
@@ -52,16 +53,13 @@ registerAction2(class Expand extends ViewAction {
52
53
  super({
53
54
  viewId: COMMENTS_VIEW_ID,
54
55
  id: 'comments.expand',
55
- title: ( localize(2139, "Expand All")),
56
+ title: ( localize(4818, "Expand All")),
56
57
  f1: false,
57
58
  icon: Codicon.expandAll,
58
59
  menu: {
59
60
  id: MenuId.ViewTitle,
60
61
  group: 'navigation',
61
- when: ( (ContextKeyExpr.and( (ContextKeyExpr.and(
62
- (ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)),
63
- CONTEXT_KEY_HAS_COMMENTS
64
- )), ContextKeyExpr.not(CONTEXT_KEY_SOME_COMMENTS_EXPANDED.key)))),
62
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.and(( ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)), CONTEXT_KEY_HAS_COMMENTS)), ContextKeyExpr.not(CONTEXT_KEY_SOME_COMMENTS_EXPANDED.key))),
65
63
  order: 100
66
64
  }
67
65
  });
@@ -74,19 +72,16 @@ registerAction2(class Reply extends Action2 {
74
72
  constructor() {
75
73
  super({
76
74
  id: 'comments.reply',
77
- title: ( localize(2140, "Reply")),
75
+ title: ( localize(4819, "Reply")),
78
76
  icon: Codicon.reply,
79
- precondition: ( (ContextKeyExpr.equals('canReply', true))),
77
+ precondition: ( ContextKeyExpr.equals('canReply', true)),
80
78
  menu: [{
81
79
  id: MenuId.CommentsViewThreadActions,
82
80
  order: 100
83
81
  },
84
82
  {
85
83
  id: MenuId.AccessibleView,
86
- when: ( (ContextKeyExpr.and(accessibleViewIsShown, (ContextKeyExpr.equals(
87
- accessibleViewCurrentProviderId.key,
88
- "comments"
89
- ))))),
84
+ when: ( ContextKeyExpr.and(accessibleViewIsShown, ( ContextKeyExpr.equals(accessibleViewCurrentProviderId.key, AccessibleViewProviderId.Comments)))),
90
85
  }]
91
86
  });
92
87
  }
@@ -97,37 +92,37 @@ registerAction2(class Reply extends Action2 {
97
92
  revealCommentThread(commentService, editorService, uriIdentityService, marshalledCommentThread.thread, marshalledCommentThread.thread.comments[marshalledCommentThread.thread.comments.length - 1], true);
98
93
  }
99
94
  });
100
- ( (Registry.as(Extensions.Configuration))).registerConfiguration({
95
+ ( Registry.as(Extensions.Configuration)).registerConfiguration({
101
96
  id: 'comments',
102
97
  order: 20,
103
- title: ( localize(2141, "Comments")),
98
+ title: ( localize(4820, "Comments")),
104
99
  type: 'object',
105
100
  properties: {
106
101
  'comments.openPanel': {
107
102
  enum: ['neverOpen', 'openOnSessionStart', 'openOnSessionStartWithComments'],
108
103
  default: 'openOnSessionStartWithComments',
109
- description: ( localize(2142, "Controls when the comments panel should open.")),
104
+ description: ( localize(4821, "Controls when the comments panel should open.")),
110
105
  restricted: false,
111
- markdownDeprecationMessage: ( localize(2143, "This setting is deprecated in favor of `comments.openView`."))
106
+ markdownDeprecationMessage: ( localize(4822, "This setting is deprecated in favor of `comments.openView`."))
112
107
  },
113
108
  'comments.openView': {
114
109
  enum: ['never', 'file', 'firstFile', 'firstFileUnresolved'],
115
- enumDescriptions: [( localize(2144, "The comments view will never be opened.")), ( localize(2145, "The comments view will open when a file with comments is active.")), ( localize(
116
- 2146,
110
+ enumDescriptions: [( localize(4823, "The comments view will never be opened.")), ( localize(4824, "The comments view will open when a file with comments is active.")), ( localize(
111
+ 4825,
117
112
  "If the comments view has not been opened yet during this session it will open the first time during a session that a file with comments is active."
118
113
  )), ( localize(
119
- 2147,
114
+ 4826,
120
115
  "If the comments view has not been opened yet during this session and the comment is not resolved, it will open the first time during a session that a file with comments is active."
121
116
  ))],
122
117
  default: 'firstFile',
123
- description: ( localize(2148, "Controls when the comments view should open.")),
118
+ description: ( localize(4827, "Controls when the comments view should open.")),
124
119
  restricted: false
125
120
  },
126
121
  'comments.useRelativeTime': {
127
122
  type: 'boolean',
128
123
  default: true,
129
124
  description: ( localize(
130
- 2149,
125
+ 4828,
131
126
  "Determines if relative time will be used in comment timestamps (ex. '1 day ago')."
132
127
  ))
133
128
  },
@@ -135,20 +130,20 @@ registerAction2(class Reply extends Action2 {
135
130
  type: 'boolean',
136
131
  default: true,
137
132
  description: ( localize(
138
- 2150,
133
+ 4829,
139
134
  "Controls the visibility of the comments bar and comment threads in editors that have commenting ranges and comments. Comments are still accessible via the Comments view and will cause commenting to be toggled on in the same way running the command \"Comments: Toggle Editor Commenting\" toggles comments."
140
135
  ))
141
136
  },
142
137
  'comments.maxHeight': {
143
138
  type: 'boolean',
144
139
  default: true,
145
- description: ( localize(2151, "Controls whether the comments widget scrolls or expands."))
140
+ description: ( localize(4830, "Controls whether the comments widget scrolls or expands."))
146
141
  },
147
142
  'comments.collapseOnResolve': {
148
143
  type: 'boolean',
149
144
  default: true,
150
145
  description: ( localize(
151
- 2152,
146
+ 4831,
152
147
  "Controls whether the comment thread should collapse when the thread is resolved."
153
148
  ))
154
149
  }
@@ -159,7 +154,7 @@ let UnresolvedCommentsBadge = class UnresolvedCommentsBadge extends Disposable {
159
154
  super();
160
155
  this._commentService = _commentService;
161
156
  this.activityService = activityService;
162
- this.activity = this._register(( (new MutableDisposable())));
157
+ this.activity = this._register(( new MutableDisposable()));
163
158
  this.totalUnresolved = 0;
164
159
  this._register(this._commentService.onDidSetAllCommentThreads(this.onAllCommentsChanged, this));
165
160
  this._register(this._commentService.onDidUpdateCommentThreads(this.onCommentsUpdated, this));
@@ -189,17 +184,17 @@ let UnresolvedCommentsBadge = class UnresolvedCommentsBadge extends Disposable {
189
184
  return;
190
185
  }
191
186
  this.totalUnresolved = unresolved;
192
- const message = ( localize(2153, '{0} Unresolved Comments', this.totalUnresolved));
193
- this.activity.value = this.activityService.showViewActivity(COMMENTS_VIEW_ID, { badge: ( (new NumberBadge(this.totalUnresolved, () => message))) });
187
+ const message = ( localize(4832, '{0} Unresolved Comments', this.totalUnresolved));
188
+ this.activity.value = this.activityService.showViewActivity(COMMENTS_VIEW_ID, { badge: ( new NumberBadge(this.totalUnresolved, () => message)) });
194
189
  }
195
190
  };
196
- UnresolvedCommentsBadge = ( (__decorate([
197
- ( (__param(0, ICommentService))),
198
- ( (__param(1, IActivityService)))
199
- ], UnresolvedCommentsBadge)));
200
- ( (Registry.as(Extensions$1.Workbench))).registerWorkbenchContribution(UnresolvedCommentsBadge, 4 );
201
- AccessibleViewRegistry.register(( (new CommentsAccessibleView())));
202
- AccessibleViewRegistry.register(( (new CommentThreadAccessibleView())));
203
- AccessibleViewRegistry.register(( (new CommentsAccessibilityHelp())));
191
+ UnresolvedCommentsBadge = ( __decorate([
192
+ ( __param(0, ICommentService)),
193
+ ( __param(1, IActivityService))
194
+ ], UnresolvedCommentsBadge));
195
+ ( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(UnresolvedCommentsBadge, LifecyclePhase.Eventually);
196
+ AccessibleViewRegistry.register(( new CommentsAccessibleView()));
197
+ AccessibleViewRegistry.register(( new CommentThreadAccessibleView()));
198
+ AccessibleViewRegistry.register(( new CommentsAccessibilityHelp()));
204
199
 
205
200
  export { UnresolvedCommentsBadge };
@@ -0,0 +1,68 @@
1
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { ServicesAccessor } from "vscode/vscode/vs/editor/browser/editorExtensions";
3
+ import { AccessibleViewProviderId, AccessibleViewType, IAccessibleViewContentProvider } from "vscode/vscode/vs/platform/accessibility/browser/accessibleView";
4
+ import { IAccessibleViewImplentation } from "vscode/vscode/vs/platform/accessibility/browser/accessibleViewRegistry";
5
+ import { AccessibilityVerbositySettingId } from "vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration";
6
+ import { CommentsMenus } from "@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer";
7
+ import { CommentsPanel } from "@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsView";
8
+ import { ICommentService } from "vscode/vscode/vs/workbench/contrib/comments/browser/commentService.service";
9
+ import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
10
+ import { IUriIdentityService } from "vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
11
+ export declare class CommentsAccessibleView extends Disposable implements IAccessibleViewImplentation {
12
+ readonly priority = 90;
13
+ readonly name = "comment";
14
+ readonly when: import("vscode/vscode/vs/platform/contextkey/common/contextkey").RawContextKey<boolean>;
15
+ readonly type = AccessibleViewType.View;
16
+ getProvider(accessor: ServicesAccessor): CommentsAccessibleContentProvider | undefined;
17
+ constructor();
18
+ }
19
+ export declare class CommentThreadAccessibleView extends Disposable implements IAccessibleViewImplentation {
20
+ readonly priority = 85;
21
+ readonly name = "commentThread";
22
+ readonly when: import("vscode/vscode/vs/platform/contextkey/common/contextkey").RawContextKey<boolean>;
23
+ readonly type = AccessibleViewType.View;
24
+ getProvider(accessor: ServicesAccessor): CommentsThreadWidgetAccessibleContentProvider | undefined;
25
+ constructor();
26
+ }
27
+ declare class CommentsAccessibleContentProvider extends Disposable implements IAccessibleViewContentProvider {
28
+ private readonly _commentsView;
29
+ private readonly _focusedCommentNode;
30
+ private readonly _menus;
31
+ constructor(_commentsView: CommentsPanel, _focusedCommentNode: any, _menus: CommentsMenus);
32
+ readonly id = AccessibleViewProviderId.Comments;
33
+ readonly verbositySettingKey = AccessibilityVerbositySettingId.Comments;
34
+ readonly options: {
35
+ type: AccessibleViewType;
36
+ };
37
+ actions: {
38
+ run: () => void;
39
+ id: string;
40
+ label: string;
41
+ tooltip: string;
42
+ class: string | undefined;
43
+ enabled: boolean;
44
+ checked?: boolean | undefined;
45
+ }[];
46
+ provideContent(): string;
47
+ onClose(): void;
48
+ provideNextContent(): string | undefined;
49
+ providePreviousContent(): string | undefined;
50
+ }
51
+ declare class CommentsThreadWidgetAccessibleContentProvider extends Disposable implements IAccessibleViewContentProvider {
52
+ private readonly _commentService;
53
+ private readonly _editorService;
54
+ private readonly _uriIdentityService;
55
+ readonly id = AccessibleViewProviderId.CommentThread;
56
+ readonly verbositySettingKey = AccessibilityVerbositySettingId.Comments;
57
+ readonly options: {
58
+ type: AccessibleViewType;
59
+ };
60
+ private _activeCommentInfo;
61
+ constructor(_commentService: ICommentService, _editorService: IEditorService, _uriIdentityService: IUriIdentityService);
62
+ private get activeCommentInfo();
63
+ provideContent(): string;
64
+ onClose(): void;
65
+ provideNextContent(): string | undefined;
66
+ providePreviousContent(): string | undefined;
67
+ }
68
+ export {};
@@ -1,13 +1,17 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
+ import { MarshalledId } from 'vscode/vscode/vs/base/common/marshallingIds';
5
+ import { AccessibleViewType, AccessibleViewProviderId } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
3
6
  import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
4
7
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
5
- import { COMMENTS_VIEW_ID, CommentsMenus } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
6
- import { CONTEXT_KEY_COMMENT_FOCUSED } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsView';
8
+ import { AccessibilityVerbositySettingId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
9
+ import { COMMENTS_VIEW_ID, CommentsMenus } from '@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
10
+ import { CONTEXT_KEY_COMMENT_FOCUSED } from '@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsView';
7
11
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
8
12
  import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService.service';
9
13
  import { CommentContextKeys } from 'vscode/vscode/vs/workbench/contrib/comments/common/commentContextKeys';
10
- import { revealCommentThread, moveToNextCommentInThread } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsController';
14
+ import { revealCommentThread, moveToNextCommentInThread } from '@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsController';
11
15
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
12
16
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
13
17
  import { isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
@@ -32,7 +36,7 @@ class CommentsAccessibleView extends Disposable {
32
36
  this.priority = 90;
33
37
  this.name = 'comment';
34
38
  this.when = CONTEXT_KEY_COMMENT_FOCUSED;
35
- this.type = "view" ;
39
+ this.type = AccessibleViewType.View;
36
40
  }
37
41
  }
38
42
  class CommentThreadAccessibleView extends Disposable {
@@ -51,7 +55,7 @@ class CommentThreadAccessibleView extends Disposable {
51
55
  this.priority = 85;
52
56
  this.name = 'commentThread';
53
57
  this.when = CommentContextKeys.commentFocused;
54
- this.type = "view" ;
58
+ this.type = AccessibleViewType.View;
55
59
  }
56
60
  }
57
61
  class CommentsAccessibleContentProvider extends Disposable {
@@ -60,9 +64,9 @@ class CommentsAccessibleContentProvider extends Disposable {
60
64
  this._commentsView = _commentsView;
61
65
  this._focusedCommentNode = _focusedCommentNode;
62
66
  this._menus = _menus;
63
- this.id = "comments" ;
64
- this.verbositySettingKey = "accessibility.verbosity.comments" ;
65
- this.options = { type: "view" };
67
+ this.id = AccessibleViewProviderId.Comments;
68
+ this.verbositySettingKey = AccessibilityVerbositySettingId.Comments;
69
+ this.options = { type: AccessibleViewType.View };
66
70
  this.actions = ( [...this._menus.getResourceContextActions(this._focusedCommentNode)].filter(i => i.enabled).map(action => {
67
71
  return {
68
72
  ...action,
@@ -70,7 +74,7 @@ class CommentsAccessibleContentProvider extends Disposable {
70
74
  this._commentsView.focus();
71
75
  action.run({
72
76
  thread: this._focusedCommentNode.thread,
73
- $mid: 7 ,
77
+ $mid: MarshalledId.CommentThread,
74
78
  commentControlHandle: this._focusedCommentNode.controllerHandle,
75
79
  commentThreadHandle: this._focusedCommentNode.threadHandle,
76
80
  });
@@ -104,9 +108,9 @@ let CommentsThreadWidgetAccessibleContentProvider = class CommentsThreadWidgetAc
104
108
  this._commentService = _commentService;
105
109
  this._editorService = _editorService;
106
110
  this._uriIdentityService = _uriIdentityService;
107
- this.id = "commentThread" ;
108
- this.verbositySettingKey = "accessibility.verbosity.comments" ;
109
- this.options = { type: "view" };
111
+ this.id = AccessibleViewProviderId.CommentThread;
112
+ this.verbositySettingKey = AccessibilityVerbositySettingId.Comments;
113
+ this.options = { type: AccessibleViewType.View };
110
114
  }
111
115
  get activeCommentInfo() {
112
116
  if (!this._activeCommentInfo && this._commentService.lastActiveCommentcontroller) {
@@ -0,0 +1,3 @@
1
+ import { IActiveCodeEditor } from "vscode/vscode/vs/editor/browser/editorBrowser";
2
+ import { ServicesAccessor } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
3
+ export declare function getActiveEditor(accessor: ServicesAccessor): IActiveCodeEditor | null;
@@ -1,30 +1,33 @@
1
- import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
2
- import '@codingame/monaco-vscode-chat-comments-extensions-interactive-notebook-search-common/vscode/vs/workbench/contrib/comments/browser/media/review.css';
1
+
2
+ import { KeyMod, KeyCode, KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
3
+ import '@codingame/monaco-vscode-9ee79c1a-3f03-568b-8eac-b02513a98b68-common/vscode/vs/workbench/contrib/comments/browser/media/review.css';
3
4
  import { isDiffEditor, isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
4
- import { registerEditorContribution } from 'vscode/vscode/vs/editor/browser/editorExtensions';
5
+ import { registerEditorContribution, EditorContributionInstantiation } from 'vscode/vscode/vs/editor/browser/editorExtensions';
5
6
  import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
6
7
  import { localize } from 'vscode/vscode/vs/nls';
7
- import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
8
+ import { KeybindingsRegistry, KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
8
9
  import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService.service';
9
10
  import { ctxCommentEditorFocused, SimpleCommentEditor } from 'vscode/vscode/vs/workbench/contrib/comments/browser/simpleCommentEditor';
10
11
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
11
12
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
12
13
  import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
13
- import { ID, CommentController } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsController';
14
+ import { ID, CommentController } from '@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentsController';
14
15
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
15
16
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
16
17
  import { CommentContextKeys } from 'vscode/vscode/vs/workbench/contrib/comments/common/commentContextKeys';
17
18
  import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
18
19
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
19
20
  import { accessibilityHelpIsShown, accessibleViewCurrentProviderId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
20
- import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
21
+ import { CommentCommandId } from 'vscode/vscode/vs/workbench/contrib/comments/common/commentCommandIds';
22
+ import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
21
23
  import { CommentsInputContentProvider } from './commentsInputContentProvider.js';
22
- import { CommentWidgetFocus } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentThreadZoneWidget';
24
+ import { AccessibleViewProviderId } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
25
+ import { CommentWidgetFocus } from '@codingame/monaco-vscode-eb7d5efd-2e60-59f8-9ba4-9a8ae8cb2957-common/vscode/vs/workbench/contrib/comments/browser/commentThreadZoneWidget';
23
26
 
24
- registerEditorContribution(ID, CommentController, 1 );
25
- registerWorkbenchContribution2(CommentsInputContentProvider.ID, CommentsInputContentProvider, 2 );
27
+ registerEditorContribution(ID, CommentController, EditorContributionInstantiation.AfterFirstRender);
28
+ registerWorkbenchContribution2(CommentsInputContentProvider.ID, CommentsInputContentProvider, WorkbenchPhase.BlockRestore);
26
29
  KeybindingsRegistry.registerCommandAndKeybindingRule({
27
- id: "editor.action.nextCommentThreadAction" ,
30
+ id: CommentCommandId.NextThread,
28
31
  handler: async (accessor, args) => {
29
32
  const activeEditor = getActiveEditor(accessor);
30
33
  if (!activeEditor) {
@@ -36,11 +39,11 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
36
39
  }
37
40
  controller.nextCommentThread(true);
38
41
  },
39
- weight: 100 ,
40
- primary: 512 | 67 ,
42
+ weight: KeybindingWeight.EditorContrib,
43
+ primary: KeyMod.Alt | KeyCode.F9,
41
44
  });
42
45
  KeybindingsRegistry.registerCommandAndKeybindingRule({
43
- id: "editor.action.previousCommentThreadAction" ,
46
+ id: CommentCommandId.PreviousThread,
44
47
  handler: async (accessor, args) => {
45
48
  const activeEditor = getActiveEditor(accessor);
46
49
  if (!activeEditor) {
@@ -52,19 +55,19 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
52
55
  }
53
56
  controller.previousCommentThread(true);
54
57
  },
55
- weight: 100 ,
56
- primary: 1024 | 512 | 67
58
+ weight: KeybindingWeight.EditorContrib,
59
+ primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F9
57
60
  });
58
61
  registerAction2(class extends Action2 {
59
62
  constructor() {
60
63
  super({
61
- id: "editor.action.nextCommentedRangeAction" ,
64
+ id: CommentCommandId.NextCommentedRange,
62
65
  title: {
63
- value: ( localize(5306, "Go to Next Commented Range")),
66
+ value: ( localize(4851, "Go to Next Commented Range")),
64
67
  original: 'Go to Next Commented Range'
65
68
  },
66
69
  category: {
67
- value: ( localize(5307, "Comments")),
70
+ value: ( localize(4852, "Comments")),
68
71
  original: 'Comments'
69
72
  },
70
73
  menu: [{
@@ -72,8 +75,8 @@ registerAction2(class extends Action2 {
72
75
  when: CommentContextKeys.activeEditorHasCommentingRange
73
76
  }],
74
77
  keybinding: {
75
- primary: 512 | 68 ,
76
- weight: 100 ,
78
+ primary: KeyMod.Alt | KeyCode.F10,
79
+ weight: KeybindingWeight.EditorContrib,
77
80
  when: CommentContextKeys.activeEditorHasCommentingRange
78
81
  }
79
82
  });
@@ -93,13 +96,13 @@ registerAction2(class extends Action2 {
93
96
  registerAction2(class extends Action2 {
94
97
  constructor() {
95
98
  super({
96
- id: "editor.action.previousCommentedRangeAction" ,
99
+ id: CommentCommandId.PreviousCommentedRange,
97
100
  title: {
98
- value: ( localize(5308, "Go to Previous Commented Range")),
101
+ value: ( localize(4853, "Go to Previous Commented Range")),
99
102
  original: 'Go to Previous Commented Range'
100
103
  },
101
104
  category: {
102
- value: ( localize(5307, "Comments")),
105
+ value: ( localize(4852, "Comments")),
103
106
  original: 'Comments'
104
107
  },
105
108
  menu: [{
@@ -107,8 +110,8 @@ registerAction2(class extends Action2 {
107
110
  when: CommentContextKeys.activeEditorHasCommentingRange
108
111
  }],
109
112
  keybinding: {
110
- primary: 1024 | 512 | 68 ,
111
- weight: 100 ,
113
+ primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F10,
114
+ weight: KeybindingWeight.EditorContrib,
112
115
  when: CommentContextKeys.activeEditorHasCommentingRange
113
116
  }
114
117
  });
@@ -128,13 +131,13 @@ registerAction2(class extends Action2 {
128
131
  registerAction2(class extends Action2 {
129
132
  constructor() {
130
133
  super({
131
- id: "editor.action.nextCommentingRange" ,
134
+ id: CommentCommandId.NextRange,
132
135
  title: {
133
- value: ( localize(5309, "Go to Next Commenting Range")),
136
+ value: ( localize(4854, "Go to Next Commenting Range")),
134
137
  original: 'Go to Next Commenting Range'
135
138
  },
136
139
  category: {
137
- value: ( localize(5307, "Comments")),
140
+ value: ( localize(4852, "Comments")),
138
141
  original: 'Comments'
139
142
  },
140
143
  menu: [{
@@ -142,16 +145,9 @@ registerAction2(class extends Action2 {
142
145
  when: CommentContextKeys.activeEditorHasCommentingRange
143
146
  }],
144
147
  keybinding: {
145
- primary: KeyChord(2048 | 41 , 2048 | 512 | 18 ),
146
- weight: 100 ,
147
- when: ( (ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, (ContextKeyExpr.or(
148
- EditorContextKeys.focus,
149
- CommentContextKeys.commentFocused,
150
- (ContextKeyExpr.and(
151
- accessibilityHelpIsShown,
152
- (accessibleViewCurrentProviderId.isEqualTo("comments" ))
153
- ))
154
- )))))
148
+ primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.DownArrow),
149
+ weight: KeybindingWeight.EditorContrib,
150
+ when: ( ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, ( ContextKeyExpr.or(EditorContextKeys.focus, CommentContextKeys.commentFocused, ( ContextKeyExpr.and(accessibilityHelpIsShown, ( accessibleViewCurrentProviderId.isEqualTo(AccessibleViewProviderId.Comments))))))))
155
151
  }
156
152
  });
157
153
  }
@@ -170,13 +166,13 @@ registerAction2(class extends Action2 {
170
166
  registerAction2(class extends Action2 {
171
167
  constructor() {
172
168
  super({
173
- id: "editor.action.previousCommentingRange" ,
169
+ id: CommentCommandId.PreviousRange,
174
170
  title: {
175
- value: ( localize(5310, "Go to Previous Commenting Range")),
171
+ value: ( localize(4855, "Go to Previous Commenting Range")),
176
172
  original: 'Go to Previous Commenting Range'
177
173
  },
178
174
  category: {
179
- value: ( localize(5307, "Comments")),
175
+ value: ( localize(4852, "Comments")),
180
176
  original: 'Comments'
181
177
  },
182
178
  menu: [{
@@ -184,16 +180,9 @@ registerAction2(class extends Action2 {
184
180
  when: CommentContextKeys.activeEditorHasCommentingRange
185
181
  }],
186
182
  keybinding: {
187
- primary: KeyChord(2048 | 41 , 2048 | 512 | 16 ),
188
- weight: 100 ,
189
- when: ( (ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, (ContextKeyExpr.or(
190
- EditorContextKeys.focus,
191
- CommentContextKeys.commentFocused,
192
- (ContextKeyExpr.and(
193
- accessibilityHelpIsShown,
194
- (accessibleViewCurrentProviderId.isEqualTo("comments" ))
195
- ))
196
- )))))
183
+ primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.UpArrow),
184
+ weight: KeybindingWeight.EditorContrib,
185
+ when: ( ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, ( ContextKeyExpr.or(EditorContextKeys.focus, CommentContextKeys.commentFocused, ( ContextKeyExpr.and(accessibilityHelpIsShown, ( accessibleViewCurrentProviderId.isEqualTo(AccessibleViewProviderId.Comments))))))))
197
186
  }
198
187
  });
199
188
  }
@@ -212,13 +201,13 @@ registerAction2(class extends Action2 {
212
201
  registerAction2(class extends Action2 {
213
202
  constructor() {
214
203
  super({
215
- id: "workbench.action.toggleCommenting" ,
204
+ id: CommentCommandId.ToggleCommenting,
216
205
  title: {
217
- value: ( localize(5311, "Toggle Editor Commenting")),
206
+ value: ( localize(4856, "Toggle Editor Commenting")),
218
207
  original: 'Toggle Editor Commenting'
219
208
  },
220
209
  category: {
221
- value: ( localize(5307, "Comments")),
210
+ value: ( localize(4852, "Comments")),
222
211
  original: 'Comments'
223
212
  },
224
213
  menu: [{
@@ -236,13 +225,13 @@ registerAction2(class extends Action2 {
236
225
  registerAction2(class extends Action2 {
237
226
  constructor() {
238
227
  super({
239
- id: "workbench.action.addComment" ,
228
+ id: CommentCommandId.Add,
240
229
  title: {
241
- value: ( localize(5312, "Add Comment on Current Selection")),
230
+ value: ( localize(4857, "Add Comment on Current Selection")),
242
231
  original: 'Add Comment on Current Selection'
243
232
  },
244
233
  category: {
245
- value: ( localize(5307, "Comments")),
234
+ value: ( localize(4852, "Comments")),
246
235
  original: 'Comments'
247
236
  },
248
237
  menu: [{
@@ -250,8 +239,8 @@ registerAction2(class extends Action2 {
250
239
  when: CommentContextKeys.activeCursorHasCommentingRange
251
240
  }],
252
241
  keybinding: {
253
- primary: KeyChord(2048 | 41 , 2048 | 512 | 33 ),
254
- weight: 100 ,
242
+ primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyC),
243
+ weight: KeybindingWeight.EditorContrib,
255
244
  when: CommentContextKeys.activeCursorHasCommentingRange
256
245
  }
257
246
  });
@@ -265,32 +254,32 @@ registerAction2(class extends Action2 {
265
254
  if (!controller) {
266
255
  return;
267
256
  }
268
- const position = args?.range ? ( (new Range(
257
+ const position = args?.range ? ( new Range(
269
258
  args.range.startLineNumber,
270
259
  args.range.startLineNumber,
271
260
  args.range.endLineNumber,
272
261
  args.range.endColumn
273
- )))
262
+ ))
274
263
  : (args?.fileComment ? undefined : activeEditor.getSelection());
275
264
  const notificationService = accessor.get(INotificationService);
276
265
  try {
277
266
  await controller.addOrToggleCommentAtLine(position, undefined);
278
267
  }
279
268
  catch (e) {
280
- notificationService.error(( localize(5313, "The cursor must be within a commenting range to add a comment")));
269
+ notificationService.error(( localize(4858, "The cursor must be within a commenting range to add a comment")));
281
270
  }
282
271
  }
283
272
  });
284
273
  registerAction2(class extends Action2 {
285
274
  constructor() {
286
275
  super({
287
- id: "workbench.action.focusCommentOnCurrentLine" ,
276
+ id: CommentCommandId.FocusCommentOnCurrentLine,
288
277
  title: {
289
- value: ( localize(5314, "Focus Comment on Current Line")),
278
+ value: ( localize(4859, "Focus Comment on Current Line")),
290
279
  original: 'Focus Comment on Current Line'
291
280
  },
292
281
  category: {
293
- value: ( localize(5307, "Comments")),
282
+ value: ( localize(4852, "Comments")),
294
283
  original: 'Comments'
295
284
  },
296
285
  f1: true,
@@ -322,20 +311,20 @@ registerAction2(class extends Action2 {
322
311
  error = true;
323
312
  }
324
313
  if (error) {
325
- notificationService.error(( localize(5315, "The cursor must be on a line with a comment to focus the comment")));
314
+ notificationService.error(( localize(4860, "The cursor must be on a line with a comment to focus the comment")));
326
315
  }
327
316
  }
328
317
  });
329
318
  registerAction2(class extends Action2 {
330
319
  constructor() {
331
320
  super({
332
- id: "workbench.action.collapseAllComments" ,
321
+ id: CommentCommandId.CollapseAll,
333
322
  title: {
334
- value: ( localize(5316, "Collapse All Comments")),
323
+ value: ( localize(4861, "Collapse All Comments")),
335
324
  original: 'Collapse All Comments'
336
325
  },
337
326
  category: {
338
- value: ( localize(5307, "Comments")),
327
+ value: ( localize(4852, "Comments")),
339
328
  original: 'Comments'
340
329
  },
341
330
  menu: [{
@@ -351,13 +340,13 @@ registerAction2(class extends Action2 {
351
340
  registerAction2(class extends Action2 {
352
341
  constructor() {
353
342
  super({
354
- id: "workbench.action.expandAllComments" ,
343
+ id: CommentCommandId.ExpandAll,
355
344
  title: {
356
- value: ( localize(5317, "Expand All Comments")),
345
+ value: ( localize(4862, "Expand All Comments")),
357
346
  original: 'Expand All Comments'
358
347
  },
359
348
  category: {
360
- value: ( localize(5307, "Comments")),
349
+ value: ( localize(4852, "Comments")),
361
350
  original: 'Comments'
362
351
  },
363
352
  menu: [{
@@ -373,13 +362,13 @@ registerAction2(class extends Action2 {
373
362
  registerAction2(class extends Action2 {
374
363
  constructor() {
375
364
  super({
376
- id: "workbench.action.expandUnresolvedComments" ,
365
+ id: CommentCommandId.ExpandUnresolved,
377
366
  title: {
378
- value: ( localize(5318, "Expand Unresolved Comments")),
367
+ value: ( localize(4863, "Expand Unresolved Comments")),
379
368
  original: 'Expand Unresolved Comments'
380
369
  },
381
370
  category: {
382
- value: ( localize(5307, "Comments")),
371
+ value: ( localize(4852, "Comments")),
383
372
  original: 'Comments'
384
373
  },
385
374
  menu: [{
@@ -393,9 +382,9 @@ registerAction2(class extends Action2 {
393
382
  }
394
383
  });
395
384
  KeybindingsRegistry.registerCommandAndKeybindingRule({
396
- id: "editor.action.submitComment" ,
397
- weight: 100 ,
398
- primary: 2048 | 3 ,
385
+ id: CommentCommandId.Submit,
386
+ weight: KeybindingWeight.EditorContrib,
387
+ primary: KeyMod.CtrlCmd | KeyCode.Enter,
399
388
  when: ctxCommentEditorFocused,
400
389
  handler: (accessor, args) => {
401
390
  const activeCodeEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();
@@ -405,16 +394,40 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
405
394
  }
406
395
  });
407
396
  KeybindingsRegistry.registerCommandAndKeybindingRule({
408
- id: "workbench.action.hideComment" ,
409
- weight: 100 ,
410
- primary: 9 ,
411
- secondary: [1024 | 9 ],
412
- when: ctxCommentEditorFocused,
397
+ id: CommentCommandId.Hide,
398
+ weight: KeybindingWeight.EditorContrib,
399
+ primary: KeyCode.Escape,
400
+ secondary: [KeyMod.Shift | KeyCode.Escape],
401
+ when: ( ContextKeyExpr.or(ctxCommentEditorFocused, CommentContextKeys.commentFocused)),
413
402
  handler: (accessor, args) => {
414
403
  const activeCodeEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();
415
404
  if (activeCodeEditor instanceof SimpleCommentEditor) {
416
405
  activeCodeEditor.getParentThread().collapse();
417
406
  }
407
+ else if (activeCodeEditor) {
408
+ const controller = CommentController.get(activeCodeEditor);
409
+ if (!controller) {
410
+ return;
411
+ }
412
+ const notificationService = accessor.get(INotificationService);
413
+ const commentService = accessor.get(ICommentService);
414
+ let error = false;
415
+ try {
416
+ const activeComment = commentService.lastActiveCommentcontroller?.activeComment;
417
+ if (!activeComment) {
418
+ error = true;
419
+ }
420
+ else {
421
+ controller.collapseAndFocusRange(activeComment.thread.threadId);
422
+ }
423
+ }
424
+ catch (e) {
425
+ error = true;
426
+ }
427
+ if (error) {
428
+ notificationService.error(( localize(4860, "The cursor must be on a line with a comment to focus the comment")));
429
+ }
430
+ }
418
431
  }
419
432
  });
420
433
  function getActiveEditor(accessor) {
@@ -0,0 +1,15 @@
1
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { URI } from "vscode/vscode/vs/base/common/uri";
3
+ import { ICodeEditorService } from "vscode/vscode/vs/editor/browser/services/codeEditorService";
4
+ import { IEditorContribution } from "vscode/vscode/vs/editor/common/editorCommon";
5
+ import { ILanguageService } from "vscode/vscode/vs/editor/common/languages/language";
6
+ import { ITextModel } from "vscode/vscode/vs/editor/common/model";
7
+ import { IModelService } from "vscode/vscode/vs/editor/common/services/model";
8
+ import { ITextModelContentProvider, ITextModelService } from "vscode/vscode/vs/editor/common/services/resolverService";
9
+ export declare class CommentsInputContentProvider extends Disposable implements ITextModelContentProvider, IEditorContribution {
10
+ private readonly _modelService;
11
+ private readonly _languageService;
12
+ static readonly ID = "comments.input.contentProvider";
13
+ constructor(textModelService: ITextModelService, codeEditorService: ICodeEditorService, _modelService: IModelService, _languageService: ILanguageService);
14
+ provideTextContent(resource: URI): Promise<ITextModel | null>;
15
+ }
@@ -1,11 +1,13 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
4
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
4
5
  import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
6
+ import { ScrollType } from 'vscode/vscode/vs/editor/common/editorCommon';
5
7
  import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
6
8
  import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
7
9
  import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
8
- import { applyTextEditorOptions } from 'vscode/vscode/vs/workbench/common/editor/editorOptions';
10
+ import { applyTextEditorOptions } from '@codingame/monaco-vscode-219d9a5f-b446-507b-a188-1178a0867c75-common/vscode/vs/workbench/common/editor/editorOptions';
9
11
  import { SimpleCommentEditor } from 'vscode/vscode/vs/workbench/contrib/comments/browser/simpleCommentEditor';
10
12
 
11
13
  let CommentsInputContentProvider = class CommentsInputContentProvider extends Disposable {
@@ -23,7 +25,7 @@ let CommentsInputContentProvider = class CommentsInputContentProvider extends Di
23
25
  return null;
24
26
  }
25
27
  if (input.options) {
26
- applyTextEditorOptions(input.options, editor, 1 );
28
+ applyTextEditorOptions(input.options, editor, ScrollType.Immediate);
27
29
  }
28
30
  return editor;
29
31
  }));
package/comments.js DELETED
@@ -1,12 +0,0 @@
1
- import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
2
- import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService.service';
3
- import { CommentService } from './vscode/src/vs/workbench/contrib/comments/browser/commentService.js';
4
- import './vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js';
5
-
6
- function getServiceOverride() {
7
- return {
8
- [( ICommentService.toString())]: new SyncDescriptor(CommentService, [], true)
9
- };
10
- }
11
-
12
- export { getServiceOverride as default };