@codingame/monaco-vscode-api 2.1.3 → 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/README.md +10 -0
- package/contributions.js +1 -0
- package/extensions.d.ts +6 -3
- package/extensions.js +18 -7
- package/lifecycle.js +11 -3
- package/missing-services.js +55 -10
- package/monaco.js +7 -3
- package/package.json +8 -8
- package/service-override/tools/editor.js +3 -1
- package/service-override/tools/views.d.ts +98 -0
- package/service-override/tools/views.js +249 -0
- package/services.d.ts +4 -2
- package/services.js +11 -9
- package/vscode/src/vs/base/browser/deviceAccess.js +60 -0
- package/vscode/src/vs/base/browser/dom.js +18 -1
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +178 -0
- package/vscode/src/vs/base/browser/ui/grid/grid.js +492 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +4 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.d.ts +1 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +1109 -0
- package/vscode/src/vs/base/browser/ui/sash/sash.js +9 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.d.ts +348 -1
- package/vscode/src/vs/base/common/async.js +46 -2
- package/vscode/src/vs/base/common/codicons.d.ts +579 -0
- package/vscode/src/vs/base/common/event.js +11 -2
- package/vscode/src/vs/base/common/keybindingParser.js +87 -0
- package/vscode/src/vs/base/common/network.js +1 -2
- package/vscode/src/vs/base/common/observableInternal/utils.js +1 -1
- package/vscode/src/vs/base/common/platform.js +2 -1
- package/vscode/src/vs/base/common/scrollable.d.ts +28 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/colors.js +17 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/diffEditorItemTemplate.js +214 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorViewModel.js +84 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidget.js +54 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl.js +324 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/objectPool.js +46 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/style.css.js +4 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/utils.js +11 -0
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardLayout.js +61 -1
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +10 -0
- package/vscode/src/vs/platform/log/browser/log.js +24 -0
- package/vscode/src/vs/platform/product/common/product.js +1 -2
- package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +772 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncStoreService.js +551 -0
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +22 -0
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +62 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +788 -0
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +763 -0
- package/vscode/src/vs/workbench/browser/layout.d.ts +26 -0
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +610 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +148 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +603 -0
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +333 -0
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +221 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +1406 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +184 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +509 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +112 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +1018 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +389 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsActions.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsList.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +213 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +73 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +307 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +226 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +218 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +433 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +436 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +643 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +377 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +66 -0
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +144 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +220 -0
- package/vscode/src/vs/workbench/browser/window.js +239 -5
- package/vscode/src/vs/workbench/common/configuration.js +11 -1
- package/vscode/src/vs/workbench/common/theme.js +3 -3
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +298 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +363 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +133 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +90 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentMenus.js +43 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentService.js +317 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +107 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +395 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +3 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1277 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +17 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +123 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +342 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +451 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +176 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +35 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +16 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +143 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +212 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +76 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +61 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +117 -0
- package/vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js +62 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +5 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +77 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +72 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +254 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +97 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +442 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +430 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +784 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +487 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +521 -0
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +150 -0
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +61 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +25 -1
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +178 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +49 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +408 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +145 -0
- package/vscode/src/vs/workbench/contrib/mappedEdits/common/mappedEdits.contribution.js +22 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +691 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +238 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +76 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +40 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +69 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +346 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +96 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +103 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +399 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +195 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +39 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +126 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +611 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +156 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +262 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +171 -0
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +317 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +56 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +315 -0
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +193 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +2 -1
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +37 -0
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +39 -0
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +138 -2
- package/vscode/src/vs/workbench/contrib/tags/browser/workspaceTagsService.js +12 -0
- package/vscode/src/vs/workbench/contrib/tags/common/workspaceTags.js +3 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +281 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +358 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +131 -0
- package/vscode/src/vs/workbench/contrib/update/common/update.js +2 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +288 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +94 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +86 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +77 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +646 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +63 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +57 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +140 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +119 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +67 -0
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +233 -0
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +143 -0
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -3
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +184 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +668 -0
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +1482 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +17 -1
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js +8 -1
- package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +4 -0
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +521 -0
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +102 -0
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +296 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +99 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +711 -0
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +596 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './media/panel.css.js';
|
|
3
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
4
|
+
import { append, $, createStyleSheet, isActiveElement } from '../../../../base/browser/dom.js';
|
|
5
|
+
import { basename } from '../../../../base/common/resources.js';
|
|
6
|
+
import { isDiffEditor, isCodeEditor } from '../../../../editor/browser/editorBrowser.js';
|
|
7
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
8
|
+
import { IThemeService } from '../../../../platform/theme/common/themeService.js';
|
|
9
|
+
import { ResourceWithCommentThreads, CommentNode } from '../common/commentModel.js';
|
|
10
|
+
import { ICommentService } from './commentService.js';
|
|
11
|
+
import { SIDE_GROUP, ACTIVE_GROUP, IEditorService } from '../../../services/editor/common/editorService.js';
|
|
12
|
+
import { textLinkForeground, textLinkActiveForeground, focusBorder, textPreformatForeground } from '../../../../platform/theme/common/colorRegistry.js';
|
|
13
|
+
import { ResourceLabels } from '../../../browser/labels.js';
|
|
14
|
+
import { Filter, CommentsList, COMMENTS_VIEW_TITLE } from './commentsTreeViewer.js';
|
|
15
|
+
import { FilterViewPane } from '../../../browser/parts/views/viewPane.js';
|
|
16
|
+
import { IViewDescriptorService } from '../../../common/views.js';
|
|
17
|
+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
|
|
18
|
+
import { RawContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
|
|
19
|
+
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
|
|
20
|
+
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';
|
|
21
|
+
import { IOpenerService } from '../../../../platform/opener/common/opener.js';
|
|
22
|
+
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
|
|
23
|
+
import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js';
|
|
24
|
+
import { TextModel } from '../../../../editor/common/model/textModel.js';
|
|
25
|
+
import { CommentsViewFilterFocusContextKey } from './comments.js';
|
|
26
|
+
import { CommentsFilters } from './commentsViewActions.js';
|
|
27
|
+
import { Memento } from '../../../common/memento.js';
|
|
28
|
+
import { IStorageService } from '../../../../platform/storage/common/storage.js';
|
|
29
|
+
import { FilterOptions } from './commentsFilterOptions.js';
|
|
30
|
+
import '../../../../editor/common/languages.js';
|
|
31
|
+
import { Iterable } from '../../../../base/common/iterator.js';
|
|
32
|
+
import { CommentController } from './commentsController.js';
|
|
33
|
+
import { Range } from '../../../../editor/common/core/range.js';
|
|
34
|
+
import { registerNavigableContainer } from '../../../browser/actions/widgetNavigationCommands.js';
|
|
35
|
+
import { CommentsModel } from './commentsModel.js';
|
|
36
|
+
const CONTEXT_KEY_HAS_COMMENTS = ( new RawContextKey('commentsView.hasComments', false));
|
|
37
|
+
const CONTEXT_KEY_SOME_COMMENTS_EXPANDED = ( new RawContextKey('commentsView.someCommentsExpanded', false));
|
|
38
|
+
const VIEW_STORAGE_ID = 'commentsViewState';
|
|
39
|
+
function createResourceCommentsIterator(model) {
|
|
40
|
+
return ( Iterable.map(model.resourceCommentThreads, m => {
|
|
41
|
+
const CommentNodeIt = Iterable.from(m.commentThreads);
|
|
42
|
+
const children = ( Iterable.map(CommentNodeIt, r => ({ element: r })));
|
|
43
|
+
return { element: m, children };
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
let CommentsPanel = class CommentsPanel extends FilterViewPane {
|
|
47
|
+
constructor(options, instantiationService, viewDescriptorService, editorService, configurationService, contextKeyService, contextMenuService, keybindingService, openerService, themeService, commentService, telemetryService, uriIdentityService, storageService) {
|
|
48
|
+
const stateMemento = ( new Memento(VIEW_STORAGE_ID, storageService));
|
|
49
|
+
const viewState = stateMemento.getMemento(1 , 1 );
|
|
50
|
+
super({
|
|
51
|
+
...options,
|
|
52
|
+
filterOptions: {
|
|
53
|
+
placeholder: ( localizeWithPath(
|
|
54
|
+
'vs/workbench/contrib/comments/browser/commentsView',
|
|
55
|
+
'comments.filter.placeholder',
|
|
56
|
+
"Filter (e.g. text, author)"
|
|
57
|
+
)),
|
|
58
|
+
ariaLabel: ( localizeWithPath(
|
|
59
|
+
'vs/workbench/contrib/comments/browser/commentsView',
|
|
60
|
+
'comments.filter.ariaLabel',
|
|
61
|
+
"Filter comments"
|
|
62
|
+
)),
|
|
63
|
+
history: viewState['filterHistory'] || [],
|
|
64
|
+
text: viewState['filter'] || '',
|
|
65
|
+
focusContextKey: CommentsViewFilterFocusContextKey.key
|
|
66
|
+
}
|
|
67
|
+
}, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
68
|
+
this.editorService = editorService;
|
|
69
|
+
this.commentService = commentService;
|
|
70
|
+
this.uriIdentityService = uriIdentityService;
|
|
71
|
+
this.totalComments = 0;
|
|
72
|
+
this.currentHeight = 0;
|
|
73
|
+
this.currentWidth = 0;
|
|
74
|
+
this.cachedFilterStats = undefined;
|
|
75
|
+
this.onDidChangeVisibility = this.onDidChangeBodyVisibility;
|
|
76
|
+
this.hasCommentsContextKey = CONTEXT_KEY_HAS_COMMENTS.bindTo(contextKeyService);
|
|
77
|
+
this.someCommentsExpandedContextKey = CONTEXT_KEY_SOME_COMMENTS_EXPANDED.bindTo(contextKeyService);
|
|
78
|
+
this.stateMemento = stateMemento;
|
|
79
|
+
this.viewState = viewState;
|
|
80
|
+
this.filters = this._register(( new CommentsFilters({
|
|
81
|
+
showResolved: this.viewState['showResolved'] !== false,
|
|
82
|
+
showUnresolved: this.viewState['showUnresolved'] !== false,
|
|
83
|
+
}, this.contextKeyService)));
|
|
84
|
+
this.filter = ( new Filter(( new FilterOptions(
|
|
85
|
+
this.filterWidget.getFilterText(),
|
|
86
|
+
this.filters.showResolved,
|
|
87
|
+
this.filters.showUnresolved
|
|
88
|
+
))));
|
|
89
|
+
this._register(this.filters.onDidChange((event) => {
|
|
90
|
+
if (event.showResolved || event.showUnresolved) {
|
|
91
|
+
this.updateFilter();
|
|
92
|
+
}
|
|
93
|
+
}));
|
|
94
|
+
this._register(this.filterWidget.onDidChangeFilterText(() => this.updateFilter()));
|
|
95
|
+
}
|
|
96
|
+
saveState() {
|
|
97
|
+
this.viewState['filter'] = this.filterWidget.getFilterText();
|
|
98
|
+
this.viewState['filterHistory'] = this.filterWidget.getHistory();
|
|
99
|
+
this.viewState['showResolved'] = this.filters.showResolved;
|
|
100
|
+
this.viewState['showUnresolved'] = this.filters.showUnresolved;
|
|
101
|
+
this.stateMemento.saveMemento();
|
|
102
|
+
super.saveState();
|
|
103
|
+
}
|
|
104
|
+
render() {
|
|
105
|
+
super.render();
|
|
106
|
+
this._register(registerNavigableContainer({
|
|
107
|
+
focusNotifiers: [this, this.filterWidget],
|
|
108
|
+
focusNextWidget: () => {
|
|
109
|
+
if (this.filterWidget.hasFocus()) {
|
|
110
|
+
this.focus();
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
focusPreviousWidget: () => {
|
|
114
|
+
if (!this.filterWidget.hasFocus()) {
|
|
115
|
+
this.focusFilter();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
focusFilter() {
|
|
121
|
+
this.filterWidget.focus();
|
|
122
|
+
}
|
|
123
|
+
clearFilterText() {
|
|
124
|
+
this.filterWidget.setFilterText('');
|
|
125
|
+
}
|
|
126
|
+
getFilterStats() {
|
|
127
|
+
if (!this.cachedFilterStats) {
|
|
128
|
+
this.cachedFilterStats = {
|
|
129
|
+
total: this.totalComments,
|
|
130
|
+
filtered: this.tree?.getVisibleItemCount() ?? 0
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return this.cachedFilterStats;
|
|
134
|
+
}
|
|
135
|
+
updateFilter() {
|
|
136
|
+
this.filter.options = ( new FilterOptions(
|
|
137
|
+
this.filterWidget.getFilterText(),
|
|
138
|
+
this.filters.showResolved,
|
|
139
|
+
this.filters.showUnresolved
|
|
140
|
+
));
|
|
141
|
+
this.tree?.filterComments();
|
|
142
|
+
this.cachedFilterStats = undefined;
|
|
143
|
+
const { total, filtered } = this.getFilterStats();
|
|
144
|
+
this.filterWidget.updateBadge(total === filtered || total === 0 ? undefined : ( localizeWithPath(
|
|
145
|
+
'vs/workbench/contrib/comments/browser/commentsView',
|
|
146
|
+
'showing filtered results',
|
|
147
|
+
"Showing {0} of {1}",
|
|
148
|
+
filtered,
|
|
149
|
+
total
|
|
150
|
+
)));
|
|
151
|
+
this.filterWidget.checkMoreFilters(!this.filters.showResolved || !this.filters.showUnresolved);
|
|
152
|
+
}
|
|
153
|
+
renderBody(container) {
|
|
154
|
+
super.renderBody(container);
|
|
155
|
+
container.classList.add('comments-panel');
|
|
156
|
+
const domContainer = append(container, $('.comments-panel-container'));
|
|
157
|
+
this.treeContainer = append(domContainer, $('.tree-container'));
|
|
158
|
+
this.treeContainer.classList.add('file-icon-themable-tree', 'show-file-icons');
|
|
159
|
+
this.cachedFilterStats = undefined;
|
|
160
|
+
this.createTree();
|
|
161
|
+
this.createMessageBox(domContainer);
|
|
162
|
+
this._register(this.commentService.onDidSetAllCommentThreads(this.onAllCommentsChanged, this));
|
|
163
|
+
this._register(this.commentService.onDidUpdateCommentThreads(this.onCommentsUpdated, this));
|
|
164
|
+
this._register(this.commentService.onDidDeleteDataProvider(this.onDataProviderDeleted, this));
|
|
165
|
+
const styleElement = createStyleSheet(container);
|
|
166
|
+
this.applyStyles(styleElement);
|
|
167
|
+
this._register(this.themeService.onDidColorThemeChange(_ => this.applyStyles(styleElement)));
|
|
168
|
+
this._register(this.onDidChangeBodyVisibility(visible => {
|
|
169
|
+
if (visible) {
|
|
170
|
+
this.refresh();
|
|
171
|
+
}
|
|
172
|
+
}));
|
|
173
|
+
this.renderComments();
|
|
174
|
+
}
|
|
175
|
+
focus() {
|
|
176
|
+
super.focus();
|
|
177
|
+
const element = this.tree?.getHTMLElement();
|
|
178
|
+
if (element && isActiveElement(element)) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (!this.commentService.commentsModel.hasCommentThreads() && this.messageBoxContainer) {
|
|
182
|
+
this.messageBoxContainer.focus();
|
|
183
|
+
}
|
|
184
|
+
else if (this.tree) {
|
|
185
|
+
this.tree.domFocus();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
applyStyles(styleElement) {
|
|
189
|
+
const content = [];
|
|
190
|
+
const theme = this.themeService.getColorTheme();
|
|
191
|
+
const linkColor = theme.getColor(textLinkForeground);
|
|
192
|
+
if (linkColor) {
|
|
193
|
+
content.push(`.comments-panel .comments-panel-container a { color: ${linkColor}; }`);
|
|
194
|
+
}
|
|
195
|
+
const linkActiveColor = theme.getColor(textLinkActiveForeground);
|
|
196
|
+
if (linkActiveColor) {
|
|
197
|
+
content.push(`.comments-panel .comments-panel-container a:hover, a:active { color: ${linkActiveColor}; }`);
|
|
198
|
+
}
|
|
199
|
+
const focusColor = theme.getColor(focusBorder);
|
|
200
|
+
if (focusColor) {
|
|
201
|
+
content.push(`.comments-panel .comments-panel-container a:focus { outline-color: ${focusColor}; }`);
|
|
202
|
+
}
|
|
203
|
+
const codeTextForegroundColor = theme.getColor(textPreformatForeground);
|
|
204
|
+
if (codeTextForegroundColor) {
|
|
205
|
+
content.push(`.comments-panel .comments-panel-container .text code { color: ${codeTextForegroundColor}; }`);
|
|
206
|
+
}
|
|
207
|
+
styleElement.textContent = content.join('\n');
|
|
208
|
+
}
|
|
209
|
+
async renderComments() {
|
|
210
|
+
this.treeContainer.classList.toggle('hidden', !this.commentService.commentsModel.hasCommentThreads());
|
|
211
|
+
this.renderMessage();
|
|
212
|
+
await this.tree?.setChildren(null, createResourceCommentsIterator(this.commentService.commentsModel));
|
|
213
|
+
}
|
|
214
|
+
collapseAll() {
|
|
215
|
+
if (this.tree) {
|
|
216
|
+
this.tree.collapseAll();
|
|
217
|
+
this.tree.setSelection([]);
|
|
218
|
+
this.tree.setFocus([]);
|
|
219
|
+
this.tree.domFocus();
|
|
220
|
+
this.tree.focusFirst();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
expandAll() {
|
|
224
|
+
if (this.tree) {
|
|
225
|
+
this.tree.expandAll();
|
|
226
|
+
this.tree.setSelection([]);
|
|
227
|
+
this.tree.setFocus([]);
|
|
228
|
+
this.tree.domFocus();
|
|
229
|
+
this.tree.focusFirst();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
get hasRendered() {
|
|
233
|
+
return !!this.tree;
|
|
234
|
+
}
|
|
235
|
+
layoutBodyContent(height = this.currentHeight, width = this.currentWidth) {
|
|
236
|
+
if (this.messageBoxContainer) {
|
|
237
|
+
this.messageBoxContainer.style.height = `${height}px`;
|
|
238
|
+
}
|
|
239
|
+
this.tree?.layout(height, width);
|
|
240
|
+
this.currentHeight = height;
|
|
241
|
+
this.currentWidth = width;
|
|
242
|
+
}
|
|
243
|
+
createMessageBox(parent) {
|
|
244
|
+
this.messageBoxContainer = append(parent, $('.message-box-container'));
|
|
245
|
+
this.messageBoxContainer.setAttribute('tabIndex', '0');
|
|
246
|
+
}
|
|
247
|
+
renderMessage() {
|
|
248
|
+
this.messageBoxContainer.textContent = this.commentService.commentsModel.getMessage();
|
|
249
|
+
this.messageBoxContainer.classList.toggle('hidden', this.commentService.commentsModel.hasCommentThreads());
|
|
250
|
+
}
|
|
251
|
+
createTree() {
|
|
252
|
+
this.treeLabels = this._register(this.instantiationService.createInstance(ResourceLabels, this));
|
|
253
|
+
this.tree = this._register(this.instantiationService.createInstance(CommentsList, this.treeLabels, this.treeContainer, {
|
|
254
|
+
overrideStyles: { listBackground: this.getBackgroundColor() },
|
|
255
|
+
selectionNavigation: true,
|
|
256
|
+
filter: this.filter,
|
|
257
|
+
keyboardNavigationLabelProvider: {
|
|
258
|
+
getKeyboardNavigationLabel: (item) => {
|
|
259
|
+
return undefined;
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
accessibilityProvider: {
|
|
263
|
+
getAriaLabel(element) {
|
|
264
|
+
if (element instanceof CommentsModel) {
|
|
265
|
+
return ( localizeWithPath(
|
|
266
|
+
'vs/workbench/contrib/comments/browser/commentsView',
|
|
267
|
+
'rootCommentsLabel',
|
|
268
|
+
"Comments for current workspace"
|
|
269
|
+
));
|
|
270
|
+
}
|
|
271
|
+
if (element instanceof ResourceWithCommentThreads) {
|
|
272
|
+
return ( localizeWithPath(
|
|
273
|
+
'vs/workbench/contrib/comments/browser/commentsView',
|
|
274
|
+
'resourceWithCommentThreadsLabel',
|
|
275
|
+
"Comments in {0}, full path {1}",
|
|
276
|
+
basename(element.resource),
|
|
277
|
+
element.resource.fsPath
|
|
278
|
+
));
|
|
279
|
+
}
|
|
280
|
+
if (element instanceof CommentNode) {
|
|
281
|
+
if (element.range) {
|
|
282
|
+
return ( localizeWithPath(
|
|
283
|
+
'vs/workbench/contrib/comments/browser/commentsView',
|
|
284
|
+
'resourceWithCommentLabel',
|
|
285
|
+
"Comment from ${0} at line {1} column {2} in {3}, source: {4}",
|
|
286
|
+
element.comment.userName,
|
|
287
|
+
element.range.startLineNumber,
|
|
288
|
+
element.range.startColumn,
|
|
289
|
+
basename(element.resource),
|
|
290
|
+
(typeof element.comment.body === 'string') ? element.comment.body : element.comment.body.value
|
|
291
|
+
));
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
return ( localizeWithPath(
|
|
295
|
+
'vs/workbench/contrib/comments/browser/commentsView',
|
|
296
|
+
'resourceWithCommentLabelFile',
|
|
297
|
+
"Comment from ${0} in {1}, source: {2}",
|
|
298
|
+
element.comment.userName,
|
|
299
|
+
basename(element.resource),
|
|
300
|
+
(typeof element.comment.body === 'string') ? element.comment.body : element.comment.body.value
|
|
301
|
+
));
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return '';
|
|
305
|
+
},
|
|
306
|
+
getWidgetAriaLabel() {
|
|
307
|
+
return COMMENTS_VIEW_TITLE.value;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}));
|
|
311
|
+
this._register(this.tree.onDidOpen(e => {
|
|
312
|
+
this.openFile(e.element, e.editorOptions.pinned, e.editorOptions.preserveFocus, e.sideBySide);
|
|
313
|
+
}));
|
|
314
|
+
this._register(this.tree.onDidChangeModel(() => {
|
|
315
|
+
this.updateSomeCommentsExpanded();
|
|
316
|
+
}));
|
|
317
|
+
this._register(this.tree.onDidChangeCollapseState(() => {
|
|
318
|
+
this.updateSomeCommentsExpanded();
|
|
319
|
+
}));
|
|
320
|
+
}
|
|
321
|
+
openFile(element, pinned, preserveFocus, sideBySide) {
|
|
322
|
+
if (!element) {
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
if (!(element instanceof ResourceWithCommentThreads || element instanceof CommentNode)) {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
if (!this.commentService.isCommentingEnabled) {
|
|
329
|
+
this.commentService.enableCommenting(true);
|
|
330
|
+
}
|
|
331
|
+
const range = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].range : element.range;
|
|
332
|
+
const activeEditor = this.editorService.activeTextEditorControl;
|
|
333
|
+
const currentActiveResources = isDiffEditor(activeEditor) ? [activeEditor.getOriginalEditor(), activeEditor.getModifiedEditor()]
|
|
334
|
+
: (activeEditor ? [activeEditor] : []);
|
|
335
|
+
for (const editor of currentActiveResources) {
|
|
336
|
+
const model = editor.getModel();
|
|
337
|
+
if ((model instanceof TextModel) && this.uriIdentityService.extUri.isEqual(element.resource, model.uri)) {
|
|
338
|
+
const threadToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].threadId : element.threadId;
|
|
339
|
+
const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment.uniqueIdInThread : element.comment.uniqueIdInThread;
|
|
340
|
+
if (threadToReveal && isCodeEditor(editor)) {
|
|
341
|
+
const controller = CommentController.get(editor);
|
|
342
|
+
controller?.revealCommentThread(threadToReveal, commentToReveal, true, !preserveFocus);
|
|
343
|
+
}
|
|
344
|
+
return true;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
const threadToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].threadId : element.threadId;
|
|
348
|
+
const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment : element.comment;
|
|
349
|
+
this.editorService.openEditor({
|
|
350
|
+
resource: element.resource,
|
|
351
|
+
options: {
|
|
352
|
+
pinned: pinned,
|
|
353
|
+
preserveFocus: preserveFocus,
|
|
354
|
+
selection: range ?? ( new Range(1, 1, 1, 1))
|
|
355
|
+
}
|
|
356
|
+
}, sideBySide ? SIDE_GROUP : ACTIVE_GROUP).then(editor => {
|
|
357
|
+
if (editor) {
|
|
358
|
+
const control = editor.getControl();
|
|
359
|
+
if (threadToReveal && isCodeEditor(control)) {
|
|
360
|
+
const controller = CommentController.get(control);
|
|
361
|
+
controller?.revealCommentThread(threadToReveal, commentToReveal.uniqueIdInThread, true, !preserveFocus);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
return true;
|
|
366
|
+
}
|
|
367
|
+
async refresh() {
|
|
368
|
+
if (!this.tree) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
if (this.isVisible()) {
|
|
372
|
+
this.hasCommentsContextKey.set(this.commentService.commentsModel.hasCommentThreads());
|
|
373
|
+
this.treeContainer.classList.toggle('hidden', !this.commentService.commentsModel.hasCommentThreads());
|
|
374
|
+
this.cachedFilterStats = undefined;
|
|
375
|
+
this.renderMessage();
|
|
376
|
+
this.tree?.setChildren(null, createResourceCommentsIterator(this.commentService.commentsModel));
|
|
377
|
+
if (this.tree.getSelection().length === 0 && this.commentService.commentsModel.hasCommentThreads()) {
|
|
378
|
+
const firstComment = this.commentService.commentsModel.resourceCommentThreads[0].commentThreads[0];
|
|
379
|
+
if (firstComment) {
|
|
380
|
+
this.tree.setFocus([firstComment]);
|
|
381
|
+
this.tree.setSelection([firstComment]);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
onAllCommentsChanged(e) {
|
|
387
|
+
this.cachedFilterStats = undefined;
|
|
388
|
+
this.totalComments += e.commentThreads.length;
|
|
389
|
+
for (const thread of e.commentThreads) {
|
|
390
|
+
}
|
|
391
|
+
this.refresh();
|
|
392
|
+
}
|
|
393
|
+
onCommentsUpdated(e) {
|
|
394
|
+
this.cachedFilterStats = undefined;
|
|
395
|
+
this.totalComments += e.added.length;
|
|
396
|
+
this.totalComments -= e.removed.length;
|
|
397
|
+
for (const resource of this.commentService.commentsModel.resourceCommentThreads) {
|
|
398
|
+
for (const thread of resource.commentThreads) {
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
this.refresh();
|
|
402
|
+
}
|
|
403
|
+
onDataProviderDeleted(owner) {
|
|
404
|
+
this.cachedFilterStats = undefined;
|
|
405
|
+
this.totalComments = 0;
|
|
406
|
+
this.refresh();
|
|
407
|
+
}
|
|
408
|
+
updateSomeCommentsExpanded() {
|
|
409
|
+
this.someCommentsExpandedContextKey.set(this.isSomeCommentsExpanded());
|
|
410
|
+
}
|
|
411
|
+
areAllCommentsExpanded() {
|
|
412
|
+
if (!this.tree) {
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
const navigator = this.tree.navigate();
|
|
416
|
+
while (navigator.next()) {
|
|
417
|
+
if (this.tree.isCollapsed(navigator.current())) {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return true;
|
|
422
|
+
}
|
|
423
|
+
isSomeCommentsExpanded() {
|
|
424
|
+
if (!this.tree) {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
const navigator = this.tree.navigate();
|
|
428
|
+
while (navigator.next()) {
|
|
429
|
+
if (!this.tree.isCollapsed(navigator.current())) {
|
|
430
|
+
return true;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return false;
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
CommentsPanel = ( __decorate([
|
|
437
|
+
( __param(1, IInstantiationService)),
|
|
438
|
+
( __param(2, IViewDescriptorService)),
|
|
439
|
+
( __param(3, IEditorService)),
|
|
440
|
+
( __param(4, IConfigurationService)),
|
|
441
|
+
( __param(5, IContextKeyService)),
|
|
442
|
+
( __param(6, IContextMenuService)),
|
|
443
|
+
( __param(7, IKeybindingService)),
|
|
444
|
+
( __param(8, IOpenerService)),
|
|
445
|
+
( __param(9, IThemeService)),
|
|
446
|
+
( __param(10, ICommentService)),
|
|
447
|
+
( __param(11, ITelemetryService)),
|
|
448
|
+
( __param(12, IUriIdentityService)),
|
|
449
|
+
( __param(13, IStorageService))
|
|
450
|
+
], CommentsPanel));
|
|
451
|
+
export { CONTEXT_KEY_HAS_COMMENTS, CONTEXT_KEY_SOME_COMMENTS_EXPANDED, CommentsPanel };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
2
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
3
|
+
import { ContextKeyExpr, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
|
|
4
|
+
import { Emitter } from '../../../../base/common/event.js';
|
|
5
|
+
import { CommentsViewFilterFocusContextKey } from './comments.js';
|
|
6
|
+
import { registerAction2 } from '../../../../platform/actions/common/actions.js';
|
|
7
|
+
import { ViewAction } from '../../../browser/parts/views/viewPane.js';
|
|
8
|
+
import { COMMENTS_VIEW_ID } from './commentsTreeViewer.js';
|
|
9
|
+
import { FocusedViewContext } from '../../../common/contextkeys.js';
|
|
10
|
+
import { viewFilterSubmenu } from '../../../browser/parts/views/viewFilter.js';
|
|
11
|
+
const CONTEXT_KEY_SHOW_RESOLVED = ( new RawContextKey('commentsView.showResolvedFilter', true));
|
|
12
|
+
const CONTEXT_KEY_SHOW_UNRESOLVED = ( new RawContextKey('commentsView.showUnResolvedFilter', true));
|
|
13
|
+
class CommentsFilters extends Disposable {
|
|
14
|
+
constructor(options, contextKeyService) {
|
|
15
|
+
super();
|
|
16
|
+
this.contextKeyService = contextKeyService;
|
|
17
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
18
|
+
this.onDidChange = this._onDidChange.event;
|
|
19
|
+
this._showUnresolved = CONTEXT_KEY_SHOW_UNRESOLVED.bindTo(this.contextKeyService);
|
|
20
|
+
this._showResolved = CONTEXT_KEY_SHOW_RESOLVED.bindTo(this.contextKeyService);
|
|
21
|
+
this._showResolved.set(options.showResolved);
|
|
22
|
+
this._showUnresolved.set(options.showUnresolved);
|
|
23
|
+
}
|
|
24
|
+
get showUnresolved() {
|
|
25
|
+
return !!this._showUnresolved.get();
|
|
26
|
+
}
|
|
27
|
+
set showUnresolved(showUnresolved) {
|
|
28
|
+
if (this._showUnresolved.get() !== showUnresolved) {
|
|
29
|
+
this._showUnresolved.set(showUnresolved);
|
|
30
|
+
this._onDidChange.fire({ showUnresolved: true });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
get showResolved() {
|
|
34
|
+
return !!this._showResolved.get();
|
|
35
|
+
}
|
|
36
|
+
set showResolved(showResolved) {
|
|
37
|
+
if (this._showResolved.get() !== showResolved) {
|
|
38
|
+
this._showResolved.set(showResolved);
|
|
39
|
+
this._onDidChange.fire({ showResolved: true });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
registerAction2(class extends ViewAction {
|
|
44
|
+
constructor() {
|
|
45
|
+
super({
|
|
46
|
+
id: 'commentsFocusViewFromFilter',
|
|
47
|
+
title: ( localizeWithPath(
|
|
48
|
+
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
49
|
+
'focusCommentsList',
|
|
50
|
+
"Focus Comments view"
|
|
51
|
+
)),
|
|
52
|
+
keybinding: {
|
|
53
|
+
when: CommentsViewFilterFocusContextKey,
|
|
54
|
+
weight: 200 ,
|
|
55
|
+
primary: 2048 | 18
|
|
56
|
+
},
|
|
57
|
+
viewId: COMMENTS_VIEW_ID
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async runInView(serviceAccessor, commentsView) {
|
|
61
|
+
commentsView.focus();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
registerAction2(class extends ViewAction {
|
|
65
|
+
constructor() {
|
|
66
|
+
super({
|
|
67
|
+
id: 'commentsClearFilterText',
|
|
68
|
+
title: ( localizeWithPath(
|
|
69
|
+
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
70
|
+
'commentsClearFilterText',
|
|
71
|
+
"Clear filter text"
|
|
72
|
+
)),
|
|
73
|
+
keybinding: {
|
|
74
|
+
when: CommentsViewFilterFocusContextKey,
|
|
75
|
+
weight: 200 ,
|
|
76
|
+
primary: 9
|
|
77
|
+
},
|
|
78
|
+
viewId: COMMENTS_VIEW_ID
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
async runInView(serviceAccessor, commentsView) {
|
|
82
|
+
commentsView.clearFilterText();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
registerAction2(class extends ViewAction {
|
|
86
|
+
constructor() {
|
|
87
|
+
super({
|
|
88
|
+
id: 'commentsFocusFilter',
|
|
89
|
+
title: ( localizeWithPath(
|
|
90
|
+
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
91
|
+
'focusCommentsFilter',
|
|
92
|
+
"Focus comments filter"
|
|
93
|
+
)),
|
|
94
|
+
keybinding: {
|
|
95
|
+
when: ( FocusedViewContext.isEqualTo(COMMENTS_VIEW_ID)),
|
|
96
|
+
weight: 200 ,
|
|
97
|
+
primary: 2048 | 36
|
|
98
|
+
},
|
|
99
|
+
viewId: COMMENTS_VIEW_ID
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
async runInView(serviceAccessor, commentsView) {
|
|
103
|
+
commentsView.focusFilter();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
registerAction2(class extends ViewAction {
|
|
107
|
+
constructor() {
|
|
108
|
+
super({
|
|
109
|
+
id: `workbench.actions.${COMMENTS_VIEW_ID}.toggleUnResolvedComments`,
|
|
110
|
+
title: ( localizeWithPath(
|
|
111
|
+
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
112
|
+
'toggle unresolved',
|
|
113
|
+
"Toggle Unresolved Comments"
|
|
114
|
+
)),
|
|
115
|
+
category: ( localizeWithPath(
|
|
116
|
+
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
117
|
+
'comments',
|
|
118
|
+
"Comments"
|
|
119
|
+
)),
|
|
120
|
+
toggled: {
|
|
121
|
+
condition: CONTEXT_KEY_SHOW_UNRESOLVED,
|
|
122
|
+
title: ( localizeWithPath(
|
|
123
|
+
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
124
|
+
'unresolved',
|
|
125
|
+
"Show Unresolved"
|
|
126
|
+
)),
|
|
127
|
+
},
|
|
128
|
+
menu: {
|
|
129
|
+
id: viewFilterSubmenu,
|
|
130
|
+
group: '1_filter',
|
|
131
|
+
when: ( ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)),
|
|
132
|
+
order: 1
|
|
133
|
+
},
|
|
134
|
+
viewId: COMMENTS_VIEW_ID
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
async runInView(serviceAccessor, view) {
|
|
138
|
+
view.filters.showUnresolved = !view.filters.showUnresolved;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
registerAction2(class extends ViewAction {
|
|
142
|
+
constructor() {
|
|
143
|
+
super({
|
|
144
|
+
id: `workbench.actions.${COMMENTS_VIEW_ID}.toggleResolvedComments`,
|
|
145
|
+
title: ( localizeWithPath(
|
|
146
|
+
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
147
|
+
'toggle resolved',
|
|
148
|
+
"Toggle Resolved Comments"
|
|
149
|
+
)),
|
|
150
|
+
category: ( localizeWithPath(
|
|
151
|
+
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
152
|
+
'comments',
|
|
153
|
+
"Comments"
|
|
154
|
+
)),
|
|
155
|
+
toggled: {
|
|
156
|
+
condition: CONTEXT_KEY_SHOW_RESOLVED,
|
|
157
|
+
title: ( localizeWithPath(
|
|
158
|
+
'vs/workbench/contrib/comments/browser/commentsViewActions',
|
|
159
|
+
'resolved',
|
|
160
|
+
"Show Resolved"
|
|
161
|
+
)),
|
|
162
|
+
},
|
|
163
|
+
menu: {
|
|
164
|
+
id: viewFilterSubmenu,
|
|
165
|
+
group: '1_filter',
|
|
166
|
+
when: ( ContextKeyExpr.equals('view', COMMENTS_VIEW_ID)),
|
|
167
|
+
order: 1
|
|
168
|
+
},
|
|
169
|
+
viewId: COMMENTS_VIEW_ID
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
async runInView(serviceAccessor, view) {
|
|
173
|
+
view.filters.showResolved = !view.filters.showResolved;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
export { CommentsFilters };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
+
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}";
|
|
3
|
+
n(css,{});
|
|
4
|
+
export { css, css as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
export { CommentNode, ResourceWithCommentThreads };
|