@codingame/monaco-vscode-extensions-service-override 2.1.4 → 2.2.0-next.2
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/extensions.js +3 -0
- package/package.json +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +1 -1
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/vscode/src/vs/platform/log/browser/log.js +0 -26
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +0 -92
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +0 -109
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +0 -397
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +0 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +0 -1279
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +0 -19
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +0 -125
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +0 -344
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +0 -453
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +0 -178
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +0 -36
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +0 -180
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +0 -5
|
@@ -1,453 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import './media/panel.css.js';
|
|
3
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
-
import { append, $, createStyleSheet, isActiveElement } from 'vscode/vscode/vs/base/browser/dom';
|
|
5
|
-
import { basename } from 'vscode/vscode/vs/base/common/resources';
|
|
6
|
-
import { isDiffEditor, isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
7
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
-
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
9
|
-
import { ResourceWithCommentThreads, CommentNode } from '../common/commentModel.js';
|
|
10
|
-
import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService';
|
|
11
|
-
import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
12
|
-
import { textLinkForeground, textLinkActiveForeground, focusBorder, textPreformatForeground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
13
|
-
import { ResourceLabels } from 'vscode/vscode/vs/workbench/browser/labels';
|
|
14
|
-
import { Filter, CommentsList, COMMENTS_VIEW_TITLE } from './commentsTreeViewer.js';
|
|
15
|
-
import { FilterViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
16
|
-
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
17
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
18
|
-
import { RawContextKey, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
19
|
-
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
20
|
-
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
21
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
22
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
23
|
-
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
24
|
-
import { TextModel } from 'vscode/vscode/vs/editor/common/model/textModel';
|
|
25
|
-
import { CommentsViewFilterFocusContextKey } from './comments.js';
|
|
26
|
-
import { CommentsFilters } from './commentsViewActions.js';
|
|
27
|
-
import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
|
|
28
|
-
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
29
|
-
import { FilterOptions } from './commentsFilterOptions.js';
|
|
30
|
-
import 'vscode/vscode/vs/editor/common/languages';
|
|
31
|
-
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
32
|
-
import { CommentController } from './commentsController.js';
|
|
33
|
-
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
34
|
-
import { registerNavigableContainer } from 'vscode/vscode/vs/workbench/browser/actions/widgetNavigationCommands';
|
|
35
|
-
import { CommentsModel } from './commentsModel.js';
|
|
36
|
-
|
|
37
|
-
const CONTEXT_KEY_HAS_COMMENTS = ( new RawContextKey('commentsView.hasComments', false));
|
|
38
|
-
const CONTEXT_KEY_SOME_COMMENTS_EXPANDED = ( new RawContextKey('commentsView.someCommentsExpanded', false));
|
|
39
|
-
const VIEW_STORAGE_ID = 'commentsViewState';
|
|
40
|
-
function createResourceCommentsIterator(model) {
|
|
41
|
-
return ( Iterable.map(model.resourceCommentThreads, m => {
|
|
42
|
-
const CommentNodeIt = Iterable.from(m.commentThreads);
|
|
43
|
-
const children = ( Iterable.map(CommentNodeIt, r => ({ element: r })));
|
|
44
|
-
return { element: m, children };
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
let CommentsPanel = class CommentsPanel extends FilterViewPane {
|
|
48
|
-
constructor(options, instantiationService, viewDescriptorService, editorService, configurationService, contextKeyService, contextMenuService, keybindingService, openerService, themeService, commentService, telemetryService, uriIdentityService, storageService) {
|
|
49
|
-
const stateMemento = ( new Memento(VIEW_STORAGE_ID, storageService));
|
|
50
|
-
const viewState = stateMemento.getMemento(1 , 1 );
|
|
51
|
-
super({
|
|
52
|
-
...options,
|
|
53
|
-
filterOptions: {
|
|
54
|
-
placeholder: ( localizeWithPath(
|
|
55
|
-
'vs/workbench/contrib/comments/browser/commentsView',
|
|
56
|
-
'comments.filter.placeholder',
|
|
57
|
-
"Filter (e.g. text, author)"
|
|
58
|
-
)),
|
|
59
|
-
ariaLabel: ( localizeWithPath(
|
|
60
|
-
'vs/workbench/contrib/comments/browser/commentsView',
|
|
61
|
-
'comments.filter.ariaLabel',
|
|
62
|
-
"Filter comments"
|
|
63
|
-
)),
|
|
64
|
-
history: viewState['filterHistory'] || [],
|
|
65
|
-
text: viewState['filter'] || '',
|
|
66
|
-
focusContextKey: CommentsViewFilterFocusContextKey.key
|
|
67
|
-
}
|
|
68
|
-
}, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
69
|
-
this.editorService = editorService;
|
|
70
|
-
this.commentService = commentService;
|
|
71
|
-
this.uriIdentityService = uriIdentityService;
|
|
72
|
-
this.totalComments = 0;
|
|
73
|
-
this.currentHeight = 0;
|
|
74
|
-
this.currentWidth = 0;
|
|
75
|
-
this.cachedFilterStats = undefined;
|
|
76
|
-
this.onDidChangeVisibility = this.onDidChangeBodyVisibility;
|
|
77
|
-
this.hasCommentsContextKey = CONTEXT_KEY_HAS_COMMENTS.bindTo(contextKeyService);
|
|
78
|
-
this.someCommentsExpandedContextKey = CONTEXT_KEY_SOME_COMMENTS_EXPANDED.bindTo(contextKeyService);
|
|
79
|
-
this.stateMemento = stateMemento;
|
|
80
|
-
this.viewState = viewState;
|
|
81
|
-
this.filters = this._register(( new CommentsFilters({
|
|
82
|
-
showResolved: this.viewState['showResolved'] !== false,
|
|
83
|
-
showUnresolved: this.viewState['showUnresolved'] !== false,
|
|
84
|
-
}, this.contextKeyService)));
|
|
85
|
-
this.filter = ( new Filter(( new FilterOptions(
|
|
86
|
-
this.filterWidget.getFilterText(),
|
|
87
|
-
this.filters.showResolved,
|
|
88
|
-
this.filters.showUnresolved
|
|
89
|
-
))));
|
|
90
|
-
this._register(this.filters.onDidChange((event) => {
|
|
91
|
-
if (event.showResolved || event.showUnresolved) {
|
|
92
|
-
this.updateFilter();
|
|
93
|
-
}
|
|
94
|
-
}));
|
|
95
|
-
this._register(this.filterWidget.onDidChangeFilterText(() => this.updateFilter()));
|
|
96
|
-
}
|
|
97
|
-
saveState() {
|
|
98
|
-
this.viewState['filter'] = this.filterWidget.getFilterText();
|
|
99
|
-
this.viewState['filterHistory'] = this.filterWidget.getHistory();
|
|
100
|
-
this.viewState['showResolved'] = this.filters.showResolved;
|
|
101
|
-
this.viewState['showUnresolved'] = this.filters.showUnresolved;
|
|
102
|
-
this.stateMemento.saveMemento();
|
|
103
|
-
super.saveState();
|
|
104
|
-
}
|
|
105
|
-
render() {
|
|
106
|
-
super.render();
|
|
107
|
-
this._register(registerNavigableContainer({
|
|
108
|
-
focusNotifiers: [this, this.filterWidget],
|
|
109
|
-
focusNextWidget: () => {
|
|
110
|
-
if (this.filterWidget.hasFocus()) {
|
|
111
|
-
this.focus();
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
focusPreviousWidget: () => {
|
|
115
|
-
if (!this.filterWidget.hasFocus()) {
|
|
116
|
-
this.focusFilter();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}));
|
|
120
|
-
}
|
|
121
|
-
focusFilter() {
|
|
122
|
-
this.filterWidget.focus();
|
|
123
|
-
}
|
|
124
|
-
clearFilterText() {
|
|
125
|
-
this.filterWidget.setFilterText('');
|
|
126
|
-
}
|
|
127
|
-
getFilterStats() {
|
|
128
|
-
if (!this.cachedFilterStats) {
|
|
129
|
-
this.cachedFilterStats = {
|
|
130
|
-
total: this.totalComments,
|
|
131
|
-
filtered: this.tree?.getVisibleItemCount() ?? 0
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
return this.cachedFilterStats;
|
|
135
|
-
}
|
|
136
|
-
updateFilter() {
|
|
137
|
-
this.filter.options = ( new FilterOptions(
|
|
138
|
-
this.filterWidget.getFilterText(),
|
|
139
|
-
this.filters.showResolved,
|
|
140
|
-
this.filters.showUnresolved
|
|
141
|
-
));
|
|
142
|
-
this.tree?.filterComments();
|
|
143
|
-
this.cachedFilterStats = undefined;
|
|
144
|
-
const { total, filtered } = this.getFilterStats();
|
|
145
|
-
this.filterWidget.updateBadge(total === filtered || total === 0 ? undefined : ( localizeWithPath(
|
|
146
|
-
'vs/workbench/contrib/comments/browser/commentsView',
|
|
147
|
-
'showing filtered results',
|
|
148
|
-
"Showing {0} of {1}",
|
|
149
|
-
filtered,
|
|
150
|
-
total
|
|
151
|
-
)));
|
|
152
|
-
this.filterWidget.checkMoreFilters(!this.filters.showResolved || !this.filters.showUnresolved);
|
|
153
|
-
}
|
|
154
|
-
renderBody(container) {
|
|
155
|
-
super.renderBody(container);
|
|
156
|
-
container.classList.add('comments-panel');
|
|
157
|
-
const domContainer = append(container, $('.comments-panel-container'));
|
|
158
|
-
this.treeContainer = append(domContainer, $('.tree-container'));
|
|
159
|
-
this.treeContainer.classList.add('file-icon-themable-tree', 'show-file-icons');
|
|
160
|
-
this.cachedFilterStats = undefined;
|
|
161
|
-
this.createTree();
|
|
162
|
-
this.createMessageBox(domContainer);
|
|
163
|
-
this._register(this.commentService.onDidSetAllCommentThreads(this.onAllCommentsChanged, this));
|
|
164
|
-
this._register(this.commentService.onDidUpdateCommentThreads(this.onCommentsUpdated, this));
|
|
165
|
-
this._register(this.commentService.onDidDeleteDataProvider(this.onDataProviderDeleted, this));
|
|
166
|
-
const styleElement = createStyleSheet(container);
|
|
167
|
-
this.applyStyles(styleElement);
|
|
168
|
-
this._register(this.themeService.onDidColorThemeChange(_ => this.applyStyles(styleElement)));
|
|
169
|
-
this._register(this.onDidChangeBodyVisibility(visible => {
|
|
170
|
-
if (visible) {
|
|
171
|
-
this.refresh();
|
|
172
|
-
}
|
|
173
|
-
}));
|
|
174
|
-
this.renderComments();
|
|
175
|
-
}
|
|
176
|
-
focus() {
|
|
177
|
-
super.focus();
|
|
178
|
-
const element = this.tree?.getHTMLElement();
|
|
179
|
-
if (element && isActiveElement(element)) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
if (!this.commentService.commentsModel.hasCommentThreads() && this.messageBoxContainer) {
|
|
183
|
-
this.messageBoxContainer.focus();
|
|
184
|
-
}
|
|
185
|
-
else if (this.tree) {
|
|
186
|
-
this.tree.domFocus();
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
applyStyles(styleElement) {
|
|
190
|
-
const content = [];
|
|
191
|
-
const theme = this.themeService.getColorTheme();
|
|
192
|
-
const linkColor = theme.getColor(textLinkForeground);
|
|
193
|
-
if (linkColor) {
|
|
194
|
-
content.push(`.comments-panel .comments-panel-container a { color: ${linkColor}; }`);
|
|
195
|
-
}
|
|
196
|
-
const linkActiveColor = theme.getColor(textLinkActiveForeground);
|
|
197
|
-
if (linkActiveColor) {
|
|
198
|
-
content.push(`.comments-panel .comments-panel-container a:hover, a:active { color: ${linkActiveColor}; }`);
|
|
199
|
-
}
|
|
200
|
-
const focusColor = theme.getColor(focusBorder);
|
|
201
|
-
if (focusColor) {
|
|
202
|
-
content.push(`.comments-panel .comments-panel-container a:focus { outline-color: ${focusColor}; }`);
|
|
203
|
-
}
|
|
204
|
-
const codeTextForegroundColor = theme.getColor(textPreformatForeground);
|
|
205
|
-
if (codeTextForegroundColor) {
|
|
206
|
-
content.push(`.comments-panel .comments-panel-container .text code { color: ${codeTextForegroundColor}; }`);
|
|
207
|
-
}
|
|
208
|
-
styleElement.textContent = content.join('\n');
|
|
209
|
-
}
|
|
210
|
-
async renderComments() {
|
|
211
|
-
this.treeContainer.classList.toggle('hidden', !this.commentService.commentsModel.hasCommentThreads());
|
|
212
|
-
this.renderMessage();
|
|
213
|
-
await this.tree?.setChildren(null, createResourceCommentsIterator(this.commentService.commentsModel));
|
|
214
|
-
}
|
|
215
|
-
collapseAll() {
|
|
216
|
-
if (this.tree) {
|
|
217
|
-
this.tree.collapseAll();
|
|
218
|
-
this.tree.setSelection([]);
|
|
219
|
-
this.tree.setFocus([]);
|
|
220
|
-
this.tree.domFocus();
|
|
221
|
-
this.tree.focusFirst();
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
expandAll() {
|
|
225
|
-
if (this.tree) {
|
|
226
|
-
this.tree.expandAll();
|
|
227
|
-
this.tree.setSelection([]);
|
|
228
|
-
this.tree.setFocus([]);
|
|
229
|
-
this.tree.domFocus();
|
|
230
|
-
this.tree.focusFirst();
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
get hasRendered() {
|
|
234
|
-
return !!this.tree;
|
|
235
|
-
}
|
|
236
|
-
layoutBodyContent(height = this.currentHeight, width = this.currentWidth) {
|
|
237
|
-
if (this.messageBoxContainer) {
|
|
238
|
-
this.messageBoxContainer.style.height = `${height}px`;
|
|
239
|
-
}
|
|
240
|
-
this.tree?.layout(height, width);
|
|
241
|
-
this.currentHeight = height;
|
|
242
|
-
this.currentWidth = width;
|
|
243
|
-
}
|
|
244
|
-
createMessageBox(parent) {
|
|
245
|
-
this.messageBoxContainer = append(parent, $('.message-box-container'));
|
|
246
|
-
this.messageBoxContainer.setAttribute('tabIndex', '0');
|
|
247
|
-
}
|
|
248
|
-
renderMessage() {
|
|
249
|
-
this.messageBoxContainer.textContent = this.commentService.commentsModel.getMessage();
|
|
250
|
-
this.messageBoxContainer.classList.toggle('hidden', this.commentService.commentsModel.hasCommentThreads());
|
|
251
|
-
}
|
|
252
|
-
createTree() {
|
|
253
|
-
this.treeLabels = this._register(this.instantiationService.createInstance(ResourceLabels, this));
|
|
254
|
-
this.tree = this._register(this.instantiationService.createInstance(CommentsList, this.treeLabels, this.treeContainer, {
|
|
255
|
-
overrideStyles: { listBackground: this.getBackgroundColor() },
|
|
256
|
-
selectionNavigation: true,
|
|
257
|
-
filter: this.filter,
|
|
258
|
-
keyboardNavigationLabelProvider: {
|
|
259
|
-
getKeyboardNavigationLabel: (item) => {
|
|
260
|
-
return undefined;
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
accessibilityProvider: {
|
|
264
|
-
getAriaLabel(element) {
|
|
265
|
-
if (element instanceof CommentsModel) {
|
|
266
|
-
return ( localizeWithPath(
|
|
267
|
-
'vs/workbench/contrib/comments/browser/commentsView',
|
|
268
|
-
'rootCommentsLabel',
|
|
269
|
-
"Comments for current workspace"
|
|
270
|
-
));
|
|
271
|
-
}
|
|
272
|
-
if (element instanceof ResourceWithCommentThreads) {
|
|
273
|
-
return ( localizeWithPath(
|
|
274
|
-
'vs/workbench/contrib/comments/browser/commentsView',
|
|
275
|
-
'resourceWithCommentThreadsLabel',
|
|
276
|
-
"Comments in {0}, full path {1}",
|
|
277
|
-
basename(element.resource),
|
|
278
|
-
element.resource.fsPath
|
|
279
|
-
));
|
|
280
|
-
}
|
|
281
|
-
if (element instanceof CommentNode) {
|
|
282
|
-
if (element.range) {
|
|
283
|
-
return ( localizeWithPath(
|
|
284
|
-
'vs/workbench/contrib/comments/browser/commentsView',
|
|
285
|
-
'resourceWithCommentLabel',
|
|
286
|
-
"Comment from ${0} at line {1} column {2} in {3}, source: {4}",
|
|
287
|
-
element.comment.userName,
|
|
288
|
-
element.range.startLineNumber,
|
|
289
|
-
element.range.startColumn,
|
|
290
|
-
basename(element.resource),
|
|
291
|
-
(typeof element.comment.body === 'string') ? element.comment.body : element.comment.body.value
|
|
292
|
-
));
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
return ( localizeWithPath(
|
|
296
|
-
'vs/workbench/contrib/comments/browser/commentsView',
|
|
297
|
-
'resourceWithCommentLabelFile',
|
|
298
|
-
"Comment from ${0} in {1}, source: {2}",
|
|
299
|
-
element.comment.userName,
|
|
300
|
-
basename(element.resource),
|
|
301
|
-
(typeof element.comment.body === 'string') ? element.comment.body : element.comment.body.value
|
|
302
|
-
));
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
return '';
|
|
306
|
-
},
|
|
307
|
-
getWidgetAriaLabel() {
|
|
308
|
-
return COMMENTS_VIEW_TITLE.value;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}));
|
|
312
|
-
this._register(this.tree.onDidOpen(e => {
|
|
313
|
-
this.openFile(e.element, e.editorOptions.pinned, e.editorOptions.preserveFocus, e.sideBySide);
|
|
314
|
-
}));
|
|
315
|
-
this._register(this.tree.onDidChangeModel(() => {
|
|
316
|
-
this.updateSomeCommentsExpanded();
|
|
317
|
-
}));
|
|
318
|
-
this._register(this.tree.onDidChangeCollapseState(() => {
|
|
319
|
-
this.updateSomeCommentsExpanded();
|
|
320
|
-
}));
|
|
321
|
-
}
|
|
322
|
-
openFile(element, pinned, preserveFocus, sideBySide) {
|
|
323
|
-
if (!element) {
|
|
324
|
-
return false;
|
|
325
|
-
}
|
|
326
|
-
if (!(element instanceof ResourceWithCommentThreads || element instanceof CommentNode)) {
|
|
327
|
-
return false;
|
|
328
|
-
}
|
|
329
|
-
if (!this.commentService.isCommentingEnabled) {
|
|
330
|
-
this.commentService.enableCommenting(true);
|
|
331
|
-
}
|
|
332
|
-
const range = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].range : element.range;
|
|
333
|
-
const activeEditor = this.editorService.activeTextEditorControl;
|
|
334
|
-
const currentActiveResources = isDiffEditor(activeEditor) ? [activeEditor.getOriginalEditor(), activeEditor.getModifiedEditor()]
|
|
335
|
-
: (activeEditor ? [activeEditor] : []);
|
|
336
|
-
for (const editor of currentActiveResources) {
|
|
337
|
-
const model = editor.getModel();
|
|
338
|
-
if ((model instanceof TextModel) && this.uriIdentityService.extUri.isEqual(element.resource, model.uri)) {
|
|
339
|
-
const threadToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].threadId : element.threadId;
|
|
340
|
-
const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment.uniqueIdInThread : element.comment.uniqueIdInThread;
|
|
341
|
-
if (threadToReveal && isCodeEditor(editor)) {
|
|
342
|
-
const controller = CommentController.get(editor);
|
|
343
|
-
controller?.revealCommentThread(threadToReveal, commentToReveal, true, !preserveFocus);
|
|
344
|
-
}
|
|
345
|
-
return true;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
const threadToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].threadId : element.threadId;
|
|
349
|
-
const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment : element.comment;
|
|
350
|
-
this.editorService.openEditor({
|
|
351
|
-
resource: element.resource,
|
|
352
|
-
options: {
|
|
353
|
-
pinned: pinned,
|
|
354
|
-
preserveFocus: preserveFocus,
|
|
355
|
-
selection: range ?? ( new Range(1, 1, 1, 1))
|
|
356
|
-
}
|
|
357
|
-
}, sideBySide ? SIDE_GROUP : ACTIVE_GROUP).then(editor => {
|
|
358
|
-
if (editor) {
|
|
359
|
-
const control = editor.getControl();
|
|
360
|
-
if (threadToReveal && isCodeEditor(control)) {
|
|
361
|
-
const controller = CommentController.get(control);
|
|
362
|
-
controller?.revealCommentThread(threadToReveal, commentToReveal.uniqueIdInThread, true, !preserveFocus);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
return true;
|
|
367
|
-
}
|
|
368
|
-
async refresh() {
|
|
369
|
-
if (!this.tree) {
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
if (this.isVisible()) {
|
|
373
|
-
this.hasCommentsContextKey.set(this.commentService.commentsModel.hasCommentThreads());
|
|
374
|
-
this.treeContainer.classList.toggle('hidden', !this.commentService.commentsModel.hasCommentThreads());
|
|
375
|
-
this.cachedFilterStats = undefined;
|
|
376
|
-
this.renderMessage();
|
|
377
|
-
this.tree?.setChildren(null, createResourceCommentsIterator(this.commentService.commentsModel));
|
|
378
|
-
if (this.tree.getSelection().length === 0 && this.commentService.commentsModel.hasCommentThreads()) {
|
|
379
|
-
const firstComment = this.commentService.commentsModel.resourceCommentThreads[0].commentThreads[0];
|
|
380
|
-
if (firstComment) {
|
|
381
|
-
this.tree.setFocus([firstComment]);
|
|
382
|
-
this.tree.setSelection([firstComment]);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
onAllCommentsChanged(e) {
|
|
388
|
-
this.cachedFilterStats = undefined;
|
|
389
|
-
this.totalComments += e.commentThreads.length;
|
|
390
|
-
for (const thread of e.commentThreads) {
|
|
391
|
-
}
|
|
392
|
-
this.refresh();
|
|
393
|
-
}
|
|
394
|
-
onCommentsUpdated(e) {
|
|
395
|
-
this.cachedFilterStats = undefined;
|
|
396
|
-
this.totalComments += e.added.length;
|
|
397
|
-
this.totalComments -= e.removed.length;
|
|
398
|
-
for (const resource of this.commentService.commentsModel.resourceCommentThreads) {
|
|
399
|
-
for (const thread of resource.commentThreads) {
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
this.refresh();
|
|
403
|
-
}
|
|
404
|
-
onDataProviderDeleted(owner) {
|
|
405
|
-
this.cachedFilterStats = undefined;
|
|
406
|
-
this.totalComments = 0;
|
|
407
|
-
this.refresh();
|
|
408
|
-
}
|
|
409
|
-
updateSomeCommentsExpanded() {
|
|
410
|
-
this.someCommentsExpandedContextKey.set(this.isSomeCommentsExpanded());
|
|
411
|
-
}
|
|
412
|
-
areAllCommentsExpanded() {
|
|
413
|
-
if (!this.tree) {
|
|
414
|
-
return false;
|
|
415
|
-
}
|
|
416
|
-
const navigator = this.tree.navigate();
|
|
417
|
-
while (navigator.next()) {
|
|
418
|
-
if (this.tree.isCollapsed(navigator.current())) {
|
|
419
|
-
return false;
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
return true;
|
|
423
|
-
}
|
|
424
|
-
isSomeCommentsExpanded() {
|
|
425
|
-
if (!this.tree) {
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
|
-
const navigator = this.tree.navigate();
|
|
429
|
-
while (navigator.next()) {
|
|
430
|
-
if (!this.tree.isCollapsed(navigator.current())) {
|
|
431
|
-
return true;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
return false;
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
CommentsPanel = ( __decorate([
|
|
438
|
-
( __param(1, IInstantiationService)),
|
|
439
|
-
( __param(2, IViewDescriptorService)),
|
|
440
|
-
( __param(3, IEditorService)),
|
|
441
|
-
( __param(4, IConfigurationService)),
|
|
442
|
-
( __param(5, IContextKeyService)),
|
|
443
|
-
( __param(6, IContextMenuService)),
|
|
444
|
-
( __param(7, IKeybindingService)),
|
|
445
|
-
( __param(8, IOpenerService)),
|
|
446
|
-
( __param(9, IThemeService)),
|
|
447
|
-
( __param(10, ICommentService)),
|
|
448
|
-
( __param(11, ITelemetryService)),
|
|
449
|
-
( __param(12, IUriIdentityService)),
|
|
450
|
-
( __param(13, IStorageService))
|
|
451
|
-
], CommentsPanel));
|
|
452
|
-
|
|
453
|
-
export { CONTEXT_KEY_HAS_COMMENTS, CONTEXT_KEY_SOME_COMMENTS_EXPANDED, CommentsPanel };
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { RawContextKey, ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
4
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
-
import { CommentsViewFilterFocusContextKey } from './comments.js';
|
|
6
|
-
import { registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
|
-
import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
8
|
-
import { COMMENTS_VIEW_ID } from './commentsTreeViewer.js';
|
|
9
|
-
import { FocusedViewContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
10
|
-
import { viewFilterSubmenu } from 'vscode/vscode/vs/workbench/browser/parts/views/viewFilter';
|
|
11
|
-
|
|
12
|
-
const CONTEXT_KEY_SHOW_RESOLVED = ( new RawContextKey('commentsView.showResolvedFilter', true));
|
|
13
|
-
const CONTEXT_KEY_SHOW_UNRESOLVED = ( new RawContextKey('commentsView.showUnResolvedFilter', true));
|
|
14
|
-
class CommentsFilters extends Disposable {
|
|
15
|
-
constructor(options, contextKeyService) {
|
|
16
|
-
super();
|
|
17
|
-
this.contextKeyService = contextKeyService;
|
|
18
|
-
this._onDidChange = this._register(( new Emitter()));
|
|
19
|
-
this.onDidChange = this._onDidChange.event;
|
|
20
|
-
this._showUnresolved = CONTEXT_KEY_SHOW_UNRESOLVED.bindTo(this.contextKeyService);
|
|
21
|
-
this._showResolved = CONTEXT_KEY_SHOW_RESOLVED.bindTo(this.contextKeyService);
|
|
22
|
-
this._showResolved.set(options.showResolved);
|
|
23
|
-
this._showUnresolved.set(options.showUnresolved);
|
|
24
|
-
}
|
|
25
|
-
get showUnresolved() {
|
|
26
|
-
return !!this._showUnresolved.get();
|
|
27
|
-
}
|
|
28
|
-
set showUnresolved(showUnresolved) {
|
|
29
|
-
if (this._showUnresolved.get() !== showUnresolved) {
|
|
30
|
-
this._showUnresolved.set(showUnresolved);
|
|
31
|
-
this._onDidChange.fire({ showUnresolved: true });
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
get showResolved() {
|
|
35
|
-
return !!this._showResolved.get();
|
|
36
|
-
}
|
|
37
|
-
set showResolved(showResolved) {
|
|
38
|
-
if (this._showResolved.get() !== showResolved) {
|
|
39
|
-
this._showResolved.set(showResolved);
|
|
40
|
-
this._onDidChange.fire({ showResolved: true });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
registerAction2(class extends ViewAction {
|
|
45
|
-
constructor() {
|
|
46
|
-
super({
|
|
47
|
-
id: 'commentsFocusViewFromFilter',
|
|
48
|
-
title: ( localizeWithPath(
|
|
49
|
-
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
50
|
-
'focusCommentsList',
|
|
51
|
-
"Focus Comments view"
|
|
52
|
-
)),
|
|
53
|
-
keybinding: {
|
|
54
|
-
when: CommentsViewFilterFocusContextKey,
|
|
55
|
-
weight: 200 ,
|
|
56
|
-
primary: 2048 | 18
|
|
57
|
-
},
|
|
58
|
-
viewId: COMMENTS_VIEW_ID
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
async runInView(serviceAccessor, commentsView) {
|
|
62
|
-
commentsView.focus();
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
registerAction2(class extends ViewAction {
|
|
66
|
-
constructor() {
|
|
67
|
-
super({
|
|
68
|
-
id: 'commentsClearFilterText',
|
|
69
|
-
title: ( localizeWithPath(
|
|
70
|
-
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
71
|
-
'commentsClearFilterText',
|
|
72
|
-
"Clear filter text"
|
|
73
|
-
)),
|
|
74
|
-
keybinding: {
|
|
75
|
-
when: CommentsViewFilterFocusContextKey,
|
|
76
|
-
weight: 200 ,
|
|
77
|
-
primary: 9
|
|
78
|
-
},
|
|
79
|
-
viewId: COMMENTS_VIEW_ID
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
async runInView(serviceAccessor, commentsView) {
|
|
83
|
-
commentsView.clearFilterText();
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
registerAction2(class extends ViewAction {
|
|
87
|
-
constructor() {
|
|
88
|
-
super({
|
|
89
|
-
id: 'commentsFocusFilter',
|
|
90
|
-
title: ( localizeWithPath(
|
|
91
|
-
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
92
|
-
'focusCommentsFilter',
|
|
93
|
-
"Focus comments filter"
|
|
94
|
-
)),
|
|
95
|
-
keybinding: {
|
|
96
|
-
when: ( FocusedViewContext.isEqualTo(COMMENTS_VIEW_ID)),
|
|
97
|
-
weight: 200 ,
|
|
98
|
-
primary: 2048 | 36
|
|
99
|
-
},
|
|
100
|
-
viewId: COMMENTS_VIEW_ID
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
async runInView(serviceAccessor, commentsView) {
|
|
104
|
-
commentsView.focusFilter();
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
registerAction2(class extends ViewAction {
|
|
108
|
-
constructor() {
|
|
109
|
-
super({
|
|
110
|
-
id: `workbench.actions.${COMMENTS_VIEW_ID}.toggleUnResolvedComments`,
|
|
111
|
-
title: ( localizeWithPath(
|
|
112
|
-
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
113
|
-
'toggle unresolved',
|
|
114
|
-
"Toggle Unresolved Comments"
|
|
115
|
-
)),
|
|
116
|
-
category: ( localizeWithPath(
|
|
117
|
-
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
118
|
-
'comments',
|
|
119
|
-
"Comments"
|
|
120
|
-
)),
|
|
121
|
-
toggled: {
|
|
122
|
-
condition: CONTEXT_KEY_SHOW_UNRESOLVED,
|
|
123
|
-
title: ( localizeWithPath(
|
|
124
|
-
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
125
|
-
'unresolved',
|
|
126
|
-
"Show Unresolved"
|
|
127
|
-
)),
|
|
128
|
-
},
|
|
129
|
-
menu: {
|
|
130
|
-
id: viewFilterSubmenu,
|
|
131
|
-
group: '1_filter',
|
|
132
|
-
when: ( ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)),
|
|
133
|
-
order: 1
|
|
134
|
-
},
|
|
135
|
-
viewId: COMMENTS_VIEW_ID
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
async runInView(serviceAccessor, view) {
|
|
139
|
-
view.filters.showUnresolved = !view.filters.showUnresolved;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
registerAction2(class extends ViewAction {
|
|
143
|
-
constructor() {
|
|
144
|
-
super({
|
|
145
|
-
id: `workbench.actions.${COMMENTS_VIEW_ID}.toggleResolvedComments`,
|
|
146
|
-
title: ( localizeWithPath(
|
|
147
|
-
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
148
|
-
'toggle resolved',
|
|
149
|
-
"Toggle Resolved Comments"
|
|
150
|
-
)),
|
|
151
|
-
category: ( localizeWithPath(
|
|
152
|
-
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
153
|
-
'comments',
|
|
154
|
-
"Comments"
|
|
155
|
-
)),
|
|
156
|
-
toggled: {
|
|
157
|
-
condition: CONTEXT_KEY_SHOW_RESOLVED,
|
|
158
|
-
title: ( localizeWithPath(
|
|
159
|
-
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
160
|
-
'resolved',
|
|
161
|
-
"Show Resolved"
|
|
162
|
-
)),
|
|
163
|
-
},
|
|
164
|
-
menu: {
|
|
165
|
-
id: viewFilterSubmenu,
|
|
166
|
-
group: '1_filter',
|
|
167
|
-
when: ( ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)),
|
|
168
|
-
order: 1
|
|
169
|
-
},
|
|
170
|
-
viewId: COMMENTS_VIEW_ID
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
async runInView(serviceAccessor, view) {
|
|
174
|
-
view.filters.showResolved = !view.filters.showResolved;
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
export { CommentsFilters };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
-
|
|
3
|
-
var css = ".comments-panel .comments-panel-container{height:100%}.comments-panel .comments-panel-container .hidden{display:none}.comments-panel .comments-panel-container .tree-container{height:100%}.comments-panel .comments-panel-container .tree-container.hidden{display:none;visibility:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container{display:block}.comments-panel .comments-panel-container .tree-container .comment-thread-container div{overflow:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container,.comments-panel .comments-panel-container .tree-container .resource-container{display:flex;overflow:hidden;text-overflow:ellipsis}.comments-panel .count,.comments-panel .user{padding-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .icon{min-width:fit-content;padding-right:5px;padding-top:4px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .user,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .count{min-width:fit-content}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text{display:flex;flex:1;min-width:0}.comments-panel .comments-panel-container .tree-container .comment-thread-container .reply-detail,.comments-panel .comments-panel-container .tree-container .comment-thread-container .timestamp,.comments-panel .comments-panel-container .tree-container .resource-container .owner{display:block;font-size:.9em;opacity:.8;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .text *{margin:0;max-width:500px;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .range{opacity:.8}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text code{font-family:var(--monaco-monospace-font)}.comments-panel .comments-panel-container .tree-container .monaco-icon-label{padding-right:5px}.comments-panel .comments-panel-container .tree-container .separator{opacity:.8;padding-right:5px}.comments-panel .comments-panel-container .message-box-container{height:inherit;line-height:22px;padding-left:20px}.comments-panel .comments-panel-container .tree-container .count-badge-wrapper{margin-left:10px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{line-height:22px;margin-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{padding-left:16px}.comments-panel .hide{display:none}";
|
|
4
|
-
n(css,{});
|
|
5
|
-
|
|
6
|
-
export { css, css as default };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
class CommentNode {
|
|
2
|
-
constructor(owner, threadId, resource, comment, range, threadState) {
|
|
3
|
-
this.replies = [];
|
|
4
|
-
this.owner = owner;
|
|
5
|
-
this.threadId = threadId;
|
|
6
|
-
this.comment = comment;
|
|
7
|
-
this.resource = resource;
|
|
8
|
-
this.range = range;
|
|
9
|
-
this.isRoot = false;
|
|
10
|
-
this.threadState = threadState;
|
|
11
|
-
}
|
|
12
|
-
hasReply() {
|
|
13
|
-
return this.replies && this.replies.length !== 0;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
class ResourceWithCommentThreads {
|
|
17
|
-
constructor(owner, resource, commentThreads) {
|
|
18
|
-
this.owner = owner;
|
|
19
|
-
this.id = ( resource.toString());
|
|
20
|
-
this.resource = resource;
|
|
21
|
-
this.commentThreads = ( commentThreads.filter(thread => thread.comments && thread.comments.length).map(
|
|
22
|
-
thread => ResourceWithCommentThreads.createCommentNode(owner, resource, thread)
|
|
23
|
-
));
|
|
24
|
-
}
|
|
25
|
-
static createCommentNode(owner, resource, commentThread) {
|
|
26
|
-
const { threadId, comments, range } = commentThread;
|
|
27
|
-
const commentNodes = ( comments.map(comment => ( new CommentNode(owner, threadId, resource, comment, range, commentThread.state))));
|
|
28
|
-
if (commentNodes.length > 1) {
|
|
29
|
-
commentNodes[0].replies = commentNodes.slice(1, commentNodes.length);
|
|
30
|
-
}
|
|
31
|
-
commentNodes[0].isRoot = true;
|
|
32
|
-
return commentNodes[0];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { CommentNode, ResourceWithCommentThreads };
|