@codingame/monaco-vscode-extensions-service-override 2.1.4 → 2.2.0-next.1
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,397 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Color } from 'vscode/vscode/vs/base/common/color';
|
|
3
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
-
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
6
|
-
import { CommentThreadCollapsibleState } from 'vscode/vscode/vs/editor/common/languages';
|
|
7
|
-
import { ZoneWidget } from 'vscode/vscode/vs/editor/contrib/zoneWidget/browser/zoneWidget';
|
|
8
|
-
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
9
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
-
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
11
|
-
import { CommentGlyphWidget } from './commentGlyphWidget.js';
|
|
12
|
-
import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService';
|
|
13
|
-
import { EDITOR_FONT_DEFAULTS } from 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
14
|
-
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
15
|
-
import { CommentThreadWidget } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentThreadWidget';
|
|
16
|
-
import { commentThreadStateColorVar, commentThreadStateBackgroundColorVar, getCommentThreadStateBorderColor } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentColors';
|
|
17
|
-
import { peekViewBorder } from 'vscode/vscode/vs/editor/contrib/peekView/browser/peekView';
|
|
18
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
19
|
-
import { StableEditorScrollState } from 'vscode/vscode/vs/editor/browser/stableEditorScroll';
|
|
20
|
-
|
|
21
|
-
function getCommentThreadWidgetStateColor(thread, theme) {
|
|
22
|
-
return getCommentThreadStateBorderColor(thread, theme) ?? theme.getColor(peekViewBorder);
|
|
23
|
-
}
|
|
24
|
-
function parseMouseDownInfoFromEvent(e) {
|
|
25
|
-
const range = e.target.range;
|
|
26
|
-
if (!range) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
if (!e.event.leftButton) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
if (e.target.type !== 4 ) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
const data = e.target.detail;
|
|
36
|
-
const gutterOffsetX = data.offsetX - data.glyphMarginWidth - data.lineNumbersWidth - data.glyphMarginLeft;
|
|
37
|
-
if (gutterOffsetX > 20) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return { lineNumber: range.startLineNumber };
|
|
41
|
-
}
|
|
42
|
-
function isMouseUpEventDragFromMouseDown(mouseDownInfo, e) {
|
|
43
|
-
if (!mouseDownInfo) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
const { lineNumber } = mouseDownInfo;
|
|
47
|
-
const range = e.target.range;
|
|
48
|
-
if (!range) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
return lineNumber;
|
|
52
|
-
}
|
|
53
|
-
let ReviewZoneWidget = class ReviewZoneWidget extends ZoneWidget {
|
|
54
|
-
get owner() {
|
|
55
|
-
return this._owner;
|
|
56
|
-
}
|
|
57
|
-
get commentThread() {
|
|
58
|
-
return this._commentThread;
|
|
59
|
-
}
|
|
60
|
-
get expanded() {
|
|
61
|
-
return this._isExpanded;
|
|
62
|
-
}
|
|
63
|
-
constructor(editor, _owner, _commentThread, _pendingComment, _pendingEdits, instantiationService, themeService, commentService, contextKeyService, configurationService) {
|
|
64
|
-
super(editor, { keepEditorSelection: true, isAccessible: true });
|
|
65
|
-
this._owner = _owner;
|
|
66
|
-
this._commentThread = _commentThread;
|
|
67
|
-
this._pendingComment = _pendingComment;
|
|
68
|
-
this._pendingEdits = _pendingEdits;
|
|
69
|
-
this.themeService = themeService;
|
|
70
|
-
this.commentService = commentService;
|
|
71
|
-
this.configurationService = configurationService;
|
|
72
|
-
this._onDidClose = ( new Emitter());
|
|
73
|
-
this._onDidCreateThread = ( new Emitter());
|
|
74
|
-
this._globalToDispose = ( new DisposableStore());
|
|
75
|
-
this._commentThreadDisposables = [];
|
|
76
|
-
this._contextKeyService = contextKeyService.createScoped(this.domNode);
|
|
77
|
-
this._scopedInstantiationService = instantiationService.createChild(( new ServiceCollection([IContextKeyService, this._contextKeyService])));
|
|
78
|
-
const controller = this.commentService.getCommentController(this._owner);
|
|
79
|
-
if (controller) {
|
|
80
|
-
this._commentOptions = controller.options;
|
|
81
|
-
}
|
|
82
|
-
this._initialCollapsibleState = _pendingComment ? CommentThreadCollapsibleState.Expanded : _commentThread.initialCollapsibleState;
|
|
83
|
-
_commentThread.initialCollapsibleState = this._initialCollapsibleState;
|
|
84
|
-
this._isExpanded = this._initialCollapsibleState === CommentThreadCollapsibleState.Expanded;
|
|
85
|
-
this._commentThreadDisposables = [];
|
|
86
|
-
this.create();
|
|
87
|
-
this._globalToDispose.add(this.themeService.onDidColorThemeChange(this._applyTheme, this));
|
|
88
|
-
this._globalToDispose.add(this.editor.onDidChangeConfiguration(e => {
|
|
89
|
-
if (e.hasChanged(50 )) {
|
|
90
|
-
this._applyTheme(this.themeService.getColorTheme());
|
|
91
|
-
}
|
|
92
|
-
}));
|
|
93
|
-
this._applyTheme(this.themeService.getColorTheme());
|
|
94
|
-
}
|
|
95
|
-
get onDidClose() {
|
|
96
|
-
return this._onDidClose.event;
|
|
97
|
-
}
|
|
98
|
-
get onDidCreateThread() {
|
|
99
|
-
return this._onDidCreateThread.event;
|
|
100
|
-
}
|
|
101
|
-
getPosition() {
|
|
102
|
-
if (this.position) {
|
|
103
|
-
return this.position;
|
|
104
|
-
}
|
|
105
|
-
if (this._commentGlyph) {
|
|
106
|
-
return this._commentGlyph.getPosition().position ?? undefined;
|
|
107
|
-
}
|
|
108
|
-
return undefined;
|
|
109
|
-
}
|
|
110
|
-
revealRange() {
|
|
111
|
-
}
|
|
112
|
-
reveal(commentUniqueId, focus = false) {
|
|
113
|
-
if (!this._isExpanded) {
|
|
114
|
-
this.show(this.arrowPosition(this._commentThread.range), 2);
|
|
115
|
-
}
|
|
116
|
-
if (commentUniqueId !== undefined) {
|
|
117
|
-
const height = this.editor.getLayoutInfo().height;
|
|
118
|
-
const coords = this._commentThreadWidget.getCommentCoords(commentUniqueId);
|
|
119
|
-
if (coords) {
|
|
120
|
-
let scrollTop = 1;
|
|
121
|
-
if (this._commentThread.range) {
|
|
122
|
-
const commentThreadCoords = coords.thread;
|
|
123
|
-
const commentCoords = coords.comment;
|
|
124
|
-
scrollTop = this.editor.getTopForLineNumber(this._commentThread.range.startLineNumber) - height / 2 + commentCoords.top - commentThreadCoords.top;
|
|
125
|
-
}
|
|
126
|
-
this.editor.setScrollTop(scrollTop);
|
|
127
|
-
if (focus) {
|
|
128
|
-
this._commentThreadWidget.focus();
|
|
129
|
-
}
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
this.editor.revealRangeInCenter(this._commentThread.range ?? ( new Range(1, 1, 1, 1)));
|
|
134
|
-
if (focus) {
|
|
135
|
-
this._commentThreadWidget.focus();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
getPendingComments() {
|
|
139
|
-
return {
|
|
140
|
-
newComment: this._commentThreadWidget.getPendingComment(),
|
|
141
|
-
edits: this._commentThreadWidget.getPendingEdits()
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
setPendingComment(comment) {
|
|
145
|
-
this._pendingComment = comment;
|
|
146
|
-
this.expand();
|
|
147
|
-
this._commentThreadWidget.setPendingComment(comment);
|
|
148
|
-
}
|
|
149
|
-
_fillContainer(container) {
|
|
150
|
-
this.setCssClass('review-widget');
|
|
151
|
-
this._commentThreadWidget = this._scopedInstantiationService.createInstance(CommentThreadWidget, container, this.editor, this._owner, this.editor.getModel().uri, this._contextKeyService, this._scopedInstantiationService, this._commentThread, this._pendingComment, this._pendingEdits, { editor: this.editor, codeBlockFontSize: '', codeBlockFontFamily: this.configurationService.getValue('editor').fontFamily || EDITOR_FONT_DEFAULTS.fontFamily }, this._commentOptions, {
|
|
152
|
-
actionRunner: async () => {
|
|
153
|
-
if (!this._commentThread.comments || !this._commentThread.comments.length) {
|
|
154
|
-
const newPosition = this.getPosition();
|
|
155
|
-
if (newPosition) {
|
|
156
|
-
const originalRange = this._commentThread.range;
|
|
157
|
-
if (!originalRange) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
let range;
|
|
161
|
-
if (newPosition.lineNumber !== originalRange.endLineNumber) {
|
|
162
|
-
const distance = newPosition.lineNumber - originalRange.endLineNumber;
|
|
163
|
-
range = ( new Range(
|
|
164
|
-
originalRange.startLineNumber + distance,
|
|
165
|
-
originalRange.startColumn,
|
|
166
|
-
originalRange.endLineNumber + distance,
|
|
167
|
-
originalRange.endColumn
|
|
168
|
-
));
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
range = ( new Range(
|
|
172
|
-
originalRange.startLineNumber,
|
|
173
|
-
originalRange.startColumn,
|
|
174
|
-
originalRange.endLineNumber,
|
|
175
|
-
originalRange.endColumn
|
|
176
|
-
));
|
|
177
|
-
}
|
|
178
|
-
await this.commentService.updateCommentThreadTemplate(this.owner, this._commentThread.commentThreadHandle, range);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
collapse: () => {
|
|
183
|
-
this.collapse();
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
this._disposables.add(this._commentThreadWidget);
|
|
187
|
-
}
|
|
188
|
-
arrowPosition(range) {
|
|
189
|
-
if (!range) {
|
|
190
|
-
return undefined;
|
|
191
|
-
}
|
|
192
|
-
return { lineNumber: range.endLineNumber, column: range.endLineNumber === range.startLineNumber ? (range.startColumn + range.endColumn + 1) / 2 : 1 };
|
|
193
|
-
}
|
|
194
|
-
deleteCommentThread() {
|
|
195
|
-
this.dispose();
|
|
196
|
-
this.commentService.disposeCommentThread(this.owner, this._commentThread.threadId);
|
|
197
|
-
}
|
|
198
|
-
collapse() {
|
|
199
|
-
this._commentThread.collapsibleState = CommentThreadCollapsibleState.Collapsed;
|
|
200
|
-
}
|
|
201
|
-
expand() {
|
|
202
|
-
this._commentThread.collapsibleState = CommentThreadCollapsibleState.Expanded;
|
|
203
|
-
}
|
|
204
|
-
getGlyphPosition() {
|
|
205
|
-
if (this._commentGlyph) {
|
|
206
|
-
return this._commentGlyph.getPosition().position.lineNumber;
|
|
207
|
-
}
|
|
208
|
-
return 0;
|
|
209
|
-
}
|
|
210
|
-
toggleExpand() {
|
|
211
|
-
if (this._isExpanded) {
|
|
212
|
-
this._commentThread.collapsibleState = CommentThreadCollapsibleState.Collapsed;
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
this._commentThread.collapsibleState = CommentThreadCollapsibleState.Expanded;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
async update(commentThread) {
|
|
219
|
-
if (this._commentThread !== commentThread) {
|
|
220
|
-
this._commentThreadDisposables.forEach(disposable => disposable.dispose());
|
|
221
|
-
this._commentThread = commentThread;
|
|
222
|
-
this._commentThreadDisposables = [];
|
|
223
|
-
this.bindCommentThreadListeners();
|
|
224
|
-
}
|
|
225
|
-
this._commentThreadWidget.updateCommentThread(commentThread);
|
|
226
|
-
const lineNumber = this._commentThread.range?.endLineNumber ?? 1;
|
|
227
|
-
let shouldMoveWidget = false;
|
|
228
|
-
if (this._commentGlyph) {
|
|
229
|
-
this._commentGlyph.setThreadState(commentThread.state);
|
|
230
|
-
if (this._commentGlyph.getPosition().position.lineNumber !== lineNumber) {
|
|
231
|
-
shouldMoveWidget = true;
|
|
232
|
-
this._commentGlyph.setLineNumber(lineNumber);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
if ((shouldMoveWidget && this._isExpanded) || (this._commentThread.collapsibleState === CommentThreadCollapsibleState.Expanded && !this._isExpanded)) {
|
|
236
|
-
this.show(this.arrowPosition(this._commentThread.range), 2);
|
|
237
|
-
}
|
|
238
|
-
else if (this._commentThread.collapsibleState !== CommentThreadCollapsibleState.Expanded) {
|
|
239
|
-
this.hide();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
_onWidth(widthInPixel) {
|
|
243
|
-
this._commentThreadWidget.layout(widthInPixel);
|
|
244
|
-
}
|
|
245
|
-
_doLayout(heightInPixel, widthInPixel) {
|
|
246
|
-
this._commentThreadWidget.layout(widthInPixel);
|
|
247
|
-
}
|
|
248
|
-
display(range) {
|
|
249
|
-
if (range) {
|
|
250
|
-
this._commentGlyph = ( new CommentGlyphWidget(this.editor, range?.endLineNumber ?? -1));
|
|
251
|
-
this._commentGlyph.setThreadState(this._commentThread.state);
|
|
252
|
-
}
|
|
253
|
-
this._commentThreadWidget.display(this.editor.getOption(66 ));
|
|
254
|
-
this._disposables.add(this._commentThreadWidget.onDidResize(dimension => {
|
|
255
|
-
this._refresh(dimension);
|
|
256
|
-
}));
|
|
257
|
-
if ((this._commentThread.collapsibleState === CommentThreadCollapsibleState.Expanded) || (range === undefined)) {
|
|
258
|
-
this.show(this.arrowPosition(range), 2);
|
|
259
|
-
}
|
|
260
|
-
if (this._commentThread.canReply && this._commentThread.isTemplate && (!this._commentThread.comments || (this._commentThread.comments.length === 0))) {
|
|
261
|
-
this.reveal();
|
|
262
|
-
}
|
|
263
|
-
this.bindCommentThreadListeners();
|
|
264
|
-
}
|
|
265
|
-
bindCommentThreadListeners() {
|
|
266
|
-
this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async (_) => {
|
|
267
|
-
await this.update(this._commentThread);
|
|
268
|
-
}));
|
|
269
|
-
this._commentThreadDisposables.push(this._commentThread.onDidChangeRange(range => {
|
|
270
|
-
const lineNumber = this._commentThread.range?.startLineNumber ?? 1;
|
|
271
|
-
let shouldMoveWidget = false;
|
|
272
|
-
if (this._commentGlyph) {
|
|
273
|
-
if (this._commentGlyph.getPosition().position.lineNumber !== lineNumber) {
|
|
274
|
-
shouldMoveWidget = true;
|
|
275
|
-
this._commentGlyph.setLineNumber(lineNumber);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
if (shouldMoveWidget && this._isExpanded) {
|
|
279
|
-
this.show(this.arrowPosition(this._commentThread.range), 2);
|
|
280
|
-
}
|
|
281
|
-
}));
|
|
282
|
-
this._commentThreadDisposables.push(this._commentThread.onDidChangeCollapsibleState(state => {
|
|
283
|
-
if (state === CommentThreadCollapsibleState.Expanded && !this._isExpanded) {
|
|
284
|
-
this.show(this.arrowPosition(this._commentThread.range), 2);
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
if (state === CommentThreadCollapsibleState.Collapsed && this._isExpanded) {
|
|
288
|
-
this.hide();
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
}));
|
|
292
|
-
if (this._initialCollapsibleState === undefined) {
|
|
293
|
-
const onDidChangeInitialCollapsibleState = this._commentThread.onDidChangeInitialCollapsibleState(state => {
|
|
294
|
-
this._initialCollapsibleState = state;
|
|
295
|
-
this._commentThread.collapsibleState = this._initialCollapsibleState;
|
|
296
|
-
onDidChangeInitialCollapsibleState.dispose();
|
|
297
|
-
});
|
|
298
|
-
this._commentThreadDisposables.push(onDidChangeInitialCollapsibleState);
|
|
299
|
-
}
|
|
300
|
-
this._commentThreadDisposables.push(this._commentThread.onDidChangeState(() => {
|
|
301
|
-
const borderColor = getCommentThreadWidgetStateColor(this._commentThread.state, this.themeService.getColorTheme()) || Color.transparent;
|
|
302
|
-
this.style({
|
|
303
|
-
frameColor: borderColor,
|
|
304
|
-
arrowColor: borderColor,
|
|
305
|
-
});
|
|
306
|
-
this.container?.style.setProperty(commentThreadStateColorVar, `${borderColor}`);
|
|
307
|
-
this.container?.style.setProperty(commentThreadStateBackgroundColorVar, `${( borderColor.transparent(.1))}`);
|
|
308
|
-
}));
|
|
309
|
-
}
|
|
310
|
-
async submitComment() {
|
|
311
|
-
return this._commentThreadWidget.submitComment();
|
|
312
|
-
}
|
|
313
|
-
_refresh(dimensions) {
|
|
314
|
-
if (dimensions.height === 0 && dimensions.width === 0) {
|
|
315
|
-
this.commentThread.collapsibleState = CommentThreadCollapsibleState.Collapsed;
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
if (this._isExpanded) {
|
|
319
|
-
this._commentThreadWidget.layout();
|
|
320
|
-
const headHeight = Math.ceil(this.editor.getOption(66 ) * 1.2);
|
|
321
|
-
const lineHeight = this.editor.getOption(66 );
|
|
322
|
-
const arrowHeight = Math.round(lineHeight / 3);
|
|
323
|
-
const frameThickness = Math.round(lineHeight / 9) * 2;
|
|
324
|
-
const computedLinesNumber = Math.ceil(((headHeight + dimensions.height + arrowHeight + frameThickness + 8) ) / lineHeight);
|
|
325
|
-
if (this._viewZone?.heightInLines === computedLinesNumber) {
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
const currentPosition = this.getPosition();
|
|
329
|
-
if (this._viewZone && currentPosition && currentPosition.lineNumber !== this._viewZone.afterLineNumber && this._viewZone.afterLineNumber !== 0) {
|
|
330
|
-
this._viewZone.afterLineNumber = currentPosition.lineNumber;
|
|
331
|
-
}
|
|
332
|
-
if (!this._commentThread.comments || !this._commentThread.comments.length) {
|
|
333
|
-
this._commentThreadWidget.focusCommentEditor();
|
|
334
|
-
}
|
|
335
|
-
const capture = StableEditorScrollState.capture(this.editor);
|
|
336
|
-
this._relayout(computedLinesNumber);
|
|
337
|
-
capture.restore(this.editor);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
_applyTheme(theme) {
|
|
341
|
-
const borderColor = getCommentThreadWidgetStateColor(this._commentThread.state, this.themeService.getColorTheme()) || Color.transparent;
|
|
342
|
-
this.style({
|
|
343
|
-
arrowColor: borderColor,
|
|
344
|
-
frameColor: borderColor
|
|
345
|
-
});
|
|
346
|
-
const fontInfo = this.editor.getOption(50 );
|
|
347
|
-
this._commentThreadWidget.applyTheme(theme, fontInfo);
|
|
348
|
-
}
|
|
349
|
-
show(rangeOrPos, heightInLines) {
|
|
350
|
-
const glyphPosition = this._commentGlyph?.getPosition();
|
|
351
|
-
let range = Range.isIRange(rangeOrPos) ? rangeOrPos : (rangeOrPos ? Range.fromPositions(rangeOrPos) : undefined);
|
|
352
|
-
if (glyphPosition?.position && range && glyphPosition.position.lineNumber !== range.endLineNumber) {
|
|
353
|
-
const distance = glyphPosition.position.lineNumber - range.endLineNumber;
|
|
354
|
-
range = ( new Range(
|
|
355
|
-
range.startLineNumber + distance,
|
|
356
|
-
range.startColumn,
|
|
357
|
-
range.endLineNumber + distance,
|
|
358
|
-
range.endColumn
|
|
359
|
-
));
|
|
360
|
-
}
|
|
361
|
-
this._isExpanded = true;
|
|
362
|
-
super.show(range ?? ( new Range(0, 0, 0, 0)), heightInLines);
|
|
363
|
-
this._commentThread.collapsibleState = CommentThreadCollapsibleState.Expanded;
|
|
364
|
-
this._refresh(this._commentThreadWidget.getDimensions());
|
|
365
|
-
}
|
|
366
|
-
hide() {
|
|
367
|
-
if (this._isExpanded) {
|
|
368
|
-
this._isExpanded = false;
|
|
369
|
-
if (this.editor.hasWidgetFocus()) {
|
|
370
|
-
this.editor.focus();
|
|
371
|
-
}
|
|
372
|
-
if (!this._commentThread.comments || !this._commentThread.comments.length) {
|
|
373
|
-
this.deleteCommentThread();
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
super.hide();
|
|
377
|
-
}
|
|
378
|
-
dispose() {
|
|
379
|
-
super.dispose();
|
|
380
|
-
if (this._commentGlyph) {
|
|
381
|
-
this._commentGlyph.dispose();
|
|
382
|
-
this._commentGlyph = undefined;
|
|
383
|
-
}
|
|
384
|
-
this._globalToDispose.dispose();
|
|
385
|
-
this._commentThreadDisposables.forEach(global => global.dispose());
|
|
386
|
-
this._onDidClose.fire(undefined);
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
ReviewZoneWidget = ( __decorate([
|
|
390
|
-
( __param(5, IInstantiationService)),
|
|
391
|
-
( __param(6, IThemeService)),
|
|
392
|
-
( __param(7, ICommentService)),
|
|
393
|
-
( __param(8, IContextKeyService)),
|
|
394
|
-
( __param(9, IConfigurationService))
|
|
395
|
-
], ReviewZoneWidget));
|
|
396
|
-
|
|
397
|
-
export { ReviewZoneWidget, isMouseUpEventDragFromMouseDown, parseMouseDownInfoFromEvent };
|