@codingame/monaco-vscode-comments-service-override 4.5.1 → 5.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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentService.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +53 -75
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.js +31 -41
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsInputContentProvider.js +43 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-comments-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@5.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -253,7 +253,7 @@ let CommentService = class CommentService extends Disposable {
|
|
|
253
253
|
return commentController.toggleReaction(resource, thread, comment, reaction, CancellationToken.None);
|
|
254
254
|
}
|
|
255
255
|
else {
|
|
256
|
-
throw new Error('Not supported');
|
|
256
|
+
throw ( new Error('Not supported'));
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
hasReactionHandler(uniqueOwner) {
|
|
@@ -19,23 +19,24 @@ import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
|
19
19
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
20
20
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
21
21
|
import { revealCommentThread } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsController';
|
|
22
|
+
import { accessibleViewIsShown, accessibleViewCurrentProviderId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
22
23
|
|
|
24
|
+
const _moduleId = "vs/workbench/contrib/comments/browser/comments.contribution";
|
|
23
25
|
registerAction2(class Collapse extends ViewAction {
|
|
24
26
|
constructor() {
|
|
25
27
|
super({
|
|
26
28
|
viewId: COMMENTS_VIEW_ID,
|
|
27
29
|
id: 'comments.collapse',
|
|
28
|
-
title: ( localizeWithPath(
|
|
29
|
-
'vs/workbench/contrib/comments/browser/comments.contribution',
|
|
30
|
-
'collapseAll',
|
|
31
|
-
"Collapse All"
|
|
32
|
-
)),
|
|
30
|
+
title: ( localizeWithPath(_moduleId, 0, "Collapse All")),
|
|
33
31
|
f1: false,
|
|
34
32
|
icon: Codicon.collapseAll,
|
|
35
33
|
menu: {
|
|
36
34
|
id: MenuId.ViewTitle,
|
|
37
35
|
group: 'navigation',
|
|
38
|
-
when: ( ContextKeyExpr.and((
|
|
36
|
+
when: ( (ContextKeyExpr.and( (ContextKeyExpr.and(
|
|
37
|
+
(ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)),
|
|
38
|
+
CONTEXT_KEY_HAS_COMMENTS
|
|
39
|
+
)), CONTEXT_KEY_SOME_COMMENTS_EXPANDED))),
|
|
39
40
|
order: 100
|
|
40
41
|
}
|
|
41
42
|
});
|
|
@@ -49,17 +50,16 @@ registerAction2(class Expand extends ViewAction {
|
|
|
49
50
|
super({
|
|
50
51
|
viewId: COMMENTS_VIEW_ID,
|
|
51
52
|
id: 'comments.expand',
|
|
52
|
-
title: ( localizeWithPath(
|
|
53
|
-
'vs/workbench/contrib/comments/browser/comments.contribution',
|
|
54
|
-
'expandAll',
|
|
55
|
-
"Expand All"
|
|
56
|
-
)),
|
|
53
|
+
title: ( localizeWithPath(_moduleId, 1, "Expand All")),
|
|
57
54
|
f1: false,
|
|
58
55
|
icon: Codicon.expandAll,
|
|
59
56
|
menu: {
|
|
60
57
|
id: MenuId.ViewTitle,
|
|
61
58
|
group: 'navigation',
|
|
62
|
-
when: (
|
|
59
|
+
when: ( (ContextKeyExpr.and( (ContextKeyExpr.and(
|
|
60
|
+
(ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)),
|
|
61
|
+
CONTEXT_KEY_HAS_COMMENTS
|
|
62
|
+
)), ContextKeyExpr.not(CONTEXT_KEY_SOME_COMMENTS_EXPANDED.key)))),
|
|
63
63
|
order: 100
|
|
64
64
|
}
|
|
65
65
|
});
|
|
@@ -72,17 +72,20 @@ registerAction2(class Reply extends Action2 {
|
|
|
72
72
|
constructor() {
|
|
73
73
|
super({
|
|
74
74
|
id: 'comments.reply',
|
|
75
|
-
title: ( localizeWithPath(
|
|
76
|
-
'vs/workbench/contrib/comments/browser/comments.contribution',
|
|
77
|
-
'reply',
|
|
78
|
-
"Reply"
|
|
79
|
-
)),
|
|
75
|
+
title: ( localizeWithPath(_moduleId, 2, "Reply")),
|
|
80
76
|
icon: Codicon.reply,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
precondition: ( (ContextKeyExpr.equals('canReply', true))),
|
|
78
|
+
menu: [{
|
|
79
|
+
id: MenuId.CommentsViewThreadActions,
|
|
80
|
+
order: 100
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: MenuId.AccessibleView,
|
|
84
|
+
when: ( (ContextKeyExpr.and(accessibleViewIsShown, (ContextKeyExpr.equals(
|
|
85
|
+
accessibleViewCurrentProviderId.key,
|
|
86
|
+
"comments"
|
|
87
|
+
))))),
|
|
88
|
+
}]
|
|
86
89
|
});
|
|
87
90
|
}
|
|
88
91
|
run(accessor, marshalledCommentThread) {
|
|
@@ -92,64 +95,48 @@ registerAction2(class Reply extends Action2 {
|
|
|
92
95
|
revealCommentThread(commentService, editorService, uriIdentityService, marshalledCommentThread.thread, marshalledCommentThread.thread.comments[marshalledCommentThread.thread.comments.length - 1], true);
|
|
93
96
|
}
|
|
94
97
|
});
|
|
95
|
-
( Registry.as(Extensions.Configuration)).registerConfiguration({
|
|
98
|
+
( (Registry.as(Extensions.Configuration))).registerConfiguration({
|
|
96
99
|
id: 'comments',
|
|
97
100
|
order: 20,
|
|
98
|
-
title: ( localizeWithPath(
|
|
99
|
-
'vs/workbench/contrib/comments/browser/comments.contribution',
|
|
100
|
-
'commentsConfigurationTitle',
|
|
101
|
-
"Comments"
|
|
102
|
-
)),
|
|
101
|
+
title: ( localizeWithPath(_moduleId, 3, "Comments")),
|
|
103
102
|
type: 'object',
|
|
104
103
|
properties: {
|
|
105
104
|
'comments.openPanel': {
|
|
106
105
|
enum: ['neverOpen', 'openOnSessionStart', 'openOnSessionStartWithComments'],
|
|
107
106
|
default: 'openOnSessionStartWithComments',
|
|
108
|
-
description: ( localizeWithPath(
|
|
109
|
-
'vs/workbench/contrib/comments/browser/comments.contribution',
|
|
110
|
-
'openComments',
|
|
111
|
-
"Controls when the comments panel should open."
|
|
112
|
-
)),
|
|
107
|
+
description: ( localizeWithPath(_moduleId, 4, "Controls when the comments panel should open.")),
|
|
113
108
|
restricted: false,
|
|
114
109
|
markdownDeprecationMessage: ( localizeWithPath(
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
_moduleId,
|
|
111
|
+
5,
|
|
117
112
|
"This setting is deprecated in favor of `comments.openView`."
|
|
118
113
|
))
|
|
119
114
|
},
|
|
120
115
|
'comments.openView': {
|
|
121
116
|
enum: ['never', 'file', 'firstFile', 'firstFileUnresolved'],
|
|
122
|
-
enumDescriptions: [( localizeWithPath(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"The comments view will never be opened."
|
|
126
|
-
)), ( localizeWithPath(
|
|
127
|
-
'vs/workbench/contrib/comments/browser/comments.contribution',
|
|
128
|
-
'comments.openView.file',
|
|
117
|
+
enumDescriptions: [( localizeWithPath(_moduleId, 6, "The comments view will never be opened.")), ( localizeWithPath(
|
|
118
|
+
_moduleId,
|
|
119
|
+
7,
|
|
129
120
|
"The comments view will open when a file with comments is active."
|
|
130
121
|
)), ( localizeWithPath(
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
_moduleId,
|
|
123
|
+
8,
|
|
133
124
|
"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."
|
|
134
125
|
)), ( localizeWithPath(
|
|
135
|
-
|
|
136
|
-
|
|
126
|
+
_moduleId,
|
|
127
|
+
9,
|
|
137
128
|
"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."
|
|
138
129
|
))],
|
|
139
130
|
default: 'firstFile',
|
|
140
|
-
description: ( localizeWithPath(
|
|
141
|
-
'vs/workbench/contrib/comments/browser/comments.contribution',
|
|
142
|
-
'comments.openView',
|
|
143
|
-
"Controls when the comments view should open."
|
|
144
|
-
)),
|
|
131
|
+
description: ( localizeWithPath(_moduleId, 10, "Controls when the comments view should open.")),
|
|
145
132
|
restricted: false
|
|
146
133
|
},
|
|
147
134
|
'comments.useRelativeTime': {
|
|
148
135
|
type: 'boolean',
|
|
149
136
|
default: true,
|
|
150
137
|
description: ( localizeWithPath(
|
|
151
|
-
|
|
152
|
-
|
|
138
|
+
_moduleId,
|
|
139
|
+
11,
|
|
153
140
|
"Determines if relative time will be used in comment timestamps (ex. '1 day ago')."
|
|
154
141
|
))
|
|
155
142
|
},
|
|
@@ -157,26 +144,22 @@ registerAction2(class Reply extends Action2 {
|
|
|
157
144
|
type: 'boolean',
|
|
158
145
|
default: true,
|
|
159
146
|
description: ( localizeWithPath(
|
|
160
|
-
|
|
161
|
-
|
|
147
|
+
_moduleId,
|
|
148
|
+
12,
|
|
162
149
|
"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."
|
|
163
150
|
))
|
|
164
151
|
},
|
|
165
152
|
'comments.maxHeight': {
|
|
166
153
|
type: 'boolean',
|
|
167
154
|
default: true,
|
|
168
|
-
description: ( localizeWithPath(
|
|
169
|
-
'vs/workbench/contrib/comments/browser/comments.contribution',
|
|
170
|
-
'comments.maxHeight',
|
|
171
|
-
"Controls whether the comments widget scrolls or expands."
|
|
172
|
-
))
|
|
155
|
+
description: ( localizeWithPath(_moduleId, 13, "Controls whether the comments widget scrolls or expands."))
|
|
173
156
|
},
|
|
174
157
|
'comments.collapseOnResolve': {
|
|
175
158
|
type: 'boolean',
|
|
176
159
|
default: true,
|
|
177
160
|
description: ( localizeWithPath(
|
|
178
|
-
|
|
179
|
-
|
|
161
|
+
_moduleId,
|
|
162
|
+
14,
|
|
180
163
|
"Controls whether the comment thread should collapse when the thread is resolved."
|
|
181
164
|
))
|
|
182
165
|
}
|
|
@@ -187,7 +170,7 @@ let UnresolvedCommentsBadge = class UnresolvedCommentsBadge extends Disposable {
|
|
|
187
170
|
super();
|
|
188
171
|
this._commentService = _commentService;
|
|
189
172
|
this.activityService = activityService;
|
|
190
|
-
this.activity = this._register(( new MutableDisposable()));
|
|
173
|
+
this.activity = this._register(( (new MutableDisposable())));
|
|
191
174
|
this.totalUnresolved = 0;
|
|
192
175
|
this._register(this._commentService.onDidSetAllCommentThreads(this.onAllCommentsChanged, this));
|
|
193
176
|
this._register(this._commentService.onDidUpdateCommentThreads(this.onCommentsUpdated, this));
|
|
@@ -217,19 +200,14 @@ let UnresolvedCommentsBadge = class UnresolvedCommentsBadge extends Disposable {
|
|
|
217
200
|
return;
|
|
218
201
|
}
|
|
219
202
|
this.totalUnresolved = unresolved;
|
|
220
|
-
const message = ( localizeWithPath(
|
|
221
|
-
|
|
222
|
-
'totalUnresolvedComments',
|
|
223
|
-
'{0} Unresolved Comments',
|
|
224
|
-
this.totalUnresolved
|
|
225
|
-
));
|
|
226
|
-
this.activity.value = this.activityService.showViewActivity(COMMENTS_VIEW_ID, { badge: ( new NumberBadge(this.totalUnresolved, () => message)) });
|
|
203
|
+
const message = ( localizeWithPath(_moduleId, 15, '{0} Unresolved Comments', this.totalUnresolved));
|
|
204
|
+
this.activity.value = this.activityService.showViewActivity(COMMENTS_VIEW_ID, { badge: ( (new NumberBadge(this.totalUnresolved, () => message))) });
|
|
227
205
|
}
|
|
228
206
|
};
|
|
229
|
-
UnresolvedCommentsBadge = ( __decorate([
|
|
230
|
-
( __param(0, ICommentService)),
|
|
231
|
-
( __param(1, IActivityService))
|
|
232
|
-
], UnresolvedCommentsBadge));
|
|
233
|
-
( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(UnresolvedCommentsBadge, 4 );
|
|
207
|
+
UnresolvedCommentsBadge = ( (__decorate([
|
|
208
|
+
( (__param(0, ICommentService))),
|
|
209
|
+
( (__param(1, IActivityService)))
|
|
210
|
+
], UnresolvedCommentsBadge)));
|
|
211
|
+
( (Registry.as(Extensions$1.Workbench))).registerWorkbenchContribution(UnresolvedCommentsBadge, 4 );
|
|
234
212
|
|
|
235
213
|
export { UnresolvedCommentsBadge };
|
|
@@ -18,8 +18,12 @@ import { CommentContextKeys } from 'vscode/vscode/vs/workbench/contrib/comments/
|
|
|
18
18
|
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
19
19
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
20
20
|
import { accessibilityHelpIsShown, accessibleViewCurrentProviderId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
21
|
+
import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
22
|
+
import { CommentsInputContentProvider } from './commentsInputContentProvider.js';
|
|
21
23
|
|
|
24
|
+
const _moduleId = "vs/workbench/contrib/comments/browser/commentsEditorContribution";
|
|
22
25
|
registerEditorContribution(ID, CommentController, 1 );
|
|
26
|
+
registerWorkbenchContribution2(CommentsInputContentProvider.ID, CommentsInputContentProvider, 2 );
|
|
23
27
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
24
28
|
id: "editor.action.nextCommentThreadAction" ,
|
|
25
29
|
handler: async (accessor, args) => {
|
|
@@ -65,18 +69,21 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
65
69
|
}
|
|
66
70
|
controller.nextCommentingRange();
|
|
67
71
|
},
|
|
68
|
-
when: ( ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,
|
|
72
|
+
when: ( (ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, (ContextKeyExpr.or(
|
|
73
|
+
EditorContextKeys.focus,
|
|
74
|
+
CommentContextKeys.commentFocused,
|
|
75
|
+
(ContextKeyExpr.and(
|
|
76
|
+
accessibilityHelpIsShown,
|
|
77
|
+
(accessibleViewCurrentProviderId.isEqualTo("comments" ))
|
|
78
|
+
))
|
|
79
|
+
))))),
|
|
69
80
|
primary: KeyChord(2048 | 41 , 2048 | 512 | 18 ),
|
|
70
81
|
weight: 100
|
|
71
82
|
});
|
|
72
83
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
73
84
|
command: {
|
|
74
85
|
id: "editor.action.nextCommentingRange" ,
|
|
75
|
-
title: ( localizeWithPath(
|
|
76
|
-
'vs/workbench/contrib/comments/browser/commentsEditorContribution',
|
|
77
|
-
'comments.nextCommentingRange',
|
|
78
|
-
"Go to Next Commenting Range"
|
|
79
|
-
)),
|
|
86
|
+
title: ( localizeWithPath(_moduleId, 0, "Go to Next Commenting Range")),
|
|
80
87
|
category: 'Comments',
|
|
81
88
|
},
|
|
82
89
|
when: CommentContextKeys.activeEditorHasCommentingRange
|
|
@@ -94,18 +101,21 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
94
101
|
}
|
|
95
102
|
controller.previousCommentingRange();
|
|
96
103
|
},
|
|
97
|
-
when: ( ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,
|
|
104
|
+
when: ( (ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, (ContextKeyExpr.or(
|
|
105
|
+
EditorContextKeys.focus,
|
|
106
|
+
CommentContextKeys.commentFocused,
|
|
107
|
+
(ContextKeyExpr.and(
|
|
108
|
+
accessibilityHelpIsShown,
|
|
109
|
+
(accessibleViewCurrentProviderId.isEqualTo("comments" ))
|
|
110
|
+
))
|
|
111
|
+
))))),
|
|
98
112
|
primary: KeyChord(2048 | 41 , 2048 | 512 | 16 ),
|
|
99
113
|
weight: 100
|
|
100
114
|
});
|
|
101
115
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
102
116
|
command: {
|
|
103
117
|
id: "editor.action.previousCommentingRange" ,
|
|
104
|
-
title: ( localizeWithPath(
|
|
105
|
-
'vs/workbench/contrib/comments/browser/commentsEditorContribution',
|
|
106
|
-
'comments.previousCommentingRange',
|
|
107
|
-
"Go to Previous Commenting Range"
|
|
108
|
-
)),
|
|
118
|
+
title: ( localizeWithPath(_moduleId, 1, "Go to Previous Commenting Range")),
|
|
109
119
|
category: 'Comments',
|
|
110
120
|
},
|
|
111
121
|
when: CommentContextKeys.activeEditorHasCommentingRange
|
|
@@ -121,11 +131,7 @@ CommandsRegistry.registerCommand({
|
|
|
121
131
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
122
132
|
command: {
|
|
123
133
|
id: "workbench.action.toggleCommenting" ,
|
|
124
|
-
title: ( localizeWithPath(
|
|
125
|
-
'vs/workbench/contrib/comments/browser/commentsEditorContribution',
|
|
126
|
-
'comments.toggleCommenting',
|
|
127
|
-
"Toggle Editor Commenting"
|
|
128
|
-
)),
|
|
134
|
+
title: ( localizeWithPath(_moduleId, 2, "Toggle Editor Commenting")),
|
|
129
135
|
category: 'Comments',
|
|
130
136
|
},
|
|
131
137
|
when: CommentContextKeys.WorkspaceHasCommenting
|
|
@@ -141,12 +147,12 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
141
147
|
if (!controller) {
|
|
142
148
|
return Promise.resolve();
|
|
143
149
|
}
|
|
144
|
-
const position = args?.range ? ( new Range(
|
|
150
|
+
const position = args?.range ? ( (new Range(
|
|
145
151
|
args.range.startLineNumber,
|
|
146
152
|
args.range.startLineNumber,
|
|
147
153
|
args.range.endLineNumber,
|
|
148
154
|
args.range.endColumn
|
|
149
|
-
))
|
|
155
|
+
)))
|
|
150
156
|
: (args?.fileComment ? undefined : activeEditor.getSelection());
|
|
151
157
|
const notificationService = accessor.get(INotificationService);
|
|
152
158
|
try {
|
|
@@ -154,8 +160,8 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
154
160
|
}
|
|
155
161
|
catch (e) {
|
|
156
162
|
notificationService.error(( localizeWithPath(
|
|
157
|
-
|
|
158
|
-
|
|
163
|
+
_moduleId,
|
|
164
|
+
3,
|
|
159
165
|
"The cursor must be within a commenting range to add a comment"
|
|
160
166
|
)));
|
|
161
167
|
}
|
|
@@ -166,11 +172,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
166
172
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
167
173
|
command: {
|
|
168
174
|
id: "workbench.action.addComment" ,
|
|
169
|
-
title: ( localizeWithPath(
|
|
170
|
-
'vs/workbench/contrib/comments/browser/commentsEditorContribution',
|
|
171
|
-
'comments.addCommand',
|
|
172
|
-
"Add Comment on Current Selection"
|
|
173
|
-
)),
|
|
175
|
+
title: ( localizeWithPath(_moduleId, 4, "Add Comment on Current Selection")),
|
|
174
176
|
category: 'Comments'
|
|
175
177
|
},
|
|
176
178
|
when: CommentContextKeys.activeCursorHasCommentingRange
|
|
@@ -184,11 +186,7 @@ CommandsRegistry.registerCommand({
|
|
|
184
186
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
185
187
|
command: {
|
|
186
188
|
id: "workbench.action.collapseAllComments" ,
|
|
187
|
-
title: ( localizeWithPath(
|
|
188
|
-
'vs/workbench/contrib/comments/browser/commentsEditorContribution',
|
|
189
|
-
'comments.collapseAll',
|
|
190
|
-
"Collapse All Comments"
|
|
191
|
-
)),
|
|
189
|
+
title: ( localizeWithPath(_moduleId, 5, "Collapse All Comments")),
|
|
192
190
|
category: 'Comments'
|
|
193
191
|
},
|
|
194
192
|
when: CommentContextKeys.WorkspaceHasCommenting
|
|
@@ -202,11 +200,7 @@ CommandsRegistry.registerCommand({
|
|
|
202
200
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
203
201
|
command: {
|
|
204
202
|
id: "workbench.action.expandAllComments" ,
|
|
205
|
-
title: ( localizeWithPath(
|
|
206
|
-
'vs/workbench/contrib/comments/browser/commentsEditorContribution',
|
|
207
|
-
'comments.expandAll',
|
|
208
|
-
"Expand All Comments"
|
|
209
|
-
)),
|
|
203
|
+
title: ( localizeWithPath(_moduleId, 6, "Expand All Comments")),
|
|
210
204
|
category: 'Comments'
|
|
211
205
|
},
|
|
212
206
|
when: CommentContextKeys.WorkspaceHasCommenting
|
|
@@ -220,11 +214,7 @@ CommandsRegistry.registerCommand({
|
|
|
220
214
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
221
215
|
command: {
|
|
222
216
|
id: "workbench.action.expandUnresolvedComments" ,
|
|
223
|
-
title: ( localizeWithPath(
|
|
224
|
-
'vs/workbench/contrib/comments/browser/commentsEditorContribution',
|
|
225
|
-
'comments.expandUnresolved',
|
|
226
|
-
"Expand Unresolved Comments"
|
|
227
|
-
)),
|
|
217
|
+
title: ( localizeWithPath(_moduleId, 7, "Expand Unresolved Comments")),
|
|
228
218
|
category: 'Comments'
|
|
229
219
|
},
|
|
230
220
|
when: CommentContextKeys.WorkspaceHasCommenting
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
4
|
+
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
5
|
+
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
6
|
+
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
7
|
+
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
8
|
+
import { applyTextEditorOptions } from 'vscode/vscode/vs/workbench/common/editor/editorOptions';
|
|
9
|
+
import { SimpleCommentEditor } from 'vscode/vscode/vs/workbench/contrib/comments/browser/simpleCommentEditor';
|
|
10
|
+
|
|
11
|
+
let CommentsInputContentProvider = class CommentsInputContentProvider extends Disposable {
|
|
12
|
+
static { this.ID = 'comments.input.contentProvider'; }
|
|
13
|
+
constructor(textModelService, codeEditorService, _modelService, _languageService) {
|
|
14
|
+
super();
|
|
15
|
+
this._modelService = _modelService;
|
|
16
|
+
this._languageService = _languageService;
|
|
17
|
+
this._register(textModelService.registerTextModelContentProvider(Schemas.commentsInput, this));
|
|
18
|
+
this._register(codeEditorService.registerCodeEditorOpenHandler(async (input, editor, _sideBySide) => {
|
|
19
|
+
if (!(editor instanceof SimpleCommentEditor)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if (editor.getModel()?.uri.toString() !== ( input.resource.toString())) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
if (input.options) {
|
|
26
|
+
applyTextEditorOptions(input.options, editor, 1 );
|
|
27
|
+
}
|
|
28
|
+
return editor;
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
async provideTextContent(resource) {
|
|
32
|
+
const existing = this._modelService.getModel(resource);
|
|
33
|
+
return existing ?? this._modelService.createModel('', this._languageService.createById('markdown'), resource);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
CommentsInputContentProvider = ( __decorate([
|
|
37
|
+
( __param(0, ITextModelService)),
|
|
38
|
+
( __param(1, ICodeEditorService)),
|
|
39
|
+
( __param(2, IModelService)),
|
|
40
|
+
( __param(3, ILanguageService))
|
|
41
|
+
], CommentsInputContentProvider));
|
|
42
|
+
|
|
43
|
+
export { CommentsInputContentProvider };
|