@codingame/monaco-vscode-extensions-service-override 1.83.7 → 1.83.9
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/assets/webWorkerExtensionHostIframe.html +123 -0
- package/extensions.d.ts +12 -13
- package/extensions.js +456 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +8 -0
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +3 -0
- package/package.json +5 -3
- package/tools/url.js +10 -0
- package/tools.js +5 -0
- package/vscode/src/vs/base/common/console.js +59 -0
- package/vscode/src/vs/base/common/prefixTree.js +131 -0
- package/vscode/src/vs/platform/files/common/watcher.js +71 -0
- package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +27 -0
- package/vscode/src/vs/platform/log/browser/log.js +26 -0
- package/vscode/src/vs/platform/remote/common/managedSocket.js +98 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +330 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +174 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +52 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +107 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +94 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +541 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +80 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +578 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +387 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +102 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +69 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +75 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +249 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +370 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +41 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +411 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +475 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +227 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +317 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +280 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +28 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +33 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +27 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +947 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +93 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +118 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +158 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +123 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +188 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +129 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +131 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +341 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +25 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +48 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +76 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +38 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +185 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +30 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +463 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +148 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +70 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +50 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +72 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +731 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +412 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +182 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +55 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +313 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +223 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +110 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +29 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +100 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +135 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +57 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +273 -0
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.api.impl.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostConfiguration.d.ts +3 -3
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionService.d.ts +3 -4
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostManagedSockets.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTerminalService.d.ts +19 -20
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTunnelService.d.ts +7 -8
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostWorkspace.d.ts +25 -26
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +217 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +51 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +92 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +648 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +297 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +62 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +331 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +380 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +5 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1196 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +19 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +334 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +543 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +178 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +101 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +145 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +3 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +73 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +83 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +179 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +5 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +482 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +6 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +85 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +56 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +110 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +260 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +616 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +309 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +38 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +167 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +80 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +70 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +108 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +506 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +132 -0
- package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +103 -0
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +28 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +25 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +336 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +46 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +283 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +273 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +52 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +1093 -0
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +41 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +25 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +643 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +274 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +58 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +80 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +64 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +49 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +220 -0
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +5 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +79 -0
- package/vscode-proposed.d.ts +0 -3872
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.protocol.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionActivator.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostFileSystemInfo.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostInitDataService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostLocalizationService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostRpcService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostStoragePaths.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTypes.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostUriTransformerService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/worker/extHostExtensionService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/services/search/common/queryBuilder.d.ts +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
2
|
+
import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
|
|
3
|
+
import { Action, ActionRunner } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
4
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
5
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
|
+
import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
7
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
8
|
+
import { createActionViewItem } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
|
|
9
|
+
import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
10
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
11
|
+
import { StandardMouseEvent } from 'monaco-editor/esm/vs/base/browser/mouseEvent.js';
|
|
12
|
+
|
|
13
|
+
const collapseIcon = registerIcon('review-comment-collapse', Codicon.chevronUp, ( nls.localizeWithPath(
|
|
14
|
+
'vs/workbench/contrib/comments/browser/commentThreadHeader',
|
|
15
|
+
'collapseIcon',
|
|
16
|
+
'Icon to collapse a review comment.'
|
|
17
|
+
)));
|
|
18
|
+
const COLLAPSE_ACTION_CLASS = 'expand-review-action ' + ThemeIcon.asClassName(collapseIcon);
|
|
19
|
+
class CommentThreadHeader extends Disposable {
|
|
20
|
+
constructor(container, _delegate, _commentMenus, _commentThread, _contextKeyService, instantiationService, _contextMenuService) {
|
|
21
|
+
super();
|
|
22
|
+
this._delegate = _delegate;
|
|
23
|
+
this._commentMenus = _commentMenus;
|
|
24
|
+
this._commentThread = _commentThread;
|
|
25
|
+
this._contextKeyService = _contextKeyService;
|
|
26
|
+
this.instantiationService = instantiationService;
|
|
27
|
+
this._contextMenuService = _contextMenuService;
|
|
28
|
+
this._headElement = dom.$('.head');
|
|
29
|
+
container.appendChild(this._headElement);
|
|
30
|
+
this._fillHead();
|
|
31
|
+
}
|
|
32
|
+
_fillHead() {
|
|
33
|
+
const titleElement = dom.append(this._headElement, dom.$('.review-title'));
|
|
34
|
+
this._headingLabel = dom.append(titleElement, dom.$('span.filename'));
|
|
35
|
+
this.createThreadLabel();
|
|
36
|
+
const actionsContainer = dom.append(this._headElement, dom.$('.review-actions'));
|
|
37
|
+
this._actionbarWidget = ( new ActionBar(actionsContainer, {
|
|
38
|
+
actionViewItemProvider: createActionViewItem.bind(undefined, this.instantiationService)
|
|
39
|
+
}));
|
|
40
|
+
this._register(this._actionbarWidget);
|
|
41
|
+
this._collapseAction = ( new Action('review.expand', ( nls.localizeWithPath(
|
|
42
|
+
'vs/workbench/contrib/comments/browser/commentThreadHeader',
|
|
43
|
+
'label.collapse',
|
|
44
|
+
"Collapse"
|
|
45
|
+
)), COLLAPSE_ACTION_CLASS, true, () => this._delegate.collapse()));
|
|
46
|
+
const menu = this._commentMenus.getCommentThreadTitleActions(this._contextKeyService);
|
|
47
|
+
this.setActionBarActions(menu);
|
|
48
|
+
this._register(menu);
|
|
49
|
+
this._register(menu.onDidChange(e => {
|
|
50
|
+
this.setActionBarActions(menu);
|
|
51
|
+
}));
|
|
52
|
+
this._register(dom.addDisposableListener(this._headElement, dom.EventType.CONTEXT_MENU, e => {
|
|
53
|
+
return this.onContextMenu(e);
|
|
54
|
+
}));
|
|
55
|
+
this._actionbarWidget.context = this._commentThread;
|
|
56
|
+
}
|
|
57
|
+
setActionBarActions(menu) {
|
|
58
|
+
const groups = menu.getActions({ shouldForwardArgs: true }).reduce((r, [, actions]) => [...r, ...actions], []);
|
|
59
|
+
this._actionbarWidget.clear();
|
|
60
|
+
this._actionbarWidget.push([...groups, this._collapseAction], { label: false, icon: true });
|
|
61
|
+
}
|
|
62
|
+
updateCommentThread(commentThread) {
|
|
63
|
+
this._commentThread = commentThread;
|
|
64
|
+
this._actionbarWidget.context = this._commentThread;
|
|
65
|
+
this.createThreadLabel();
|
|
66
|
+
}
|
|
67
|
+
createThreadLabel() {
|
|
68
|
+
let label;
|
|
69
|
+
label = this._commentThread.label;
|
|
70
|
+
if (label === undefined) {
|
|
71
|
+
if (!(this._commentThread.comments && this._commentThread.comments.length)) {
|
|
72
|
+
label = ( nls.localizeWithPath(
|
|
73
|
+
'vs/workbench/contrib/comments/browser/commentThreadHeader',
|
|
74
|
+
'startThread',
|
|
75
|
+
"Start discussion"
|
|
76
|
+
));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (label) {
|
|
80
|
+
this._headingLabel.textContent = strings.escape(label);
|
|
81
|
+
this._headingLabel.setAttribute('aria-label', label);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
updateHeight(headHeight) {
|
|
85
|
+
this._headElement.style.height = `${headHeight}px`;
|
|
86
|
+
this._headElement.style.lineHeight = this._headElement.style.height;
|
|
87
|
+
}
|
|
88
|
+
onContextMenu(e) {
|
|
89
|
+
const actions = ( this._commentMenus.getCommentThreadTitleContextActions(this._contextKeyService).getActions({ shouldForwardArgs: true }).map((value) => value[1])).flat();
|
|
90
|
+
if (!actions.length) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const event = ( new StandardMouseEvent(e));
|
|
94
|
+
this._contextMenuService.showContextMenu({
|
|
95
|
+
getAnchor: () => event,
|
|
96
|
+
getActions: () => actions,
|
|
97
|
+
actionRunner: ( new ActionRunner()),
|
|
98
|
+
getActionsContext: () => {
|
|
99
|
+
return {
|
|
100
|
+
commentControlHandle: this._commentThread.controllerHandle,
|
|
101
|
+
commentThreadHandle: this._commentThread.commentThreadHandle,
|
|
102
|
+
$mid: 7
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { CommentThreadHeader };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Disposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
2
|
+
import { CommentThreadCollapsibleState } from 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
3
|
+
import { ModelDecorationOptions } from 'monaco-editor/esm/vs/editor/common/model/textModel.js';
|
|
4
|
+
|
|
5
|
+
class CommentThreadRangeDecoration {
|
|
6
|
+
get id() {
|
|
7
|
+
return this._decorationId;
|
|
8
|
+
}
|
|
9
|
+
set id(id) {
|
|
10
|
+
this._decorationId = id;
|
|
11
|
+
}
|
|
12
|
+
constructor(range, options) {
|
|
13
|
+
this.range = range;
|
|
14
|
+
this.options = options;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class CommentThreadRangeDecorator extends Disposable {
|
|
18
|
+
static { this.description = 'comment-thread-range-decorator'; }
|
|
19
|
+
constructor(commentService) {
|
|
20
|
+
super();
|
|
21
|
+
this.decorationIds = [];
|
|
22
|
+
this.activeDecorationIds = [];
|
|
23
|
+
this.threadCollapseStateListeners = [];
|
|
24
|
+
const decorationOptions = {
|
|
25
|
+
description: CommentThreadRangeDecorator.description,
|
|
26
|
+
isWholeLine: false,
|
|
27
|
+
zIndex: 20,
|
|
28
|
+
className: 'comment-thread-range',
|
|
29
|
+
shouldFillLineOnLineBreak: true
|
|
30
|
+
};
|
|
31
|
+
this.decorationOptions = ModelDecorationOptions.createDynamic(decorationOptions);
|
|
32
|
+
const activeDecorationOptions = {
|
|
33
|
+
description: CommentThreadRangeDecorator.description,
|
|
34
|
+
isWholeLine: false,
|
|
35
|
+
zIndex: 20,
|
|
36
|
+
className: 'comment-thread-range-current',
|
|
37
|
+
shouldFillLineOnLineBreak: true
|
|
38
|
+
};
|
|
39
|
+
this.activeDecorationOptions = ModelDecorationOptions.createDynamic(activeDecorationOptions);
|
|
40
|
+
this._register(commentService.onDidChangeCurrentCommentThread(thread => {
|
|
41
|
+
this.updateCurrent(thread);
|
|
42
|
+
}));
|
|
43
|
+
this._register(commentService.onDidUpdateCommentThreads(() => {
|
|
44
|
+
this.updateCurrent(undefined);
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
updateCurrent(thread) {
|
|
48
|
+
if (!this.editor || (thread?.resource && (thread.resource?.toString() !== this.editor.getModel()?.uri.toString()))) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.currentThreadCollapseStateListener?.dispose();
|
|
52
|
+
const newDecoration = [];
|
|
53
|
+
if (thread) {
|
|
54
|
+
const range = thread.range;
|
|
55
|
+
if (range && !((range.startLineNumber === range.endLineNumber) && (range.startColumn === range.endColumn))) {
|
|
56
|
+
if (thread.collapsibleState === CommentThreadCollapsibleState.Expanded) {
|
|
57
|
+
this.currentThreadCollapseStateListener = thread.onDidChangeCollapsibleState(state => {
|
|
58
|
+
if (state === CommentThreadCollapsibleState.Collapsed) {
|
|
59
|
+
this.updateCurrent(undefined);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
newDecoration.push(( new CommentThreadRangeDecoration(range, this.activeDecorationOptions)));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
this.editor.changeDecorations((changeAccessor) => {
|
|
67
|
+
this.activeDecorationIds = changeAccessor.deltaDecorations(this.activeDecorationIds, newDecoration);
|
|
68
|
+
newDecoration.forEach((decoration, index) => decoration.id = this.decorationIds[index]);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
update(editor, commentInfos) {
|
|
72
|
+
const model = editor?.getModel();
|
|
73
|
+
if (!editor || !model) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
dispose(this.threadCollapseStateListeners);
|
|
77
|
+
this.editor = editor;
|
|
78
|
+
const commentThreadRangeDecorations = [];
|
|
79
|
+
for (const info of commentInfos) {
|
|
80
|
+
info.threads.forEach(thread => {
|
|
81
|
+
if (thread.isDisposed) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const range = thread.range;
|
|
85
|
+
if (!range || (range.startLineNumber === range.endLineNumber) && (range.startColumn === range.endColumn)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
this.threadCollapseStateListeners.push(thread.onDidChangeCollapsibleState(() => {
|
|
89
|
+
this.update(editor, commentInfos);
|
|
90
|
+
}));
|
|
91
|
+
if (thread.collapsibleState === CommentThreadCollapsibleState.Collapsed) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
commentThreadRangeDecorations.push(( new CommentThreadRangeDecoration(range, this.decorationOptions)));
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
editor.changeDecorations((changeAccessor) => {
|
|
98
|
+
this.decorationIds = changeAccessor.deltaDecorations(this.decorationIds, commentThreadRangeDecorations);
|
|
99
|
+
commentThreadRangeDecorations.forEach((decoration, index) => decoration.id = this.decorationIds[index]);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
dispose() {
|
|
103
|
+
dispose(this.threadCollapseStateListeners);
|
|
104
|
+
this.currentThreadCollapseStateListener?.dispose();
|
|
105
|
+
super.dispose();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { CommentThreadRangeDecorator };
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './media/review.css.js';
|
|
3
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
4
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
5
|
+
import { Disposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
|
+
import * as languages from 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
7
|
+
import { CommentReply } from './commentReply.js';
|
|
8
|
+
import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService';
|
|
9
|
+
import { CommentThreadBody } from './commentThreadBody.js';
|
|
10
|
+
import { CommentThreadHeader } from './commentThreadHeader.js';
|
|
11
|
+
import { CommentThreadAdditionalActions } from './commentThreadAdditionalActions.js';
|
|
12
|
+
import { CommentContextKeys } from 'vscode/vscode/vs/workbench/contrib/comments/common/commentContextKeys';
|
|
13
|
+
import { textLinkForeground, textLinkActiveForeground, focusBorder, textBlockQuoteBackground, textBlockQuoteBorder, contrastBorder, inputValidationErrorBorder, inputValidationErrorBackground, inputValidationErrorForeground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
14
|
+
import { PANEL_BORDER } from 'vscode/vscode/vs/workbench/common/theme';
|
|
15
|
+
import { commentThreadStateColorVar, commentThreadStateBackgroundColorVar } from './commentColors.js';
|
|
16
|
+
import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
17
|
+
import { registerNavigableContainer } from 'vscode/vscode/vs/workbench/browser/actions/widgetNavigationCommands';
|
|
18
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
19
|
+
import { COMMENTS_SECTION } from '../common/commentsConfiguration.js';
|
|
20
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
21
|
+
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
22
|
+
|
|
23
|
+
let CommentThreadWidget = class CommentThreadWidget extends Disposable {
|
|
24
|
+
get commentThread() {
|
|
25
|
+
return this._commentThread;
|
|
26
|
+
}
|
|
27
|
+
constructor(container, _parentEditor, _owner, _parentResourceUri, _contextKeyService, _scopedInstantiationService, _commentThread, _pendingComment, _pendingEdits, _markdownOptions, _commentOptions, _containerDelegate, commentService, contextMenuService, configurationService, _keybindingService) {
|
|
28
|
+
super();
|
|
29
|
+
this.container = container;
|
|
30
|
+
this._parentEditor = _parentEditor;
|
|
31
|
+
this._owner = _owner;
|
|
32
|
+
this._parentResourceUri = _parentResourceUri;
|
|
33
|
+
this._contextKeyService = _contextKeyService;
|
|
34
|
+
this._scopedInstantiationService = _scopedInstantiationService;
|
|
35
|
+
this._commentThread = _commentThread;
|
|
36
|
+
this._pendingComment = _pendingComment;
|
|
37
|
+
this._pendingEdits = _pendingEdits;
|
|
38
|
+
this._markdownOptions = _markdownOptions;
|
|
39
|
+
this._commentOptions = _commentOptions;
|
|
40
|
+
this._containerDelegate = _containerDelegate;
|
|
41
|
+
this.commentService = commentService;
|
|
42
|
+
this.configurationService = configurationService;
|
|
43
|
+
this._keybindingService = _keybindingService;
|
|
44
|
+
this._commentThreadDisposables = [];
|
|
45
|
+
this._onDidResize = ( new Emitter());
|
|
46
|
+
this.onDidResize = this._onDidResize.event;
|
|
47
|
+
this._threadIsEmpty = CommentContextKeys.commentThreadIsEmpty.bindTo(this._contextKeyService);
|
|
48
|
+
this._threadIsEmpty.set(!_commentThread.comments || !_commentThread.comments.length);
|
|
49
|
+
this._focusedContextKey = CommentContextKeys.commentFocused.bindTo(this._contextKeyService);
|
|
50
|
+
this._commentMenus = this.commentService.getCommentMenus(this._owner);
|
|
51
|
+
this._header = ( new CommentThreadHeader(container, {
|
|
52
|
+
collapse: this.collapse.bind(this)
|
|
53
|
+
}, this._commentMenus, this._commentThread, this._contextKeyService, this._scopedInstantiationService, contextMenuService));
|
|
54
|
+
this._header.updateCommentThread(this._commentThread);
|
|
55
|
+
const bodyElement = dom.$('.body');
|
|
56
|
+
container.appendChild(bodyElement);
|
|
57
|
+
const tracker = this._register(dom.trackFocus(bodyElement));
|
|
58
|
+
this._register(registerNavigableContainer({
|
|
59
|
+
focusNotifiers: [tracker],
|
|
60
|
+
focusNextWidget: () => {
|
|
61
|
+
if (!this._commentReply?.isCommentEditorFocused()) {
|
|
62
|
+
this._commentReply?.expandReplyAreaAndFocusCommentEditor();
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
focusPreviousWidget: () => {
|
|
66
|
+
if (this._commentReply?.isCommentEditorFocused() && this._commentThread.comments?.length) {
|
|
67
|
+
this._body.focus();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
71
|
+
this._register(tracker.onDidFocus(() => this._focusedContextKey.set(true)));
|
|
72
|
+
this._register(tracker.onDidBlur(() => this._focusedContextKey.reset()));
|
|
73
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
74
|
+
if (e.affectsConfiguration("accessibility.verbosity.comments" )) {
|
|
75
|
+
this._setAriaLabel();
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
this._body = this._scopedInstantiationService.createInstance(CommentThreadBody, this._parentEditor, this._owner, this._parentResourceUri, bodyElement, this._markdownOptions, this._commentThread, this._pendingEdits, this._scopedInstantiationService, this);
|
|
79
|
+
this._register(this._body);
|
|
80
|
+
this._setAriaLabel();
|
|
81
|
+
this._styleElement = dom.createStyleSheet(this.container);
|
|
82
|
+
this._commentThreadContextValue = CommentContextKeys.commentThreadContext.bindTo(this._contextKeyService);
|
|
83
|
+
this._commentThreadContextValue.set(_commentThread.contextValue);
|
|
84
|
+
const commentControllerKey = CommentContextKeys.commentControllerContext.bindTo(this._contextKeyService);
|
|
85
|
+
const controller = this.commentService.getCommentController(this._owner);
|
|
86
|
+
if (controller?.contextValue) {
|
|
87
|
+
commentControllerKey.set(controller.contextValue);
|
|
88
|
+
}
|
|
89
|
+
this.currentThreadListeners();
|
|
90
|
+
}
|
|
91
|
+
_setAriaLabel() {
|
|
92
|
+
let ariaLabel = ( localizeWithPath(
|
|
93
|
+
'vs/workbench/contrib/comments/browser/commentThreadWidget',
|
|
94
|
+
'commentLabel',
|
|
95
|
+
"Comment"
|
|
96
|
+
));
|
|
97
|
+
let keybinding;
|
|
98
|
+
const verbose = this.configurationService.getValue("accessibility.verbosity.comments" );
|
|
99
|
+
if (verbose) {
|
|
100
|
+
keybinding = this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp" , this._contextKeyService)?.getLabel() ?? undefined;
|
|
101
|
+
}
|
|
102
|
+
if (keybinding) {
|
|
103
|
+
ariaLabel = ( localizeWithPath(
|
|
104
|
+
'vs/workbench/contrib/comments/browser/commentThreadWidget',
|
|
105
|
+
'commentLabelWithKeybinding',
|
|
106
|
+
"{0}, use ({1}) for accessibility help",
|
|
107
|
+
ariaLabel,
|
|
108
|
+
keybinding
|
|
109
|
+
));
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
ariaLabel = ( localizeWithPath(
|
|
113
|
+
'vs/workbench/contrib/comments/browser/commentThreadWidget',
|
|
114
|
+
'commentLabelWithKeybindingNoKeybinding',
|
|
115
|
+
"{0}, run the command Open Accessibility Help which is currently not triggerable via keybinding.",
|
|
116
|
+
ariaLabel
|
|
117
|
+
));
|
|
118
|
+
}
|
|
119
|
+
this._body.container.ariaLabel = ariaLabel;
|
|
120
|
+
}
|
|
121
|
+
updateCurrentThread(hasMouse, hasFocus) {
|
|
122
|
+
if (hasMouse || hasFocus) {
|
|
123
|
+
this.commentService.setCurrentCommentThread(this.commentThread);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this.commentService.setCurrentCommentThread(undefined);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
currentThreadListeners() {
|
|
130
|
+
let hasMouse = false;
|
|
131
|
+
let hasFocus = false;
|
|
132
|
+
this._register(dom.addDisposableListener(this.container, dom.EventType.MOUSE_ENTER, (e) => {
|
|
133
|
+
if (e.toElement === this.container) {
|
|
134
|
+
hasMouse = true;
|
|
135
|
+
this.updateCurrentThread(hasMouse, hasFocus);
|
|
136
|
+
}
|
|
137
|
+
}, true));
|
|
138
|
+
this._register(dom.addDisposableListener(this.container, dom.EventType.MOUSE_LEAVE, (e) => {
|
|
139
|
+
if (e.fromElement === this.container) {
|
|
140
|
+
hasMouse = false;
|
|
141
|
+
this.updateCurrentThread(hasMouse, hasFocus);
|
|
142
|
+
}
|
|
143
|
+
}, true));
|
|
144
|
+
this._register(dom.addDisposableListener(this.container, dom.EventType.FOCUS_IN, () => {
|
|
145
|
+
hasFocus = true;
|
|
146
|
+
this.updateCurrentThread(hasMouse, hasFocus);
|
|
147
|
+
}, true));
|
|
148
|
+
this._register(dom.addDisposableListener(this.container, dom.EventType.FOCUS_OUT, () => {
|
|
149
|
+
hasFocus = false;
|
|
150
|
+
this.updateCurrentThread(hasMouse, hasFocus);
|
|
151
|
+
}, true));
|
|
152
|
+
}
|
|
153
|
+
updateCommentThread(commentThread) {
|
|
154
|
+
const shouldCollapse = (this._commentThread.collapsibleState === languages.CommentThreadCollapsibleState.Expanded) && (this._commentThreadState === languages.CommentThreadState.Unresolved)
|
|
155
|
+
&& (commentThread.state === languages.CommentThreadState.Resolved);
|
|
156
|
+
this._commentThreadState = commentThread.state;
|
|
157
|
+
this._commentThread = commentThread;
|
|
158
|
+
dispose(this._commentThreadDisposables);
|
|
159
|
+
this._commentThreadDisposables = [];
|
|
160
|
+
this._bindCommentThreadListeners();
|
|
161
|
+
this._body.updateCommentThread(commentThread);
|
|
162
|
+
this._threadIsEmpty.set(!this._body.length);
|
|
163
|
+
this._header.updateCommentThread(commentThread);
|
|
164
|
+
this._commentReply?.updateCommentThread(commentThread);
|
|
165
|
+
if (this._commentThread.contextValue) {
|
|
166
|
+
this._commentThreadContextValue.set(this._commentThread.contextValue);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this._commentThreadContextValue.reset();
|
|
170
|
+
}
|
|
171
|
+
if (shouldCollapse && this.configurationService.getValue(COMMENTS_SECTION).collapseOnResolve) {
|
|
172
|
+
this.collapse();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
display(lineHeight) {
|
|
176
|
+
const headHeight = Math.max(23, Math.ceil(lineHeight * 1.2));
|
|
177
|
+
this._header.updateHeight(headHeight);
|
|
178
|
+
this._body.display();
|
|
179
|
+
if (this._commentThread.canReply) {
|
|
180
|
+
this._createCommentForm();
|
|
181
|
+
}
|
|
182
|
+
this._createAdditionalActions();
|
|
183
|
+
this._register(this._body.onDidResize(dimension => {
|
|
184
|
+
this._refresh(dimension);
|
|
185
|
+
}));
|
|
186
|
+
if (this._commentThread.canReply && this._commentReply) {
|
|
187
|
+
this._commentReply.focusIfNeeded();
|
|
188
|
+
}
|
|
189
|
+
this._bindCommentThreadListeners();
|
|
190
|
+
}
|
|
191
|
+
_refresh(dimension) {
|
|
192
|
+
this._body.layout();
|
|
193
|
+
this._onDidResize.fire(dimension);
|
|
194
|
+
}
|
|
195
|
+
dispose() {
|
|
196
|
+
super.dispose();
|
|
197
|
+
this.updateCurrentThread(false, false);
|
|
198
|
+
}
|
|
199
|
+
_bindCommentThreadListeners() {
|
|
200
|
+
this._commentThreadDisposables.push(this._commentThread.onDidChangeCanReply(() => {
|
|
201
|
+
if (this._commentReply) {
|
|
202
|
+
this._commentReply.updateCanReply();
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
if (this._commentThread.canReply) {
|
|
206
|
+
this._createCommentForm();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}));
|
|
210
|
+
this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async (_) => {
|
|
211
|
+
await this.updateCommentThread(this._commentThread);
|
|
212
|
+
}));
|
|
213
|
+
this._commentThreadDisposables.push(this._commentThread.onDidChangeLabel(_ => {
|
|
214
|
+
this._header.createThreadLabel();
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
_createCommentForm() {
|
|
218
|
+
this._commentReply = this._scopedInstantiationService.createInstance(CommentReply, this._owner, this._body.container, this._parentEditor, this._commentThread, this._scopedInstantiationService, this._contextKeyService, this._commentMenus, this._commentOptions, this._pendingComment, this, this._containerDelegate.actionRunner);
|
|
219
|
+
this._register(this._commentReply);
|
|
220
|
+
}
|
|
221
|
+
_createAdditionalActions() {
|
|
222
|
+
this._additionalActions = this._scopedInstantiationService.createInstance(CommentThreadAdditionalActions, this._body.container, this._commentThread, this._contextKeyService, this._commentMenus, this._containerDelegate.actionRunner);
|
|
223
|
+
this._register(this._additionalActions);
|
|
224
|
+
}
|
|
225
|
+
getCommentCoords(commentUniqueId) {
|
|
226
|
+
return this._body.getCommentCoords(commentUniqueId);
|
|
227
|
+
}
|
|
228
|
+
getPendingEdits() {
|
|
229
|
+
return this._body.getPendingEdits();
|
|
230
|
+
}
|
|
231
|
+
getPendingComment() {
|
|
232
|
+
if (this._commentReply) {
|
|
233
|
+
return this._commentReply.getPendingComment();
|
|
234
|
+
}
|
|
235
|
+
return undefined;
|
|
236
|
+
}
|
|
237
|
+
getDimensions() {
|
|
238
|
+
return this._body.getDimensions();
|
|
239
|
+
}
|
|
240
|
+
layout(widthInPixel) {
|
|
241
|
+
this._body.layout();
|
|
242
|
+
if (widthInPixel !== undefined) {
|
|
243
|
+
this._commentReply?.layout(widthInPixel);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
focusCommentEditor() {
|
|
247
|
+
this._commentReply?.focusCommentEditor();
|
|
248
|
+
}
|
|
249
|
+
focus() {
|
|
250
|
+
this._body.focus();
|
|
251
|
+
}
|
|
252
|
+
async submitComment() {
|
|
253
|
+
const activeComment = this._body.activeComment;
|
|
254
|
+
if (activeComment) {
|
|
255
|
+
return activeComment.submitComment();
|
|
256
|
+
}
|
|
257
|
+
else if ((this._commentReply?.getPendingComment()?.length ?? 0) > 0) {
|
|
258
|
+
return this._commentReply?.submitComment();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
collapse() {
|
|
262
|
+
this._containerDelegate.collapse();
|
|
263
|
+
}
|
|
264
|
+
applyTheme(theme, fontInfo) {
|
|
265
|
+
const content = [];
|
|
266
|
+
content.push(`.monaco-editor .review-widget > .body { border-top: 1px solid var(${commentThreadStateColorVar}) }`);
|
|
267
|
+
content.push(`.monaco-editor .review-widget > .head { background-color: var(${commentThreadStateBackgroundColorVar}) }`);
|
|
268
|
+
const linkColor = theme.getColor(textLinkForeground);
|
|
269
|
+
if (linkColor) {
|
|
270
|
+
content.push(`.review-widget .body .comment-body a { color: ${linkColor} }`);
|
|
271
|
+
}
|
|
272
|
+
const linkActiveColor = theme.getColor(textLinkActiveForeground);
|
|
273
|
+
if (linkActiveColor) {
|
|
274
|
+
content.push(`.review-widget .body .comment-body a:hover, a:active { color: ${linkActiveColor} }`);
|
|
275
|
+
}
|
|
276
|
+
const focusColor = theme.getColor(focusBorder);
|
|
277
|
+
if (focusColor) {
|
|
278
|
+
content.push(`.review-widget .body .comment-body a:focus { outline: 1px solid ${focusColor}; }`);
|
|
279
|
+
content.push(`.review-widget .body .monaco-editor.focused { outline: 1px solid ${focusColor}; }`);
|
|
280
|
+
}
|
|
281
|
+
const blockQuoteBackground = theme.getColor(textBlockQuoteBackground);
|
|
282
|
+
if (blockQuoteBackground) {
|
|
283
|
+
content.push(`.review-widget .body .review-comment blockquote { background: ${blockQuoteBackground}; }`);
|
|
284
|
+
}
|
|
285
|
+
const blockQuoteBOrder = theme.getColor(textBlockQuoteBorder);
|
|
286
|
+
if (blockQuoteBOrder) {
|
|
287
|
+
content.push(`.review-widget .body .review-comment blockquote { border-color: ${blockQuoteBOrder}; }`);
|
|
288
|
+
}
|
|
289
|
+
const border = theme.getColor(PANEL_BORDER);
|
|
290
|
+
if (border) {
|
|
291
|
+
content.push(`.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label { border-color: ${border}; }`);
|
|
292
|
+
}
|
|
293
|
+
const hcBorder = theme.getColor(contrastBorder);
|
|
294
|
+
if (hcBorder) {
|
|
295
|
+
content.push(`.review-widget .body .comment-form .review-thread-reply-button { outline-color: ${hcBorder}; }`);
|
|
296
|
+
content.push(`.review-widget .body .monaco-editor { outline: 1px solid ${hcBorder}; }`);
|
|
297
|
+
}
|
|
298
|
+
const errorBorder = theme.getColor(inputValidationErrorBorder);
|
|
299
|
+
if (errorBorder) {
|
|
300
|
+
content.push(`.review-widget .validation-error { border: 1px solid ${errorBorder}; }`);
|
|
301
|
+
}
|
|
302
|
+
const errorBackground = theme.getColor(inputValidationErrorBackground);
|
|
303
|
+
if (errorBackground) {
|
|
304
|
+
content.push(`.review-widget .validation-error { background: ${errorBackground}; }`);
|
|
305
|
+
}
|
|
306
|
+
const errorForeground = theme.getColor(inputValidationErrorForeground);
|
|
307
|
+
if (errorForeground) {
|
|
308
|
+
content.push(`.review-widget .body .comment-form .validation-error { color: ${errorForeground}; }`);
|
|
309
|
+
}
|
|
310
|
+
const fontFamilyVar = '--comment-thread-editor-font-family';
|
|
311
|
+
const fontSizeVar = '--comment-thread-editor-font-size';
|
|
312
|
+
const fontWeightVar = '--comment-thread-editor-font-weight';
|
|
313
|
+
this.container?.style.setProperty(fontFamilyVar, fontInfo.fontFamily);
|
|
314
|
+
this.container?.style.setProperty(fontSizeVar, `${fontInfo.fontSize}px`);
|
|
315
|
+
this.container?.style.setProperty(fontWeightVar, fontInfo.fontWeight);
|
|
316
|
+
content.push(`.review-widget .body code {
|
|
317
|
+
font-family: var(${fontFamilyVar});
|
|
318
|
+
font-weight: var(${fontWeightVar});
|
|
319
|
+
}`);
|
|
320
|
+
this._styleElement.textContent = content.join('\n');
|
|
321
|
+
this._commentReply?.setCommentEditorDecorations();
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
CommentThreadWidget = ( __decorate([
|
|
325
|
+
( __param(12, ICommentService)),
|
|
326
|
+
( __param(13, IContextMenuService)),
|
|
327
|
+
( __param(14, IConfigurationService)),
|
|
328
|
+
( __param(15, IKeybindingService))
|
|
329
|
+
], CommentThreadWidget));
|
|
330
|
+
|
|
331
|
+
export { CommentThreadWidget };
|