@codingame/monaco-vscode-api 1.85.0-next.2 → 1.85.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 +19 -10
- package/contributions.js +1 -0
- package/missing-services.js +91 -5
- package/monaco-editor-treemending.patch +2540 -2533
- package/package.json +6 -6
- package/vscode/src/vs/base/common/jsonFormatter.js +8 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +128 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +191 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +238 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +205 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +168 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +340 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1195 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +81 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +583 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +290 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +167 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +562 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +31 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProvider.js +24 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +193 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +22 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +52 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +258 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +25 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +388 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +61 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +49 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +647 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +300 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +60 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +107 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +333 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +99 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +55 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +2 -0
- package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +20 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +855 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +410 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1591 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1485 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +125 -0
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +29 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +41 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +102 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +988 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +431 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +417 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +806 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +915 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +19 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +129 -10
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +205 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +150 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +480 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +90 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +258 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +614 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +44 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +169 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +64 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.js +49 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +120 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +416 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +663 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +593 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +72 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +326 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +539 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +265 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +348 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +95 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +437 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2730 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +139 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +564 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +119 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +135 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +178 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +35 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +377 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +97 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +194 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +71 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +85 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +652 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +59 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +303 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +24 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +228 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +302 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +438 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +45 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +435 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +95 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +107 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +59 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +430 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +54 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +1131 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +1591 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +341 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +2155 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +65 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +95 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +507 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +85 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +47 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +40 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +435 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +31 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +257 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +239 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +103 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +211 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +808 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +381 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +527 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +163 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +651 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +173 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +98 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +62 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +101 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +346 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +152 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +296 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +261 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKeymapService.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookLoggingService.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +16 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookRange.js +66 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWorkerService.js +4 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +130 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +847 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +89 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +1942 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +107 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +49 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +387 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/common/constants.js +66 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +24 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +95 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -1
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/featuredExtensionService.js +159 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExtensionPoint.js +375 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +563 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.js +932 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +2 -2
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +190 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +77 -0
- package/assets/break.mp3 +0 -0
- package/assets/chatRequestSent.mp3 +0 -0
- package/assets/chatResponsePending.mp3 +0 -0
- package/assets/chatResponseReceived1.mp3 +0 -0
- package/assets/chatResponseReceived2.mp3 +0 -0
- package/assets/chatResponseReceived3.mp3 +0 -0
- package/assets/chatResponseReceived4.mp3 +0 -0
- package/assets/clear.mp3 +0 -0
- package/assets/defaultIcon.png +0 -0
- package/assets/diffLineDeleted.mp3 +0 -0
- package/assets/diffLineInserted.mp3 +0 -0
- package/assets/diffLineModified.mp3 +0 -0
- package/assets/error.mp3 +0 -0
- package/assets/fake.html +0 -10
- package/assets/foldedAreas.mp3 +0 -0
- package/assets/format.mp3 +0 -0
- package/assets/index-no-csp.html +0 -1226
- package/assets/index.html +0 -1227
- package/assets/quickFixes.mp3 +0 -0
- package/assets/save.mp3 +0 -0
- package/assets/service-worker.js +0 -457
- package/assets/taskCompleted.mp3 +0 -0
- package/assets/taskFailed.mp3 +0 -0
- package/assets/terminalBell.mp3 +0 -0
- package/assets/warning.mp3 +0 -0
- package/assets/webWorkerExtensionHostIframe.html +0 -123
- package/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
- package/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -5
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { h, Dimension, runAtThisOrScheduleAtNextAnimationFrame, getWindow } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import { MutableDisposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { assertType } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
5
|
+
import { EmbeddedCodeEditorWidget, EmbeddedDiffEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js';
|
|
6
|
+
import { ZoneWidget } from 'monaco-editor/esm/vs/editor/contrib/zoneWidget/browser/zoneWidget.js';
|
|
7
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
8
|
+
import * as colorRegistry from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
9
|
+
import * as editorColorRegistry from 'monaco-editor/esm/vs/editor/common/core/editorColorRegistry.js';
|
|
10
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
11
|
+
import { INLINE_CHAT_ID, inlineChatRegionHighlight, inlineChatDiffInserted, inlineChatDiffRemoved } from '../common/inlineChat.js';
|
|
12
|
+
import { LineRange } from 'monaco-editor/esm/vs/editor/common/core/lineRange.js';
|
|
13
|
+
import { Position } from 'monaco-editor/esm/vs/editor/common/core/position.js';
|
|
14
|
+
import { EditorExtensionsRegistry } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
|
|
15
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
16
|
+
import { lineRangeAsRange, invertLineRange } from './utils.js';
|
|
17
|
+
import { ResourceLabel } from '../../../browser/labels.js';
|
|
18
|
+
import { FileKind } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
19
|
+
import { FoldingController } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/folding.js';
|
|
20
|
+
import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
|
|
21
|
+
import { generateUuid } from 'monaco-editor/esm/vs/base/common/uuid.js';
|
|
22
|
+
import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
|
|
23
|
+
import { ButtonBar } from 'monaco-editor/esm/vs/base/browser/ui/button/button.js';
|
|
24
|
+
import { defaultButtonStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
25
|
+
import { SideBySideEditor } from '../../../common/editor.js';
|
|
26
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
27
|
+
import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
28
|
+
import { toAction } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
29
|
+
import { renderIcon } from 'monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabels.js';
|
|
30
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
31
|
+
import { TAB_ACTIVE_MODIFIED_BORDER } from '../../../common/theme.js';
|
|
32
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
33
|
+
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
34
|
+
var InlineChatFileCreatePreviewWidget_1;
|
|
35
|
+
let InlineChatLivePreviewWidget = class InlineChatLivePreviewWidget extends ZoneWidget {
|
|
36
|
+
constructor(editor, _session, options, onDidChangeDiff, instantiationService, themeService, _logService, accessibilityService) {
|
|
37
|
+
super(editor, { showArrow: false, showFrame: false, isResizeable: false, isAccessible: true, allowUnlimitedHeight: true, showInHiddenAreas: true, keepEditorSelection: true, ordinal: 10000 + 1 });
|
|
38
|
+
this._session = _session;
|
|
39
|
+
this._logService = _logService;
|
|
40
|
+
this.accessibilityService = accessibilityService;
|
|
41
|
+
this._hideId = `overlayDiff:${generateUuid()}`;
|
|
42
|
+
this._elements = h('div.inline-chat-diff-widget@domNode');
|
|
43
|
+
this._isVisible = false;
|
|
44
|
+
super.create();
|
|
45
|
+
assertType(editor.hasModel());
|
|
46
|
+
this._decorationCollection = editor.createDecorationsCollection();
|
|
47
|
+
const diffContributions = EditorExtensionsRegistry
|
|
48
|
+
.getEditorContributions()
|
|
49
|
+
.filter(c => c.id !== INLINE_CHAT_ID && c.id !== FoldingController.ID);
|
|
50
|
+
this._diffEditor = instantiationService.createInstance(EmbeddedDiffEditorWidget, this._elements.domNode, {
|
|
51
|
+
scrollbar: { useShadows: false, alwaysConsumeMouseWheel: false, ignoreHorizontalScrollbarInContentHeight: true, },
|
|
52
|
+
scrollBeyondLastLine: false,
|
|
53
|
+
renderMarginRevertIcon: true,
|
|
54
|
+
renderOverviewRuler: false,
|
|
55
|
+
rulers: undefined,
|
|
56
|
+
overviewRulerBorder: undefined,
|
|
57
|
+
overviewRulerLanes: 0,
|
|
58
|
+
diffAlgorithm: 'advanced',
|
|
59
|
+
splitViewDefaultRatio: 0.35,
|
|
60
|
+
padding: { top: 0, bottom: 0 },
|
|
61
|
+
folding: false,
|
|
62
|
+
diffCodeLens: false,
|
|
63
|
+
stickyScroll: { enabled: false },
|
|
64
|
+
minimap: { enabled: false },
|
|
65
|
+
isInEmbeddedEditor: true,
|
|
66
|
+
useInlineViewWhenSpaceIsLimited: false,
|
|
67
|
+
overflowWidgetsDomNode: editor.getOverflowWidgetsDomNode(),
|
|
68
|
+
onlyShowAccessibleDiffViewer: this.accessibilityService.isScreenReaderOptimized(),
|
|
69
|
+
...options
|
|
70
|
+
}, {
|
|
71
|
+
originalEditor: { contributions: diffContributions },
|
|
72
|
+
modifiedEditor: { contributions: diffContributions }
|
|
73
|
+
}, editor);
|
|
74
|
+
this._disposables.add(this._diffEditor);
|
|
75
|
+
this._diffEditor.setModel({ original: this._session.textModel0, modified: editor.getModel() });
|
|
76
|
+
this._diffEditor.updateOptions({
|
|
77
|
+
lineDecorationsWidth: editor.getLayoutInfo().decorationsWidth
|
|
78
|
+
});
|
|
79
|
+
if (onDidChangeDiff) {
|
|
80
|
+
this._disposables.add(this._diffEditor.onDidUpdateDiff(() => { onDidChangeDiff(); }));
|
|
81
|
+
const render = this._disposables.add(( new MutableDisposable()));
|
|
82
|
+
this._disposables.add(this._diffEditor.onDidContentSizeChange(e => {
|
|
83
|
+
if (!this._isVisible || !e.contentHeightChanged) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
render.value = runAtThisOrScheduleAtNextAnimationFrame(getWindow(this._diffEditor.getContainerDomNode()), () => {
|
|
87
|
+
const lineHeight = this.editor.getOption(66 );
|
|
88
|
+
const heightInLines = e.contentHeight / lineHeight;
|
|
89
|
+
this._logService.debug(`[IE] relaying with ${heightInLines} lines height`);
|
|
90
|
+
this._relayout(heightInLines);
|
|
91
|
+
});
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
const doStyle = () => {
|
|
95
|
+
const theme = themeService.getColorTheme();
|
|
96
|
+
const overrides = [
|
|
97
|
+
[colorRegistry.editorBackground, inlineChatRegionHighlight],
|
|
98
|
+
[editorColorRegistry.editorGutter, inlineChatRegionHighlight],
|
|
99
|
+
[colorRegistry.diffInsertedLine, inlineChatDiffInserted],
|
|
100
|
+
[colorRegistry.diffInserted, inlineChatDiffInserted],
|
|
101
|
+
[colorRegistry.diffRemovedLine, inlineChatDiffRemoved],
|
|
102
|
+
[colorRegistry.diffRemoved, inlineChatDiffRemoved],
|
|
103
|
+
];
|
|
104
|
+
for (const [target, source] of overrides) {
|
|
105
|
+
const value = theme.getColor(source);
|
|
106
|
+
if (value) {
|
|
107
|
+
this._elements.domNode.style.setProperty(colorRegistry.asCssVariableName(target), String(value));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
doStyle();
|
|
112
|
+
this._disposables.add(themeService.onDidColorThemeChange(doStyle));
|
|
113
|
+
}
|
|
114
|
+
_fillContainer(container) {
|
|
115
|
+
container.appendChild(this._elements.domNode);
|
|
116
|
+
}
|
|
117
|
+
get isVisible() {
|
|
118
|
+
return this._isVisible;
|
|
119
|
+
}
|
|
120
|
+
hide() {
|
|
121
|
+
this._decorationCollection.clear();
|
|
122
|
+
this._cleanupFullDiff();
|
|
123
|
+
super.hide();
|
|
124
|
+
this._isVisible = false;
|
|
125
|
+
}
|
|
126
|
+
show() {
|
|
127
|
+
throw new Error('use showForChanges');
|
|
128
|
+
}
|
|
129
|
+
showForChanges(changes) {
|
|
130
|
+
const hasFocus = this._diffEditor.hasTextFocus();
|
|
131
|
+
this._isVisible = true;
|
|
132
|
+
const onlyInserts = changes.every(change => change.original.isEmpty);
|
|
133
|
+
if (onlyInserts || changes.length === 0 || this._session.textModel0.getValueLength() === 0) {
|
|
134
|
+
this._logService.debug('[IE] livePreview-mode: no diff');
|
|
135
|
+
this._cleanupFullDiff();
|
|
136
|
+
this._renderInsertWithHighlight(changes);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
this._logService.debug('[IE] livePreview-mode: full diff');
|
|
140
|
+
this._decorationCollection.clear();
|
|
141
|
+
this._renderChangesWithFullDiff(changes);
|
|
142
|
+
}
|
|
143
|
+
if (hasFocus) {
|
|
144
|
+
this._diffEditor.focus();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
_renderInsertWithHighlight(changes) {
|
|
148
|
+
assertType(this.editor.hasModel());
|
|
149
|
+
const options = {
|
|
150
|
+
description: 'inline-chat-insert',
|
|
151
|
+
showIfCollapsed: false,
|
|
152
|
+
isWholeLine: true,
|
|
153
|
+
className: 'inline-chat-lines-inserted-range',
|
|
154
|
+
};
|
|
155
|
+
this._decorationCollection.set(( changes.map(change => {
|
|
156
|
+
return {
|
|
157
|
+
range: lineRangeAsRange(change.modified),
|
|
158
|
+
options,
|
|
159
|
+
};
|
|
160
|
+
})));
|
|
161
|
+
}
|
|
162
|
+
_renderChangesWithFullDiff(changes) {
|
|
163
|
+
assertType(this.editor.hasModel());
|
|
164
|
+
const modified = this.editor.getModel();
|
|
165
|
+
const ranges = this._computeHiddenRanges(modified, changes);
|
|
166
|
+
this._hideEditorRanges(this.editor, [ranges.modifiedHidden]);
|
|
167
|
+
this._hideEditorRanges(this._diffEditor.getOriginalEditor(), ranges.originalDiffHidden);
|
|
168
|
+
this._hideEditorRanges(this._diffEditor.getModifiedEditor(), ranges.modifiedDiffHidden);
|
|
169
|
+
const lineCountModified = ranges.modifiedHidden.length;
|
|
170
|
+
const lineCountOriginal = ranges.originalHidden.length;
|
|
171
|
+
const heightInLines = Math.max(lineCountModified, lineCountOriginal);
|
|
172
|
+
super.show(ranges.anchor, heightInLines);
|
|
173
|
+
this._logService.debug(`[IE] diff SHOWING at ${ranges.anchor} with ${heightInLines} (approx) lines height`);
|
|
174
|
+
}
|
|
175
|
+
_cleanupFullDiff() {
|
|
176
|
+
this.editor.setHiddenAreas([], this._hideId);
|
|
177
|
+
this._diffEditor.getOriginalEditor().setHiddenAreas([], this._hideId);
|
|
178
|
+
this._diffEditor.getModifiedEditor().setHiddenAreas([], this._hideId);
|
|
179
|
+
super.hide();
|
|
180
|
+
this._isVisible = false;
|
|
181
|
+
}
|
|
182
|
+
_computeHiddenRanges(model, changes) {
|
|
183
|
+
let originalLineRange = changes[0].original;
|
|
184
|
+
let modifiedLineRange = changes[0].modified;
|
|
185
|
+
for (let i = 1; i < changes.length; i++) {
|
|
186
|
+
originalLineRange = originalLineRange.join(changes[i].original);
|
|
187
|
+
modifiedLineRange = modifiedLineRange.join(changes[i].modified);
|
|
188
|
+
}
|
|
189
|
+
if (originalLineRange.isEmpty) {
|
|
190
|
+
originalLineRange = ( new LineRange(
|
|
191
|
+
originalLineRange.startLineNumber,
|
|
192
|
+
originalLineRange.endLineNumberExclusive + 1
|
|
193
|
+
));
|
|
194
|
+
}
|
|
195
|
+
const originalDiffHidden = invertLineRange(originalLineRange, this._session.textModel0);
|
|
196
|
+
const modifiedDiffHidden = invertLineRange(modifiedLineRange, model);
|
|
197
|
+
return {
|
|
198
|
+
originalHidden: originalLineRange,
|
|
199
|
+
originalDiffHidden,
|
|
200
|
+
modifiedHidden: modifiedLineRange,
|
|
201
|
+
modifiedDiffHidden,
|
|
202
|
+
anchor: ( new Position(modifiedLineRange.startLineNumber - 1, 1))
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
_hideEditorRanges(editor, lineRanges) {
|
|
206
|
+
assertType(editor.hasModel());
|
|
207
|
+
lineRanges = lineRanges.filter(range => !range.isEmpty);
|
|
208
|
+
if (lineRanges.length === 0) {
|
|
209
|
+
this._logService.debug(`[IE] diff NOTHING to hide for ${editor.getId()} with ${String(editor.getModel()?.uri)}`);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
let hiddenRanges;
|
|
213
|
+
const hiddenLinesCount = lineRanges.reduce((p, c) => p + c.length, 0);
|
|
214
|
+
if (hiddenLinesCount >= editor.getModel().getLineCount()) {
|
|
215
|
+
hiddenRanges = [editor.getModel().getFullModelRange().delta(1)];
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
hiddenRanges = ( lineRanges.map(lineRangeAsRange));
|
|
219
|
+
}
|
|
220
|
+
editor.setHiddenAreas(hiddenRanges, this._hideId);
|
|
221
|
+
this._logService.debug(`[IE] diff HIDING ${hiddenRanges} for ${editor.getId()} with ${String(editor.getModel()?.uri)}`);
|
|
222
|
+
}
|
|
223
|
+
revealRange(range, isLastLine) {
|
|
224
|
+
}
|
|
225
|
+
_onWidth(widthInPixel) {
|
|
226
|
+
if (this._dim) {
|
|
227
|
+
this._doLayout(this._dim.height, widthInPixel);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
_doLayout(heightInPixel, widthInPixel) {
|
|
231
|
+
const newDim = ( new Dimension(widthInPixel, heightInPixel));
|
|
232
|
+
if (!Dimension.equals(this._dim, newDim)) {
|
|
233
|
+
this._dim = newDim;
|
|
234
|
+
this._diffEditor.layout(this._dim.with(undefined, this._dim.height));
|
|
235
|
+
this._logService.debug('[IE] diff LAYOUT', this._dim);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
InlineChatLivePreviewWidget = ( __decorate([
|
|
240
|
+
( __param(4, IInstantiationService)),
|
|
241
|
+
( __param(5, IThemeService)),
|
|
242
|
+
( __param(6, ILogService)),
|
|
243
|
+
( __param(7, IAccessibilityService))
|
|
244
|
+
], InlineChatLivePreviewWidget));
|
|
245
|
+
let InlineChatFileCreatePreviewWidget = class InlineChatFileCreatePreviewWidget extends ZoneWidget {
|
|
246
|
+
static { InlineChatFileCreatePreviewWidget_1 = this; }
|
|
247
|
+
static { this.TitleHeight = 35; }
|
|
248
|
+
constructor(parentEditor, instaService, themeService, _textModelResolverService, _editorService) {
|
|
249
|
+
super(parentEditor, {
|
|
250
|
+
showArrow: false,
|
|
251
|
+
showFrame: true,
|
|
252
|
+
frameColor: colorRegistry.asCssVariable(TAB_ACTIVE_MODIFIED_BORDER),
|
|
253
|
+
frameWidth: 1,
|
|
254
|
+
isResizeable: true,
|
|
255
|
+
isAccessible: true,
|
|
256
|
+
showInHiddenAreas: true,
|
|
257
|
+
ordinal: 10000 + 2
|
|
258
|
+
});
|
|
259
|
+
this._textModelResolverService = _textModelResolverService;
|
|
260
|
+
this._editorService = _editorService;
|
|
261
|
+
this._elements = h('div.inline-chat-newfile-widget@domNode', [
|
|
262
|
+
h('div.title@title', [
|
|
263
|
+
h('span.name.show-file-icons@name'),
|
|
264
|
+
h('span.detail@detail'),
|
|
265
|
+
]),
|
|
266
|
+
h('div.editor@editor'),
|
|
267
|
+
]);
|
|
268
|
+
this._previewStore = ( new MutableDisposable());
|
|
269
|
+
super.create();
|
|
270
|
+
this._name = instaService.createInstance(ResourceLabel, this._elements.name, { supportIcons: true });
|
|
271
|
+
this._elements.detail.appendChild(renderIcon(Codicon.circleFilled));
|
|
272
|
+
const contributions = EditorExtensionsRegistry
|
|
273
|
+
.getEditorContributions()
|
|
274
|
+
.filter(c => c.id !== INLINE_CHAT_ID);
|
|
275
|
+
this._previewEditor = instaService.createInstance(EmbeddedCodeEditorWidget, this._elements.editor, {
|
|
276
|
+
scrollBeyondLastLine: false,
|
|
277
|
+
stickyScroll: { enabled: false },
|
|
278
|
+
minimap: { enabled: false },
|
|
279
|
+
scrollbar: { alwaysConsumeMouseWheel: false, useShadows: true, ignoreHorizontalScrollbarInContentHeight: true, },
|
|
280
|
+
}, { isSimpleWidget: true, contributions }, parentEditor);
|
|
281
|
+
const doStyle = () => {
|
|
282
|
+
const theme = themeService.getColorTheme();
|
|
283
|
+
const overrides = [
|
|
284
|
+
[colorRegistry.editorBackground, inlineChatRegionHighlight],
|
|
285
|
+
[editorColorRegistry.editorGutter, inlineChatRegionHighlight],
|
|
286
|
+
];
|
|
287
|
+
for (const [target, source] of overrides) {
|
|
288
|
+
const value = theme.getColor(source);
|
|
289
|
+
if (value) {
|
|
290
|
+
this._elements.domNode.style.setProperty(colorRegistry.asCssVariableName(target), String(value));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
doStyle();
|
|
295
|
+
this._disposables.add(themeService.onDidColorThemeChange(doStyle));
|
|
296
|
+
this._buttonBar = instaService.createInstance(ButtonBarWidget);
|
|
297
|
+
this._elements.title.appendChild(this._buttonBar.domNode);
|
|
298
|
+
}
|
|
299
|
+
dispose() {
|
|
300
|
+
this._name.dispose();
|
|
301
|
+
this._buttonBar.dispose();
|
|
302
|
+
this._previewEditor.dispose();
|
|
303
|
+
this._previewStore.dispose();
|
|
304
|
+
super.dispose();
|
|
305
|
+
}
|
|
306
|
+
_fillContainer(container) {
|
|
307
|
+
container.appendChild(this._elements.domNode);
|
|
308
|
+
}
|
|
309
|
+
show() {
|
|
310
|
+
throw new Error('Use showFileCreation');
|
|
311
|
+
}
|
|
312
|
+
async showCreation(where, untitledTextModel) {
|
|
313
|
+
const store = ( new DisposableStore());
|
|
314
|
+
this._previewStore.value = store;
|
|
315
|
+
this._name.element.setFile(untitledTextModel.resource, {
|
|
316
|
+
fileKind: FileKind.FILE,
|
|
317
|
+
fileDecorations: { badges: true, colors: true }
|
|
318
|
+
});
|
|
319
|
+
const actionSave = toAction({
|
|
320
|
+
id: '1',
|
|
321
|
+
label: ( localizeWithPath(
|
|
322
|
+
'vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget',
|
|
323
|
+
'save',
|
|
324
|
+
"Create"
|
|
325
|
+
)),
|
|
326
|
+
run: () => untitledTextModel.save({ reason: 1 })
|
|
327
|
+
});
|
|
328
|
+
const actionSaveAs = toAction({
|
|
329
|
+
id: '2',
|
|
330
|
+
label: ( localizeWithPath(
|
|
331
|
+
'vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget',
|
|
332
|
+
'saveAs',
|
|
333
|
+
"Create As"
|
|
334
|
+
)),
|
|
335
|
+
run: async () => {
|
|
336
|
+
const ids = this._editorService.findEditors(untitledTextModel.resource, { supportSideBySide: SideBySideEditor.ANY });
|
|
337
|
+
await this._editorService.save(ids.slice(), { saveAs: true, reason: 1 });
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
this._buttonBar.update([
|
|
341
|
+
[actionSave, actionSaveAs],
|
|
342
|
+
[(toAction({ id: '3', label: ( localizeWithPath(
|
|
343
|
+
'vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget',
|
|
344
|
+
'discard',
|
|
345
|
+
"Discard"
|
|
346
|
+
)), run: () => untitledTextModel.revert() }))]
|
|
347
|
+
]);
|
|
348
|
+
store.add(Event.any(untitledTextModel.onDidRevert, untitledTextModel.onDidSave, untitledTextModel.onDidChangeDirty, untitledTextModel.onWillDispose)(() => this.hide()));
|
|
349
|
+
await untitledTextModel.resolve();
|
|
350
|
+
const ref = await this._textModelResolverService.createModelReference(untitledTextModel.resource);
|
|
351
|
+
store.add(ref);
|
|
352
|
+
const model = ref.object.textEditorModel;
|
|
353
|
+
this._previewEditor.setModel(model);
|
|
354
|
+
const lineHeight = this.editor.getOption(66 );
|
|
355
|
+
this._elements.title.style.height = `${InlineChatFileCreatePreviewWidget_1.TitleHeight}px`;
|
|
356
|
+
const titleHightInLines = InlineChatFileCreatePreviewWidget_1.TitleHeight / lineHeight;
|
|
357
|
+
const maxLines = Math.max(4, Math.floor((this.editor.getLayoutInfo().height / lineHeight) * .33));
|
|
358
|
+
const lines = Math.min(maxLines, model.getLineCount());
|
|
359
|
+
super.show(where, titleHightInLines + lines);
|
|
360
|
+
}
|
|
361
|
+
hide() {
|
|
362
|
+
this._previewStore.clear();
|
|
363
|
+
super.hide();
|
|
364
|
+
}
|
|
365
|
+
revealRange(range, isLastLine) {
|
|
366
|
+
}
|
|
367
|
+
_onWidth(widthInPixel) {
|
|
368
|
+
if (this._dim) {
|
|
369
|
+
this._doLayout(this._dim.height, widthInPixel);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
_doLayout(heightInPixel, widthInPixel) {
|
|
373
|
+
const { lineNumbersLeft } = this.editor.getLayoutInfo();
|
|
374
|
+
this._elements.title.style.marginLeft = `${lineNumbersLeft}px`;
|
|
375
|
+
const newDim = ( new Dimension(widthInPixel, heightInPixel));
|
|
376
|
+
if (!Dimension.equals(this._dim, newDim)) {
|
|
377
|
+
this._dim = newDim;
|
|
378
|
+
this._previewEditor.layout(this._dim.with(undefined, this._dim.height - InlineChatFileCreatePreviewWidget_1.TitleHeight));
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
InlineChatFileCreatePreviewWidget = InlineChatFileCreatePreviewWidget_1 = ( __decorate([
|
|
383
|
+
( __param(1, IInstantiationService)),
|
|
384
|
+
( __param(2, IThemeService)),
|
|
385
|
+
( __param(3, ITextModelService)),
|
|
386
|
+
( __param(4, IEditorService))
|
|
387
|
+
], InlineChatFileCreatePreviewWidget));
|
|
388
|
+
let ButtonBarWidget = class ButtonBarWidget {
|
|
389
|
+
constructor(_contextMenuService) {
|
|
390
|
+
this._contextMenuService = _contextMenuService;
|
|
391
|
+
this._domNode = h('div.buttonbar-widget');
|
|
392
|
+
this._store = ( new DisposableStore());
|
|
393
|
+
this._buttonBar = ( new ButtonBar(this.domNode));
|
|
394
|
+
}
|
|
395
|
+
update(allActions) {
|
|
396
|
+
this._buttonBar.clear();
|
|
397
|
+
let secondary = false;
|
|
398
|
+
for (const actions of allActions) {
|
|
399
|
+
let btn;
|
|
400
|
+
const [first, ...rest] = actions;
|
|
401
|
+
if (!first) {
|
|
402
|
+
continue;
|
|
403
|
+
}
|
|
404
|
+
else if (rest.length === 0) {
|
|
405
|
+
btn = this._buttonBar.addButton({ ...defaultButtonStyles, secondary });
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
btn = this._buttonBar.addButtonWithDropdown({
|
|
409
|
+
...defaultButtonStyles,
|
|
410
|
+
addPrimaryActionToDropdown: false,
|
|
411
|
+
actions: rest,
|
|
412
|
+
contextMenuProvider: this._contextMenuService
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
btn.label = first.label;
|
|
416
|
+
this._store.add(btn.onDidClick(() => first.run()));
|
|
417
|
+
secondary = true;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
dispose() {
|
|
421
|
+
this._buttonBar.dispose();
|
|
422
|
+
this._store.dispose();
|
|
423
|
+
}
|
|
424
|
+
get domNode() {
|
|
425
|
+
return this._domNode.root;
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
ButtonBarWidget = ( __decorate([
|
|
429
|
+
( __param(0, IContextMenuService))
|
|
430
|
+
], ButtonBarWidget));
|
|
431
|
+
export { InlineChatFileCreatePreviewWidget, InlineChatLivePreviewWidget };
|