@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,19 @@
|
|
|
1
|
+
import { LineRange } from 'monaco-editor/esm/vs/editor/common/core/lineRange.js';
|
|
2
|
+
import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
|
|
3
|
+
function invertLineRange(range, model) {
|
|
4
|
+
if (range.isEmpty) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const result = [];
|
|
8
|
+
if (range.startLineNumber > 1) {
|
|
9
|
+
result.push(( new LineRange(1, range.startLineNumber)));
|
|
10
|
+
}
|
|
11
|
+
if (range.endLineNumberExclusive < model.getLineCount() + 1) {
|
|
12
|
+
result.push(( new LineRange(range.endLineNumberExclusive, model.getLineCount() + 1)));
|
|
13
|
+
}
|
|
14
|
+
return result.filter(r => !r.isEmpty);
|
|
15
|
+
}
|
|
16
|
+
function lineRangeAsRange(r) {
|
|
17
|
+
return ( new Range(r.startLineNumber, 1, r.endLineNumberExclusive - 1, 1));
|
|
18
|
+
}
|
|
19
|
+
export { invertLineRange, lineRangeAsRange };
|
|
@@ -1,17 +1,136 @@
|
|
|
1
1
|
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
2
2
|
import { MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
3
3
|
import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
4
|
+
import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
4
5
|
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
5
6
|
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
6
7
|
import { registerColor, editorWidgetBackground, editorWidgetBorder, widgetShadow, editorHoverHighlight, focusBorder, inputPlaceholderForeground, inputBackground, transparent, diffInserted, diffRemoved } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
7
8
|
import { Extensions } from '../../../common/configuration.js';
|
|
8
9
|
const IInlineChatService = ( createDecorator('IInlineChatService'));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const INLINE_CHAT_ID = 'interactiveEditor';
|
|
11
|
+
const INTERACTIVE_EDITOR_ACCESSIBILITY_HELP_ID = 'interactiveEditorAccessiblityHelp';
|
|
12
|
+
const INLINE_CHAT_DECORATIONS_ID = 'interactiveEditorDecorations';
|
|
13
|
+
const CTX_INLINE_CHAT_HAS_PROVIDER = ( new RawContextKey('inlineChatHasProvider', false, ( localizeWithPath(
|
|
14
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
15
|
+
'inlineChatHasProvider',
|
|
16
|
+
"Whether a provider for interactive editors exists"
|
|
17
|
+
))));
|
|
18
|
+
const CTX_INLINE_CHAT_VISIBLE = ( new RawContextKey('inlineChatVisible', false, ( localizeWithPath(
|
|
19
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
20
|
+
'inlineChatVisible',
|
|
21
|
+
"Whether the interactive editor input is visible"
|
|
22
|
+
))));
|
|
23
|
+
const CTX_INLINE_CHAT_FOCUSED = ( new RawContextKey('inlineChatFocused', false, ( localizeWithPath(
|
|
24
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
25
|
+
'inlineChatFocused',
|
|
26
|
+
"Whether the interactive editor input is focused"
|
|
27
|
+
))));
|
|
28
|
+
const CTX_INLINE_CHAT_RESPONSE_FOCUSED = ( new RawContextKey('inlineChatResponseFocused', false, ( localizeWithPath(
|
|
29
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
30
|
+
'inlineChatResponseFocused',
|
|
31
|
+
"Whether the interactive widget's response is focused"
|
|
32
|
+
))));
|
|
33
|
+
const CTX_INLINE_CHAT_EMPTY = ( new RawContextKey('inlineChatEmpty', false, ( localizeWithPath(
|
|
34
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
35
|
+
'inlineChatEmpty',
|
|
36
|
+
"Whether the interactive editor input is empty"
|
|
37
|
+
))));
|
|
38
|
+
const CTX_INLINE_CHAT_INNER_CURSOR_FIRST = ( new RawContextKey('inlineChatInnerCursorFirst', false, ( localizeWithPath(
|
|
39
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
40
|
+
'inlineChatInnerCursorFirst',
|
|
41
|
+
"Whether the cursor of the iteractive editor input is on the first line"
|
|
42
|
+
))));
|
|
43
|
+
const CTX_INLINE_CHAT_INNER_CURSOR_LAST = ( new RawContextKey('inlineChatInnerCursorLast', false, ( localizeWithPath(
|
|
44
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
45
|
+
'inlineChatInnerCursorLast',
|
|
46
|
+
"Whether the cursor of the iteractive editor input is on the last line"
|
|
47
|
+
))));
|
|
48
|
+
const CTX_INLINE_CHAT_INNER_CURSOR_START = ( new RawContextKey('inlineChatInnerCursorStart', false, ( localizeWithPath(
|
|
49
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
50
|
+
'inlineChatInnerCursorStart',
|
|
51
|
+
"Whether the cursor of the iteractive editor input is on the start of the input"
|
|
52
|
+
))));
|
|
53
|
+
const CTX_INLINE_CHAT_INNER_CURSOR_END = ( new RawContextKey('inlineChatInnerCursorEnd', false, ( localizeWithPath(
|
|
54
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
55
|
+
'inlineChatInnerCursorEnd',
|
|
56
|
+
"Whether the cursor of the iteractive editor input is on the end of the input"
|
|
57
|
+
))));
|
|
58
|
+
const CTX_INLINE_CHAT_MESSAGE_CROP_STATE = ( new RawContextKey('inlineChatMarkdownMessageCropState', 'not_cropped', ( localizeWithPath(
|
|
59
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
60
|
+
'inlineChatMarkdownMessageCropState',
|
|
61
|
+
"Whether the interactive editor message is cropped, not cropped or expanded"
|
|
62
|
+
))));
|
|
63
|
+
const CTX_INLINE_CHAT_OUTER_CURSOR_POSITION = ( new RawContextKey('inlineChatOuterCursorPosition', '', ( localizeWithPath(
|
|
64
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
65
|
+
'inlineChatOuterCursorPosition',
|
|
66
|
+
"Whether the cursor of the outer editor is above or below the interactive editor input"
|
|
67
|
+
))));
|
|
68
|
+
const CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST = ( new RawContextKey('inlineChatHasActiveRequest', false, ( localizeWithPath(
|
|
69
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
70
|
+
'inlineChatHasActiveRequest',
|
|
71
|
+
"Whether interactive editor has an active request"
|
|
72
|
+
))));
|
|
73
|
+
const CTX_INLINE_CHAT_HAS_STASHED_SESSION = ( new RawContextKey('inlineChatHasStashedSession', false, ( localizeWithPath(
|
|
74
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
75
|
+
'inlineChatHasStashedSession',
|
|
76
|
+
"Whether interactive editor has kept a session for quick restore"
|
|
77
|
+
))));
|
|
78
|
+
const CTX_INLINE_CHAT_LAST_RESPONSE_TYPE = ( new RawContextKey('inlineChatLastResponseType', undefined, ( localizeWithPath(
|
|
79
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
80
|
+
'inlineChatResponseType',
|
|
81
|
+
"What type was the last response of the current interactive editor session"
|
|
82
|
+
))));
|
|
83
|
+
const CTX_INLINE_CHAT_RESPONSE_TYPES = ( new RawContextKey('inlineChatResponseTypes', undefined, ( localizeWithPath(
|
|
84
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
85
|
+
'inlineChatResponseTypes',
|
|
86
|
+
"What type was the responses have been receieved"
|
|
87
|
+
))));
|
|
88
|
+
const CTX_INLINE_CHAT_DID_EDIT = ( new RawContextKey('inlineChatDidEdit', undefined, ( localizeWithPath(
|
|
89
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
90
|
+
'inlineChatDidEdit',
|
|
91
|
+
"Whether interactive editor did change any code"
|
|
92
|
+
))));
|
|
93
|
+
const CTX_INLINE_CHAT_USER_DID_EDIT = ( new RawContextKey('inlineChatUserDidEdit', undefined, ( localizeWithPath(
|
|
94
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
95
|
+
'inlineChatUserDidEdit',
|
|
96
|
+
"Whether the user did changes ontop of the inline chat"
|
|
97
|
+
))));
|
|
98
|
+
const CTX_INLINE_CHAT_LAST_FEEDBACK = ( new RawContextKey('inlineChatLastFeedbackKind', '', ( localizeWithPath(
|
|
99
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
100
|
+
'inlineChatLastFeedbackKind',
|
|
101
|
+
"The last kind of feedback that was provided"
|
|
102
|
+
))));
|
|
103
|
+
const CTX_INLINE_CHAT_SUPPORT_ISSUE_REPORTING = ( new RawContextKey('inlineChatSupportIssueReporting', false, ( localizeWithPath(
|
|
104
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
105
|
+
'inlineChatSupportIssueReporting',
|
|
106
|
+
"Whether the interactive editor supports issue reporting"
|
|
107
|
+
))));
|
|
108
|
+
const CTX_INLINE_CHAT_DOCUMENT_CHANGED = ( new RawContextKey('inlineChatDocumentChanged', false, ( localizeWithPath(
|
|
109
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
110
|
+
'inlineChatDocumentChanged',
|
|
111
|
+
"Whether the document has changed concurrently"
|
|
112
|
+
))));
|
|
113
|
+
const CTX_INLINE_CHAT_CHANGE_HAS_DIFF = ( new RawContextKey('inlineChatChangeHasDiff', false, ( localizeWithPath(
|
|
114
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
115
|
+
'inlineChatChangeHasDiff',
|
|
116
|
+
"Whether the current change supports showing a diff"
|
|
117
|
+
))));
|
|
118
|
+
const CTX_INLINE_CHAT_CHANGE_SHOWS_DIFF = ( new RawContextKey('inlineChatChangeShowsDiff', false, ( localizeWithPath(
|
|
119
|
+
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
120
|
+
'inlineChatChangeShowsDiff',
|
|
121
|
+
"Whether the current change showing a diff"
|
|
122
|
+
))));
|
|
123
|
+
const CTX_INLINE_CHAT_EDIT_MODE = ( new RawContextKey('config.inlineChat.mode', "live" ));
|
|
124
|
+
const CTX_INLINE_CHAT_TOOLBAR_ICON_ENABLED = ( new RawContextKey('config.inlineChat.showToolbarIcon', false));
|
|
125
|
+
const ACTION_ACCEPT_CHANGES = 'interactive.acceptChanges';
|
|
126
|
+
const ACTION_REGENERATE_RESPONSE = 'inlineChat.regenerate';
|
|
127
|
+
const ACTION_VIEW_IN_CHAT = 'inlineChat.viewInChat';
|
|
128
|
+
const MENU_INLINE_CHAT_WIDGET = MenuId.for('inlineChatWidget');
|
|
129
|
+
const MENU_INLINE_CHAT_WIDGET_MARKDOWN_MESSAGE = MenuId.for('inlineChatWidget.markdownMessage');
|
|
130
|
+
const MENU_INLINE_CHAT_WIDGET_STATUS = MenuId.for('inlineChatWidget.status');
|
|
131
|
+
const MENU_INLINE_CHAT_WIDGET_FEEDBACK = MenuId.for('inlineChatWidget.feedback');
|
|
132
|
+
const MENU_INLINE_CHAT_WIDGET_DISCARD = MenuId.for('inlineChatWidget.undo');
|
|
133
|
+
const MENU_INLINE_CHAT_WIDGET_TOGGLE = MenuId.for('inlineChatWidget.toggle');
|
|
15
134
|
registerColor('inlineChat.background', { dark: editorWidgetBackground, light: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, ( localizeWithPath(
|
|
16
135
|
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
17
136
|
'inlineChat.background',
|
|
@@ -27,7 +146,7 @@ registerColor('inlineChat.shadow', { dark: widgetShadow, light: widgetShadow, hc
|
|
|
27
146
|
'inlineChat.shadow',
|
|
28
147
|
"Shadow color of the interactive editor widget"
|
|
29
148
|
)));
|
|
30
|
-
registerColor('inlineChat.regionHighlight', { dark: editorHoverHighlight, light: editorHoverHighlight, hcDark: editorHoverHighlight, hcLight: editorHoverHighlight }, ( localizeWithPath(
|
|
149
|
+
const inlineChatRegionHighlight = registerColor('inlineChat.regionHighlight', { dark: editorHoverHighlight, light: editorHoverHighlight, hcDark: editorHoverHighlight, hcLight: editorHoverHighlight }, ( localizeWithPath(
|
|
31
150
|
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
32
151
|
'inlineChat.regionHighlight',
|
|
33
152
|
"Background highlighting of the current interactive region. Must be transparent."
|
|
@@ -52,12 +171,12 @@ registerColor('inlineChatInput.background', { dark: inputBackground, light: inpu
|
|
|
52
171
|
'inlineChatInput.background',
|
|
53
172
|
"Background color of the interactive editor input"
|
|
54
173
|
)));
|
|
55
|
-
registerColor('inlineChatDiff.inserted', { dark: ( transparent(diffInserted, .5)), light: ( transparent(diffInserted, .5)), hcDark: ( transparent(diffInserted, .5)), hcLight: ( transparent(diffInserted, .5)) }, ( localizeWithPath(
|
|
174
|
+
const inlineChatDiffInserted = registerColor('inlineChatDiff.inserted', { dark: ( transparent(diffInserted, .5)), light: ( transparent(diffInserted, .5)), hcDark: ( transparent(diffInserted, .5)), hcLight: ( transparent(diffInserted, .5)) }, ( localizeWithPath(
|
|
56
175
|
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
57
176
|
'inlineChatDiff.inserted',
|
|
58
177
|
"Background color of inserted text in the interactive editor input"
|
|
59
178
|
)));
|
|
60
|
-
registerColor('inlineChatDiff.removed', { dark: ( transparent(diffRemoved, .5)), light: ( transparent(diffRemoved, .5)), hcDark: ( transparent(diffRemoved, .5)), hcLight: ( transparent(diffRemoved, .5)) }, ( localizeWithPath(
|
|
179
|
+
const inlineChatDiffRemoved = registerColor('inlineChatDiff.removed', { dark: ( transparent(diffRemoved, .5)), light: ( transparent(diffRemoved, .5)), hcDark: ( transparent(diffRemoved, .5)), hcLight: ( transparent(diffRemoved, .5)) }, ( localizeWithPath(
|
|
61
180
|
'vs/workbench/contrib/inlineChat/common/inlineChat',
|
|
62
181
|
'inlineChatDiff.removed',
|
|
63
182
|
"Background color of removed text in the interactive editor input"
|
|
@@ -144,4 +263,4 @@ registerColor('inlineChatDiff.removed', { dark: ( transparent(diffRemoved, .5)),
|
|
|
144
263
|
}
|
|
145
264
|
}
|
|
146
265
|
});
|
|
147
|
-
export { IInlineChatService };
|
|
266
|
+
export { ACTION_ACCEPT_CHANGES, ACTION_REGENERATE_RESPONSE, ACTION_VIEW_IN_CHAT, CTX_INLINE_CHAT_CHANGE_HAS_DIFF, CTX_INLINE_CHAT_CHANGE_SHOWS_DIFF, CTX_INLINE_CHAT_DID_EDIT, CTX_INLINE_CHAT_DOCUMENT_CHANGED, CTX_INLINE_CHAT_EDIT_MODE, CTX_INLINE_CHAT_EMPTY, CTX_INLINE_CHAT_FOCUSED, CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST, CTX_INLINE_CHAT_HAS_PROVIDER, CTX_INLINE_CHAT_HAS_STASHED_SESSION, CTX_INLINE_CHAT_INNER_CURSOR_END, CTX_INLINE_CHAT_INNER_CURSOR_FIRST, CTX_INLINE_CHAT_INNER_CURSOR_LAST, CTX_INLINE_CHAT_INNER_CURSOR_START, CTX_INLINE_CHAT_LAST_FEEDBACK, CTX_INLINE_CHAT_LAST_RESPONSE_TYPE, CTX_INLINE_CHAT_MESSAGE_CROP_STATE, CTX_INLINE_CHAT_OUTER_CURSOR_POSITION, CTX_INLINE_CHAT_RESPONSE_FOCUSED, CTX_INLINE_CHAT_RESPONSE_TYPES, CTX_INLINE_CHAT_SUPPORT_ISSUE_REPORTING, CTX_INLINE_CHAT_TOOLBAR_ICON_ENABLED, CTX_INLINE_CHAT_USER_DID_EDIT, CTX_INLINE_CHAT_VISIBLE, IInlineChatService, INLINE_CHAT_DECORATIONS_ID, INLINE_CHAT_ID, INTERACTIVE_EDITOR_ACCESSIBILITY_HELP_ID, MENU_INLINE_CHAT_WIDGET, MENU_INLINE_CHAT_WIDGET_DISCARD, MENU_INLINE_CHAT_WIDGET_FEEDBACK, MENU_INLINE_CHAT_WIDGET_MARKDOWN_MESSAGE, MENU_INLINE_CHAT_WIDGET_STATUS, MENU_INLINE_CHAT_WIDGET_TOGGLE, inlineChatDiffInserted, inlineChatDiffRemoved, inlineChatRegionHighlight };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { hookDomPurifyHrefAndSrcSanitizer, basicMarkupHtmlTags } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
2
|
+
import * as dompurify from 'monaco-editor/esm/vs/base/browser/dompurify/dompurify.js';
|
|
3
|
+
import { allowedMarkdownAttr } from 'monaco-editor/esm/vs/base/browser/markdownRenderer.js';
|
|
4
|
+
import { marked } from 'monaco-editor/esm/vs/base/common/marked/marked.js';
|
|
5
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
6
|
+
import { tokenizeToString } from 'monaco-editor/esm/vs/editor/common/languages/textToHtmlTokenizer.js';
|
|
7
|
+
import { escape } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
8
|
+
const DEFAULT_MARKDOWN_STYLES = `
|
|
9
|
+
body {
|
|
10
|
+
padding: 10px 20px;
|
|
11
|
+
line-height: 22px;
|
|
12
|
+
max-width: 882px;
|
|
13
|
+
margin: 0 auto;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
body *:last-child {
|
|
17
|
+
margin-bottom: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
img {
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
max-height: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
a {
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
a:hover {
|
|
30
|
+
text-decoration: underline;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
a:focus,
|
|
34
|
+
input:focus,
|
|
35
|
+
select:focus,
|
|
36
|
+
textarea:focus {
|
|
37
|
+
outline: 1px solid -webkit-focus-ring-color;
|
|
38
|
+
outline-offset: -1px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
hr {
|
|
42
|
+
border: 0;
|
|
43
|
+
height: 2px;
|
|
44
|
+
border-bottom: 2px solid;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
h1 {
|
|
48
|
+
padding-bottom: 0.3em;
|
|
49
|
+
line-height: 1.2;
|
|
50
|
+
border-bottom-width: 1px;
|
|
51
|
+
border-bottom-style: solid;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
h1, h2, h3 {
|
|
55
|
+
font-weight: normal;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
table {
|
|
59
|
+
border-collapse: collapse;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
th {
|
|
63
|
+
text-align: left;
|
|
64
|
+
border-bottom: 1px solid;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
th,
|
|
68
|
+
td {
|
|
69
|
+
padding: 5px 10px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
table > tbody > tr + tr > td {
|
|
73
|
+
border-top-width: 1px;
|
|
74
|
+
border-top-style: solid;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
blockquote {
|
|
78
|
+
margin: 0 7px 0 5px;
|
|
79
|
+
padding: 0 16px 0 10px;
|
|
80
|
+
border-left-width: 5px;
|
|
81
|
+
border-left-style: solid;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
code {
|
|
85
|
+
font-family: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
pre {
|
|
89
|
+
padding: 16px;
|
|
90
|
+
border-radius: 3px;
|
|
91
|
+
overflow: auto;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
pre code {
|
|
95
|
+
font-family: var(--vscode-editor-font-family);
|
|
96
|
+
font-weight: var(--vscode-editor-font-weight);
|
|
97
|
+
font-size: var(--vscode-editor-font-size);
|
|
98
|
+
line-height: 1.5;
|
|
99
|
+
color: var(--vscode-editor-foreground);
|
|
100
|
+
tab-size: 4;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.monaco-tokenized-source {
|
|
104
|
+
white-space: pre;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Theming */
|
|
108
|
+
|
|
109
|
+
.pre {
|
|
110
|
+
background-color: var(--vscode-textCodeBlock-background);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.vscode-high-contrast h1 {
|
|
114
|
+
border-color: rgb(0, 0, 0);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.vscode-light th {
|
|
118
|
+
border-color: rgba(0, 0, 0, 0.69);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.vscode-dark th {
|
|
122
|
+
border-color: rgba(255, 255, 255, 0.69);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.vscode-light h1,
|
|
126
|
+
.vscode-light hr,
|
|
127
|
+
.vscode-light td {
|
|
128
|
+
border-color: rgba(0, 0, 0, 0.18);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.vscode-dark h1,
|
|
132
|
+
.vscode-dark hr,
|
|
133
|
+
.vscode-dark td {
|
|
134
|
+
border-color: rgba(255, 255, 255, 0.18);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@media (forced-colors: active) and (prefers-color-scheme: light){
|
|
138
|
+
body {
|
|
139
|
+
forced-color-adjust: none;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@media (forced-colors: active) and (prefers-color-scheme: dark){
|
|
144
|
+
body {
|
|
145
|
+
forced-color-adjust: none;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
const allowedProtocols = [Schemas.http, Schemas.https, Schemas.command];
|
|
150
|
+
function sanitize(documentContent, allowUnknownProtocols) {
|
|
151
|
+
const hook = hookDomPurifyHrefAndSrcSanitizer(allowedProtocols, true);
|
|
152
|
+
try {
|
|
153
|
+
return dompurify.sanitize(documentContent, {
|
|
154
|
+
...{
|
|
155
|
+
ALLOWED_TAGS: [
|
|
156
|
+
...basicMarkupHtmlTags,
|
|
157
|
+
'checkbox',
|
|
158
|
+
'checklist',
|
|
159
|
+
],
|
|
160
|
+
ALLOWED_ATTR: [
|
|
161
|
+
...allowedMarkdownAttr,
|
|
162
|
+
'data-command', 'name', 'id', 'role', 'tabindex',
|
|
163
|
+
'x-dispatch',
|
|
164
|
+
'required', 'checked', 'placeholder', 'when-checked', 'checked-on',
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
...(allowUnknownProtocols ? { ALLOW_UNKNOWN_PROTOCOLS: true } : {}),
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
finally {
|
|
171
|
+
hook.dispose();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async function renderMarkdownDocument(text, extensionService, languageService, shouldSanitize = true, allowUnknownProtocols = false, token) {
|
|
175
|
+
const highlight = (code, lang, callback) => {
|
|
176
|
+
if (!callback) {
|
|
177
|
+
return code;
|
|
178
|
+
}
|
|
179
|
+
if (typeof lang !== 'string') {
|
|
180
|
+
callback(null, `<code>${escape(code)}</code>`);
|
|
181
|
+
return '';
|
|
182
|
+
}
|
|
183
|
+
extensionService.whenInstalledExtensionsRegistered().then(async () => {
|
|
184
|
+
if (token?.isCancellationRequested) {
|
|
185
|
+
callback(null, '');
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const languageId = languageService.getLanguageIdByLanguageName(lang);
|
|
189
|
+
const html = await tokenizeToString(languageService, code, languageId);
|
|
190
|
+
callback(null, `<code>${html}</code>`);
|
|
191
|
+
});
|
|
192
|
+
return '';
|
|
193
|
+
};
|
|
194
|
+
return ( new Promise((resolve, reject) => {
|
|
195
|
+
marked(text, { highlight }, (err, value) => err ? reject(err) : resolve(value));
|
|
196
|
+
})).then(raw => {
|
|
197
|
+
if (shouldSanitize) {
|
|
198
|
+
return sanitize(raw, allowUnknownProtocols);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
return raw;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
export { DEFAULT_MARKDOWN_STYLES, renderMarkdownDocument };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { assertFn } from 'monaco-editor/esm/vs/base/common/assert.js';
|
|
3
|
+
import { autorun } from 'monaco-editor/esm/vs/base/common/observable.js';
|
|
4
|
+
import { isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
5
|
+
import { isDefined } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
6
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
7
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
8
|
+
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
9
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
10
|
+
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
11
|
+
import { DEFAULT_EDITOR_ASSOCIATION, isResourceMergeEditorInput } from '../../../common/editor.js';
|
|
12
|
+
import { AbstractTextResourceEditorInput } from '../../../common/editor/textResourceEditorInput.js';
|
|
13
|
+
import { TempFileMergeEditorModeFactory, WorkspaceMergeEditorModeFactory } from './mergeEditorInputModel.js';
|
|
14
|
+
import { MergeEditorTelemetry } from './telemetry.js';
|
|
15
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
16
|
+
import { IFilesConfigurationService } from '../../../services/filesConfiguration/common/filesConfigurationService.js';
|
|
17
|
+
import { ITextFileService } from '../../../services/textfile/common/textfiles.js';
|
|
18
|
+
var MergeEditorInput_1;
|
|
19
|
+
class MergeEditorInputData {
|
|
20
|
+
constructor(uri, title, detail, description) {
|
|
21
|
+
this.uri = uri;
|
|
22
|
+
this.title = title;
|
|
23
|
+
this.detail = detail;
|
|
24
|
+
this.description = description;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
let MergeEditorInput = class MergeEditorInput extends AbstractTextResourceEditorInput {
|
|
28
|
+
static { MergeEditorInput_1 = this; }
|
|
29
|
+
static { this.ID = 'mergeEditor.Input'; }
|
|
30
|
+
get useWorkingCopy() {
|
|
31
|
+
return this.configurationService.getValue('mergeEditor.useWorkingCopy') ?? false;
|
|
32
|
+
}
|
|
33
|
+
constructor(base, input1, input2, result, _instaService, editorService, textFileService, labelService, fileService, configurationService, filesConfigurationService) {
|
|
34
|
+
super(result, undefined, editorService, textFileService, labelService, fileService, filesConfigurationService);
|
|
35
|
+
this.base = base;
|
|
36
|
+
this.input1 = input1;
|
|
37
|
+
this.input2 = input2;
|
|
38
|
+
this.result = result;
|
|
39
|
+
this._instaService = _instaService;
|
|
40
|
+
this.configurationService = configurationService;
|
|
41
|
+
this.closeHandler = {
|
|
42
|
+
showConfirm: () => this._inputModel?.shouldConfirmClose() ?? false,
|
|
43
|
+
confirm: async (editors) => {
|
|
44
|
+
assertFn(() => editors.every(e => e.editor instanceof MergeEditorInput_1));
|
|
45
|
+
const inputModels = ( editors.map(e => e.editor._inputModel)).filter(isDefined);
|
|
46
|
+
return await this._inputModel.confirmClose(inputModels);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
this.mergeEditorModeFactory = this._instaService.createInstance(this.useWorkingCopy
|
|
50
|
+
? TempFileMergeEditorModeFactory
|
|
51
|
+
: WorkspaceMergeEditorModeFactory, this._instaService.createInstance(MergeEditorTelemetry));
|
|
52
|
+
}
|
|
53
|
+
dispose() {
|
|
54
|
+
super.dispose();
|
|
55
|
+
}
|
|
56
|
+
get typeId() {
|
|
57
|
+
return MergeEditorInput_1.ID;
|
|
58
|
+
}
|
|
59
|
+
get editorId() {
|
|
60
|
+
return DEFAULT_EDITOR_ASSOCIATION.id;
|
|
61
|
+
}
|
|
62
|
+
get capabilities() {
|
|
63
|
+
let capabilities = super.capabilities | 256 ;
|
|
64
|
+
if (this.useWorkingCopy) {
|
|
65
|
+
capabilities |= 4 ;
|
|
66
|
+
}
|
|
67
|
+
return capabilities;
|
|
68
|
+
}
|
|
69
|
+
getName() {
|
|
70
|
+
return ( localizeWithPath(
|
|
71
|
+
'vs/workbench/contrib/mergeEditor/browser/mergeEditorInput',
|
|
72
|
+
'name',
|
|
73
|
+
"Merging: {0}",
|
|
74
|
+
super.getName()
|
|
75
|
+
));
|
|
76
|
+
}
|
|
77
|
+
async resolve() {
|
|
78
|
+
if (!this._inputModel) {
|
|
79
|
+
const inputModel = this._register(await this.mergeEditorModeFactory.createInputModel({
|
|
80
|
+
base: this.base,
|
|
81
|
+
input1: this.input1,
|
|
82
|
+
input2: this.input2,
|
|
83
|
+
result: this.result,
|
|
84
|
+
}));
|
|
85
|
+
this._inputModel = inputModel;
|
|
86
|
+
this._register(autorun(reader => {
|
|
87
|
+
inputModel.isDirty.read(reader);
|
|
88
|
+
this._onDidChangeDirty.fire();
|
|
89
|
+
}));
|
|
90
|
+
await this._inputModel.model.onInitialized;
|
|
91
|
+
}
|
|
92
|
+
return this._inputModel;
|
|
93
|
+
}
|
|
94
|
+
async accept() {
|
|
95
|
+
await this._inputModel?.accept();
|
|
96
|
+
}
|
|
97
|
+
async save(group, options) {
|
|
98
|
+
await this._inputModel?.save(options);
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
toUntyped() {
|
|
102
|
+
return {
|
|
103
|
+
input1: { resource: this.input1.uri, label: this.input1.title, description: this.input1.description, detail: this.input1.detail },
|
|
104
|
+
input2: { resource: this.input2.uri, label: this.input2.title, description: this.input2.description, detail: this.input2.detail },
|
|
105
|
+
base: { resource: this.base },
|
|
106
|
+
result: { resource: this.result },
|
|
107
|
+
options: {
|
|
108
|
+
override: this.typeId
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
matches(otherInput) {
|
|
113
|
+
if (this === otherInput) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
if (otherInput instanceof MergeEditorInput_1) {
|
|
117
|
+
return isEqual(this.base, otherInput.base)
|
|
118
|
+
&& isEqual(this.input1.uri, otherInput.input1.uri)
|
|
119
|
+
&& isEqual(this.input2.uri, otherInput.input2.uri)
|
|
120
|
+
&& isEqual(this.result, otherInput.result);
|
|
121
|
+
}
|
|
122
|
+
if (isResourceMergeEditorInput(otherInput)) {
|
|
123
|
+
return (this.editorId === otherInput.options?.override || otherInput.options?.override === undefined)
|
|
124
|
+
&& isEqual(this.base, otherInput.base.resource)
|
|
125
|
+
&& isEqual(this.input1.uri, otherInput.input1.resource)
|
|
126
|
+
&& isEqual(this.input2.uri, otherInput.input2.resource)
|
|
127
|
+
&& isEqual(this.result, otherInput.result.resource);
|
|
128
|
+
}
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
async revert(group, options) {
|
|
132
|
+
return this._inputModel?.revert(options);
|
|
133
|
+
}
|
|
134
|
+
isDirty() {
|
|
135
|
+
return this._inputModel?.isDirty.get() ?? false;
|
|
136
|
+
}
|
|
137
|
+
setLanguageId(languageId, source) {
|
|
138
|
+
this._inputModel?.model.setLanguageId(languageId, source);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
MergeEditorInput = MergeEditorInput_1 = ( __decorate([
|
|
142
|
+
( __param(4, IInstantiationService)),
|
|
143
|
+
( __param(5, IEditorService)),
|
|
144
|
+
( __param(6, ITextFileService)),
|
|
145
|
+
( __param(7, ILabelService)),
|
|
146
|
+
( __param(8, IFileService)),
|
|
147
|
+
( __param(9, IConfigurationService)),
|
|
148
|
+
( __param(10, IFilesConfigurationService))
|
|
149
|
+
], MergeEditorInput));
|
|
150
|
+
export { MergeEditorInput, MergeEditorInputData };
|