@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,107 @@
|
|
|
1
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
class UrlFinder extends Disposable {
|
|
4
|
+
static { this.terminalCodesRegex = /(?:\u001B|\u009B)[\[\]()#;?]*(?:(?:(?:[a-zA-Z0-9]*(?:;[a-zA-Z0-9]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-PR-TZcf-ntqry=><~]))/g; }
|
|
5
|
+
static { this.localUrlRegex = /\b\w{2,20}:\/\/(?:localhost|127\.0\.0\.1|0\.0\.0\.0|:\d{2,5})[\w\-\.\~:\/\?\#[\]\@!\$&\(\)\*\+\,\;\=]*/gim; }
|
|
6
|
+
static { this.extractPortRegex = /(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d{1,5})/; }
|
|
7
|
+
static { this.localPythonServerRegex = /HTTP\son\s(127\.0\.0\.1|0\.0\.0\.0)\sport\s(\d+)/; }
|
|
8
|
+
static { this.excludeTerminals = ['Dev Containers']; }
|
|
9
|
+
constructor(terminalService, debugService) {
|
|
10
|
+
super();
|
|
11
|
+
this._onDidMatchLocalUrl = ( new Emitter());
|
|
12
|
+
this.onDidMatchLocalUrl = this._onDidMatchLocalUrl.event;
|
|
13
|
+
this.listeners = ( new Map());
|
|
14
|
+
this.replPositions = ( new Map());
|
|
15
|
+
terminalService.instances.forEach(instance => {
|
|
16
|
+
this.registerTerminalInstance(instance);
|
|
17
|
+
});
|
|
18
|
+
this._register(terminalService.onDidCreateInstance(instance => {
|
|
19
|
+
this.registerTerminalInstance(instance);
|
|
20
|
+
}));
|
|
21
|
+
this._register(terminalService.onDidDisposeInstance(instance => {
|
|
22
|
+
this.listeners.get(instance)?.dispose();
|
|
23
|
+
this.listeners.delete(instance);
|
|
24
|
+
}));
|
|
25
|
+
this._register(debugService.onDidNewSession(session => {
|
|
26
|
+
if (!session.parentSession || (session.parentSession && session.hasSeparateRepl())) {
|
|
27
|
+
this.listeners.set(session.getId(), session.onDidChangeReplElements(() => {
|
|
28
|
+
this.processNewReplElements(session);
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
this._register(debugService.onDidEndSession(session => {
|
|
33
|
+
if (( this.listeners.has(session.getId()))) {
|
|
34
|
+
this.listeners.get(session.getId())?.dispose();
|
|
35
|
+
this.listeners.delete(session.getId());
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
registerTerminalInstance(instance) {
|
|
40
|
+
if (!UrlFinder.excludeTerminals.includes(instance.title)) {
|
|
41
|
+
this.listeners.set(instance, instance.onData(data => {
|
|
42
|
+
this.processData(data);
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
processNewReplElements(session) {
|
|
47
|
+
const oldReplPosition = this.replPositions.get(session.getId());
|
|
48
|
+
const replElements = session.getReplElements();
|
|
49
|
+
this.replPositions.set(session.getId(), { position: replElements.length - 1, tail: replElements[replElements.length - 1] });
|
|
50
|
+
if (!oldReplPosition && replElements.length > 0) {
|
|
51
|
+
replElements.forEach(element => this.processData(( element.toString())));
|
|
52
|
+
}
|
|
53
|
+
else if (oldReplPosition && (replElements.length - 1 !== oldReplPosition.position)) {
|
|
54
|
+
for (let i = replElements.length - 1; i >= 0; i--) {
|
|
55
|
+
const element = replElements[i];
|
|
56
|
+
if (element === oldReplPosition.tail) {
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this.processData(( element.toString()));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
dispose() {
|
|
66
|
+
super.dispose();
|
|
67
|
+
const listeners = ( this.listeners.values());
|
|
68
|
+
for (const listener of listeners) {
|
|
69
|
+
listener.dispose();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
processData(data) {
|
|
73
|
+
data = data.replace(UrlFinder.terminalCodesRegex, '');
|
|
74
|
+
const urlMatches = data.match(UrlFinder.localUrlRegex) || [];
|
|
75
|
+
if (urlMatches && urlMatches.length > 0) {
|
|
76
|
+
urlMatches.forEach((match) => {
|
|
77
|
+
let serverUrl;
|
|
78
|
+
try {
|
|
79
|
+
serverUrl = ( new URL(match));
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
}
|
|
83
|
+
if (serverUrl) {
|
|
84
|
+
const portMatch = match.match(UrlFinder.extractPortRegex);
|
|
85
|
+
const port = parseFloat(serverUrl.port ? serverUrl.port : (portMatch ? portMatch[2] : 'NaN'));
|
|
86
|
+
if (!isNaN(port) && Number.isInteger(port) && port > 0 && port <= 65535) {
|
|
87
|
+
let host = serverUrl.hostname;
|
|
88
|
+
if (host !== '0.0.0.0' && host !== '127.0.0.1') {
|
|
89
|
+
host = 'localhost';
|
|
90
|
+
}
|
|
91
|
+
if (port !== 9229 && data.startsWith('Debugger listening on')) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
this._onDidMatchLocalUrl.fire({ port, host });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const pythonMatch = data.match(UrlFinder.localPythonServerRegex);
|
|
101
|
+
if (pythonMatch && pythonMatch.length === 3) {
|
|
102
|
+
this._onDidMatchLocalUrl.fire({ host: pythonMatch[1], port: Number(pythonMatch[2]) });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export { UrlFinder };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { searchComparer, FileMatch, Match, FolderMatch } from './searchModel.js';
|
|
4
|
+
import { VIEW_ID } from '../../../services/search/common/search.js';
|
|
5
|
+
const category = { value: ( nls.localizeWithPath(
|
|
6
|
+
'vs/workbench/contrib/search/browser/searchActionsBase',
|
|
7
|
+
'search',
|
|
8
|
+
"Search"
|
|
9
|
+
)), original: 'Search' };
|
|
10
|
+
function isSearchViewFocused(viewsService) {
|
|
11
|
+
const searchView = getSearchView(viewsService);
|
|
12
|
+
return !!(searchView && dom.isAncestorOfActiveElement(searchView.getContainer()));
|
|
13
|
+
}
|
|
14
|
+
function appendKeyBindingLabel(label, inputKeyBinding) {
|
|
15
|
+
return doAppendKeyBindingLabel(label, inputKeyBinding);
|
|
16
|
+
}
|
|
17
|
+
function getSearchView(viewsService) {
|
|
18
|
+
return viewsService.getActiveViewWithId(VIEW_ID);
|
|
19
|
+
}
|
|
20
|
+
function getElementsToOperateOn(viewer, currElement, sortConfig) {
|
|
21
|
+
let elements = viewer.getSelection().filter((x) => x !== null).sort((a, b) => searchComparer(a, b, sortConfig.sortOrder));
|
|
22
|
+
if (currElement && !(elements.length > 1 && elements.includes(currElement))) {
|
|
23
|
+
elements = [currElement];
|
|
24
|
+
}
|
|
25
|
+
return elements;
|
|
26
|
+
}
|
|
27
|
+
function shouldRefocus(elements, focusElement) {
|
|
28
|
+
if (!focusElement) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return !focusElement || elements.includes(focusElement) || hasDownstreamMatch(elements, focusElement);
|
|
32
|
+
}
|
|
33
|
+
function hasDownstreamMatch(elements, focusElement) {
|
|
34
|
+
for (const elem of elements) {
|
|
35
|
+
if ((elem instanceof FileMatch && focusElement instanceof Match && elem.matches().includes(focusElement)) ||
|
|
36
|
+
(elem instanceof FolderMatch && ((focusElement instanceof FileMatch && elem.getDownstreamFileMatch(focusElement.resource)) ||
|
|
37
|
+
(focusElement instanceof Match && elem.getDownstreamFileMatch(focusElement.parent().resource))))) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
function openSearchView(viewsService, focus) {
|
|
44
|
+
return viewsService.openView(VIEW_ID, focus).then(view => (view ?? undefined));
|
|
45
|
+
}
|
|
46
|
+
function doAppendKeyBindingLabel(label, keyBinding) {
|
|
47
|
+
return keyBinding ? label + ' (' + keyBinding.getLabel() + ')' : label;
|
|
48
|
+
}
|
|
49
|
+
export { appendKeyBindingLabel, category, getElementsToOperateOn, getSearchView, isSearchViewFocused, openSearchView, shouldRefocus };
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { dirname } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
4
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
5
|
+
import { IListService } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
|
|
6
|
+
import { IViewsService } from '../../../common/views.js';
|
|
7
|
+
import { RestrictSearchToFolderId, SearchViewVisibleKey, ResourceFolderFocusKey, ExcludeFolderFromSearchId, RevealInSideBarForSearchResults, FileFocusKey, HasSearchResults, FindInFilesActionId, FindInFolderId, FindInWorkspaceId } from '../common/constants.js';
|
|
8
|
+
import { OpenEditorCommandId } from '../../searchEditor/browser/constants.js';
|
|
9
|
+
import { FileMatch, Match } from './searchModel.js';
|
|
10
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
11
|
+
import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
12
|
+
import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
13
|
+
import { resolveResourcesForSearchIncludes } from '../../../services/search/common/queryBuilder.js';
|
|
14
|
+
import { IExplorerService, getMultiSelectedResources } from '../../files/browser/files.js';
|
|
15
|
+
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
16
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
17
|
+
import { VIEWLET_ID, FilesExplorerFocusCondition, ExplorerFolderContext, ExplorerRootContext } from '../../files/common/files.js';
|
|
18
|
+
import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js';
|
|
19
|
+
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
20
|
+
import { category, getSearchView, openSearchView, getElementsToOperateOn } from './searchActionsBase.js';
|
|
21
|
+
import { IConfigurationResolverService } from '../../../services/configurationResolver/common/configurationResolver.js';
|
|
22
|
+
import { IHistoryService } from '../../../services/history/common/history.js';
|
|
23
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
24
|
+
registerAction2(class RestrictSearchToFolderAction extends Action2 {
|
|
25
|
+
constructor() {
|
|
26
|
+
super({
|
|
27
|
+
id: RestrictSearchToFolderId,
|
|
28
|
+
title: {
|
|
29
|
+
value: ( nls.localizeWithPath(
|
|
30
|
+
'vs/workbench/contrib/search/browser/searchActionsFind',
|
|
31
|
+
'restrictResultsToFolder',
|
|
32
|
+
"Restrict Search to Folder"
|
|
33
|
+
)),
|
|
34
|
+
original: 'Restrict Search to Folder'
|
|
35
|
+
},
|
|
36
|
+
category,
|
|
37
|
+
keybinding: {
|
|
38
|
+
weight: 200 ,
|
|
39
|
+
when: ( ContextKeyExpr.and(SearchViewVisibleKey, ResourceFolderFocusKey)),
|
|
40
|
+
primary: 1024 | 512 | 36 ,
|
|
41
|
+
},
|
|
42
|
+
menu: [
|
|
43
|
+
{
|
|
44
|
+
id: MenuId.SearchContext,
|
|
45
|
+
group: 'search',
|
|
46
|
+
order: 3,
|
|
47
|
+
when: ( ContextKeyExpr.and(ResourceFolderFocusKey))
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async run(accessor, folderMatch) {
|
|
53
|
+
await searchWithFolderCommand(accessor, false, true, undefined, folderMatch);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
registerAction2(class ExcludeFolderFromSearchAction extends Action2 {
|
|
57
|
+
constructor() {
|
|
58
|
+
super({
|
|
59
|
+
id: ExcludeFolderFromSearchId,
|
|
60
|
+
title: {
|
|
61
|
+
value: ( nls.localizeWithPath(
|
|
62
|
+
'vs/workbench/contrib/search/browser/searchActionsFind',
|
|
63
|
+
'excludeFolderFromSearch',
|
|
64
|
+
"Exclude Folder from Search"
|
|
65
|
+
)),
|
|
66
|
+
original: 'Exclude Folder from Search'
|
|
67
|
+
},
|
|
68
|
+
category,
|
|
69
|
+
menu: [
|
|
70
|
+
{
|
|
71
|
+
id: MenuId.SearchContext,
|
|
72
|
+
group: 'search',
|
|
73
|
+
order: 4,
|
|
74
|
+
when: ( ContextKeyExpr.and(ResourceFolderFocusKey))
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async run(accessor, folderMatch) {
|
|
80
|
+
await searchWithFolderCommand(accessor, false, false, undefined, folderMatch);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
registerAction2(class RevealInSideBarForSearchResultsAction extends Action2 {
|
|
84
|
+
constructor() {
|
|
85
|
+
super({
|
|
86
|
+
id: RevealInSideBarForSearchResults,
|
|
87
|
+
title: {
|
|
88
|
+
value: ( nls.localizeWithPath(
|
|
89
|
+
'vs/workbench/contrib/search/browser/searchActionsFind',
|
|
90
|
+
'revealInSideBar',
|
|
91
|
+
"Reveal in Explorer View"
|
|
92
|
+
)),
|
|
93
|
+
original: 'Reveal in Explorer View'
|
|
94
|
+
},
|
|
95
|
+
category,
|
|
96
|
+
menu: [{
|
|
97
|
+
id: MenuId.SearchContext,
|
|
98
|
+
when: ( ContextKeyExpr.and(FileFocusKey, HasSearchResults)),
|
|
99
|
+
group: 'search_3',
|
|
100
|
+
order: 1
|
|
101
|
+
}]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async run(accessor, args) {
|
|
105
|
+
const paneCompositeService = accessor.get(IPaneCompositePartService);
|
|
106
|
+
const explorerService = accessor.get(IExplorerService);
|
|
107
|
+
const contextService = accessor.get(IWorkspaceContextService);
|
|
108
|
+
const searchView = getSearchView(accessor.get(IViewsService));
|
|
109
|
+
if (!searchView) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
let fileMatch;
|
|
113
|
+
if (!(args instanceof FileMatch)) {
|
|
114
|
+
args = searchView.getControl().getFocus()[0];
|
|
115
|
+
}
|
|
116
|
+
if (args instanceof FileMatch) {
|
|
117
|
+
fileMatch = args;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , false).then((viewlet) => {
|
|
123
|
+
if (!viewlet) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const explorerViewContainer = viewlet.getViewPaneContainer();
|
|
127
|
+
const uri = fileMatch.resource;
|
|
128
|
+
if (uri && contextService.isInsideWorkspace(uri)) {
|
|
129
|
+
const explorerView = explorerViewContainer.getExplorerView();
|
|
130
|
+
explorerView.setExpanded(true);
|
|
131
|
+
explorerService.select(uri, true).then(() => explorerView.focus(), onUnexpectedError);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
registerAction2(class FindInFilesAction extends Action2 {
|
|
137
|
+
constructor() {
|
|
138
|
+
super({
|
|
139
|
+
id: FindInFilesActionId,
|
|
140
|
+
title: {
|
|
141
|
+
value: ( nls.localizeWithPath(
|
|
142
|
+
'vs/workbench/contrib/search/browser/searchActionsFind',
|
|
143
|
+
'findInFiles',
|
|
144
|
+
"Find in Files"
|
|
145
|
+
)),
|
|
146
|
+
mnemonicTitle: ( nls.localizeWithPath(
|
|
147
|
+
'vs/workbench/contrib/search/browser/searchActionsFind',
|
|
148
|
+
{ key: 'miFindInFiles', comment: ['&& denotes a mnemonic'] },
|
|
149
|
+
"Find &&in Files"
|
|
150
|
+
)),
|
|
151
|
+
original: 'Find in Files'
|
|
152
|
+
},
|
|
153
|
+
metadata: {
|
|
154
|
+
description: ( nls.localizeWithPath(
|
|
155
|
+
'vs/workbench/contrib/search/browser/searchActionsFind',
|
|
156
|
+
'findInFiles.description',
|
|
157
|
+
"Open a workspace search"
|
|
158
|
+
)),
|
|
159
|
+
args: [
|
|
160
|
+
{
|
|
161
|
+
name: ( nls.localizeWithPath(
|
|
162
|
+
'vs/workbench/contrib/search/browser/searchActionsFind',
|
|
163
|
+
'findInFiles.args',
|
|
164
|
+
"A set of options for the search"
|
|
165
|
+
)),
|
|
166
|
+
schema: {
|
|
167
|
+
type: 'object',
|
|
168
|
+
properties: {
|
|
169
|
+
query: { 'type': 'string' },
|
|
170
|
+
replace: { 'type': 'string' },
|
|
171
|
+
preserveCase: { 'type': 'boolean' },
|
|
172
|
+
triggerSearch: { 'type': 'boolean' },
|
|
173
|
+
filesToInclude: { 'type': 'string' },
|
|
174
|
+
filesToExclude: { 'type': 'string' },
|
|
175
|
+
isRegex: { 'type': 'boolean' },
|
|
176
|
+
isCaseSensitive: { 'type': 'boolean' },
|
|
177
|
+
matchWholeWord: { 'type': 'boolean' },
|
|
178
|
+
useExcludeSettingsAndIgnoreFiles: { 'type': 'boolean' },
|
|
179
|
+
onlyOpenEditors: { 'type': 'boolean' },
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
category,
|
|
186
|
+
keybinding: {
|
|
187
|
+
weight: 200 ,
|
|
188
|
+
primary: 2048 | 1024 | 36 ,
|
|
189
|
+
},
|
|
190
|
+
menu: [{
|
|
191
|
+
id: MenuId.MenubarEditMenu,
|
|
192
|
+
group: '4_find_global',
|
|
193
|
+
order: 1,
|
|
194
|
+
}],
|
|
195
|
+
f1: true
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
async run(accessor, args = {}) {
|
|
199
|
+
findInFilesCommand(accessor, args);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
registerAction2(class FindInFolderAction extends Action2 {
|
|
203
|
+
constructor() {
|
|
204
|
+
super({
|
|
205
|
+
id: FindInFolderId,
|
|
206
|
+
title: {
|
|
207
|
+
value: ( nls.localizeWithPath(
|
|
208
|
+
'vs/workbench/contrib/search/browser/searchActionsFind',
|
|
209
|
+
'findInFolder',
|
|
210
|
+
"Find in Folder..."
|
|
211
|
+
)),
|
|
212
|
+
original: 'Find in Folder...'
|
|
213
|
+
},
|
|
214
|
+
category,
|
|
215
|
+
keybinding: {
|
|
216
|
+
weight: 200 ,
|
|
217
|
+
when: ( ContextKeyExpr.and(FilesExplorerFocusCondition, ExplorerFolderContext)),
|
|
218
|
+
primary: 1024 | 512 | 36 ,
|
|
219
|
+
},
|
|
220
|
+
menu: [
|
|
221
|
+
{
|
|
222
|
+
id: MenuId.ExplorerContext,
|
|
223
|
+
group: '4_search',
|
|
224
|
+
order: 10,
|
|
225
|
+
when: ( ContextKeyExpr.and(ExplorerFolderContext))
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
async run(accessor, resource) {
|
|
231
|
+
await searchWithFolderCommand(accessor, true, true, resource);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
registerAction2(class FindInWorkspaceAction extends Action2 {
|
|
235
|
+
constructor() {
|
|
236
|
+
super({
|
|
237
|
+
id: FindInWorkspaceId,
|
|
238
|
+
title: {
|
|
239
|
+
value: ( nls.localizeWithPath(
|
|
240
|
+
'vs/workbench/contrib/search/browser/searchActionsFind',
|
|
241
|
+
'findInWorkspace',
|
|
242
|
+
"Find in Workspace..."
|
|
243
|
+
)),
|
|
244
|
+
original: 'Find in Workspace...'
|
|
245
|
+
},
|
|
246
|
+
category,
|
|
247
|
+
menu: [
|
|
248
|
+
{
|
|
249
|
+
id: MenuId.ExplorerContext,
|
|
250
|
+
group: '4_search',
|
|
251
|
+
order: 10,
|
|
252
|
+
when: ( ContextKeyExpr.and(ExplorerRootContext, ( ExplorerFolderContext.toNegated())))
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
async run(accessor) {
|
|
258
|
+
const searchConfig = accessor.get(IConfigurationService).getValue().search;
|
|
259
|
+
const mode = searchConfig.mode;
|
|
260
|
+
if (mode === 'view') {
|
|
261
|
+
const searchView = await openSearchView(accessor.get(IViewsService), true);
|
|
262
|
+
searchView?.searchInFolders();
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
return accessor.get(ICommandService).executeCommand(OpenEditorCommandId, {
|
|
266
|
+
location: mode === 'newEditor' ? 'new' : 'reuse',
|
|
267
|
+
filesToInclude: '',
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
async function searchWithFolderCommand(accessor, isFromExplorer, isIncludes, resource, folderMatch) {
|
|
273
|
+
const listService = accessor.get(IListService);
|
|
274
|
+
const fileService = accessor.get(IFileService);
|
|
275
|
+
const viewsService = accessor.get(IViewsService);
|
|
276
|
+
const contextService = accessor.get(IWorkspaceContextService);
|
|
277
|
+
const commandService = accessor.get(ICommandService);
|
|
278
|
+
const searchConfig = accessor.get(IConfigurationService).getValue().search;
|
|
279
|
+
const mode = searchConfig.mode;
|
|
280
|
+
let resources;
|
|
281
|
+
if (isFromExplorer) {
|
|
282
|
+
resources = getMultiSelectedResources(resource, listService, accessor.get(IEditorService), accessor.get(IExplorerService));
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
const searchView = getSearchView(accessor.get(IViewsService));
|
|
286
|
+
if (!searchView) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
resources = getMultiSelectedSearchResources(searchView.getControl(), folderMatch, searchConfig);
|
|
290
|
+
}
|
|
291
|
+
const resolvedResources = fileService.resolveAll(( resources.map(resource => ({ resource })))).then(results => {
|
|
292
|
+
const folders = [];
|
|
293
|
+
results.forEach(result => {
|
|
294
|
+
if (result.success && result.stat) {
|
|
295
|
+
folders.push(result.stat.isDirectory ? result.stat.resource : dirname(result.stat.resource));
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
return resolveResourcesForSearchIncludes(folders, contextService);
|
|
299
|
+
});
|
|
300
|
+
if (mode === 'view') {
|
|
301
|
+
const searchView = await openSearchView(viewsService, true);
|
|
302
|
+
if (resources && resources.length && searchView) {
|
|
303
|
+
if (isIncludes) {
|
|
304
|
+
searchView.searchInFolders(await resolvedResources);
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
searchView.searchOutsideOfFolders(await resolvedResources);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return undefined;
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
if (isIncludes) {
|
|
314
|
+
return commandService.executeCommand(OpenEditorCommandId, {
|
|
315
|
+
filesToInclude: (await resolvedResources).join(', '),
|
|
316
|
+
showIncludesExcludes: true,
|
|
317
|
+
location: mode === 'newEditor' ? 'new' : 'reuse',
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
return commandService.executeCommand(OpenEditorCommandId, {
|
|
322
|
+
filesToExclude: (await resolvedResources).join(', '),
|
|
323
|
+
showIncludesExcludes: true,
|
|
324
|
+
location: mode === 'newEditor' ? 'new' : 'reuse',
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function getMultiSelectedSearchResources(viewer, currElement, sortConfig) {
|
|
330
|
+
return ( getElementsToOperateOn(viewer, currElement, sortConfig)
|
|
331
|
+
.map(
|
|
332
|
+
(renderableMatch) => ((renderableMatch instanceof Match) ? null : renderableMatch.resource)
|
|
333
|
+
))
|
|
334
|
+
.filter((renderableMatch) => (renderableMatch !== null));
|
|
335
|
+
}
|
|
336
|
+
async function findInFilesCommand(accessor, _args = {}) {
|
|
337
|
+
const searchConfig = accessor.get(IConfigurationService).getValue().search;
|
|
338
|
+
const viewsService = accessor.get(IViewsService);
|
|
339
|
+
const commandService = accessor.get(ICommandService);
|
|
340
|
+
const args = {};
|
|
341
|
+
if (( Object.keys(_args)).length !== 0) {
|
|
342
|
+
const configurationResolverService = accessor.get(IConfigurationResolverService);
|
|
343
|
+
const historyService = accessor.get(IHistoryService);
|
|
344
|
+
const workspaceContextService = accessor.get(IWorkspaceContextService);
|
|
345
|
+
const activeWorkspaceRootUri = historyService.getLastActiveWorkspaceRoot();
|
|
346
|
+
const filteredActiveWorkspaceRootUri = activeWorkspaceRootUri?.scheme === Schemas.file || activeWorkspaceRootUri?.scheme === Schemas.vscodeRemote ? activeWorkspaceRootUri : undefined;
|
|
347
|
+
const lastActiveWorkspaceRoot = filteredActiveWorkspaceRootUri ? workspaceContextService.getWorkspaceFolder(filteredActiveWorkspaceRootUri) ?? undefined : undefined;
|
|
348
|
+
for (const entry of Object.entries(_args)) {
|
|
349
|
+
const name = entry[0];
|
|
350
|
+
const value = entry[1];
|
|
351
|
+
if (value !== undefined) {
|
|
352
|
+
args[name] = (typeof value === 'string') ? await configurationResolverService.resolveAsync(lastActiveWorkspaceRoot, value) : value;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
const mode = searchConfig.mode;
|
|
357
|
+
if (mode === 'view') {
|
|
358
|
+
openSearchView(viewsService, false).then(openedView => {
|
|
359
|
+
if (openedView) {
|
|
360
|
+
const searchAndReplaceWidget = openedView.searchAndReplaceWidget;
|
|
361
|
+
searchAndReplaceWidget.toggleReplace(typeof args.replace === 'string');
|
|
362
|
+
let updatedText = false;
|
|
363
|
+
if (typeof args.query !== 'string') {
|
|
364
|
+
updatedText = openedView.updateTextFromFindWidgetOrSelection({ allowUnselectedWord: typeof args.replace !== 'string' });
|
|
365
|
+
}
|
|
366
|
+
openedView.setSearchParameters(args);
|
|
367
|
+
openedView.searchAndReplaceWidget.focus(undefined, updatedText, updatedText);
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
const convertArgs = (args) => ({
|
|
373
|
+
location: mode === 'newEditor' ? 'new' : 'reuse',
|
|
374
|
+
query: args.query,
|
|
375
|
+
filesToInclude: args.filesToInclude,
|
|
376
|
+
filesToExclude: args.filesToExclude,
|
|
377
|
+
matchWholeWord: args.matchWholeWord,
|
|
378
|
+
isCaseSensitive: args.isCaseSensitive,
|
|
379
|
+
isRegexp: args.isRegex,
|
|
380
|
+
useExcludeSettingsAndIgnoreFiles: args.useExcludeSettingsAndIgnoreFiles,
|
|
381
|
+
onlyOpenEditors: args.onlyOpenEditors,
|
|
382
|
+
showIncludesExcludes: !!(args.filesToExclude || args.filesToExclude || !args.useExcludeSettingsAndIgnoreFiles),
|
|
383
|
+
});
|
|
384
|
+
commandService.executeCommand(OpenEditorCommandId, convertArgs(args));
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
export { findInFilesCommand };
|
|
@@ -24,8 +24,8 @@ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/commo
|
|
|
24
24
|
import { overviewRulerFindMatchForeground, minimapFindMatch } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
25
25
|
import { themeColorFromId } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
26
26
|
import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
|
|
27
|
-
import { FindMatchDecorationModel } from '
|
|
28
|
-
import { NotebookEditorWidget } from '
|
|
27
|
+
import { FindMatchDecorationModel } from '../../notebook/browser/contrib/find/findMatchDecorationModel.js';
|
|
28
|
+
import { NotebookEditorWidget } from '../../notebook/browser/notebookEditorWidget.js';
|
|
29
29
|
import { INotebookEditorService } from '../../notebook/browser/services/notebookEditorService.js';
|
|
30
30
|
import { NotebookCellsChangeType } from '../../notebook/common/notebookCommon.js';
|
|
31
31
|
import { IReplaceService } from './replace.js';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
2
|
+
const FindInFilesActionId = 'workbench.action.findInFiles';
|
|
3
|
+
const FocusSearchFromResults = 'search.action.focusSearchFromResults';
|
|
4
|
+
const OpenMatch = 'search.action.openResult';
|
|
5
|
+
const OpenMatchToSide = 'search.action.openResultToSide';
|
|
6
|
+
const RemoveActionId = 'search.action.remove';
|
|
7
|
+
const CopyPathCommandId = 'search.action.copyPath';
|
|
8
|
+
const CopyMatchCommandId = 'search.action.copyMatch';
|
|
9
|
+
const CopyAllCommandId = 'search.action.copyAll';
|
|
10
|
+
const OpenInEditorCommandId = 'search.action.openInEditor';
|
|
11
|
+
const ClearSearchHistoryCommandId = 'search.action.clearHistory';
|
|
12
|
+
const FocusSearchListCommandID = 'search.action.focusSearchList';
|
|
13
|
+
const ReplaceActionId = 'search.action.replace';
|
|
14
|
+
const ReplaceAllInFileActionId = 'search.action.replaceAllInFile';
|
|
15
|
+
const ReplaceAllInFolderActionId = 'search.action.replaceAllInFolder';
|
|
16
|
+
const CloseReplaceWidgetActionId = 'closeReplaceInFilesWidget';
|
|
17
|
+
const ToggleCaseSensitiveCommandId = 'toggleSearchCaseSensitive';
|
|
18
|
+
const ToggleWholeWordCommandId = 'toggleSearchWholeWord';
|
|
19
|
+
const ToggleRegexCommandId = 'toggleSearchRegex';
|
|
20
|
+
const TogglePreserveCaseId = 'toggleSearchPreserveCase';
|
|
21
|
+
const AddCursorsAtSearchResults = 'addCursorsAtSearchResults';
|
|
22
|
+
const RevealInSideBarForSearchResults = 'search.action.revealInSideBar';
|
|
23
|
+
const ReplaceInFilesActionId = 'workbench.action.replaceInFiles';
|
|
24
|
+
const ShowAllSymbolsActionId = 'workbench.action.showAllSymbols';
|
|
25
|
+
const QuickTextSearchActionId = 'workbench.action.experimental.quickTextSearch';
|
|
26
|
+
const CancelSearchActionId = 'search.action.cancel';
|
|
27
|
+
const RefreshSearchResultsActionId = 'search.action.refreshSearchResults';
|
|
28
|
+
const FocusNextSearchResultActionId = 'search.action.focusNextSearchResult';
|
|
29
|
+
const FocusPreviousSearchResultActionId = 'search.action.focusPreviousSearchResult';
|
|
30
|
+
const ToggleSearchOnTypeActionId = 'workbench.action.toggleSearchOnType';
|
|
31
|
+
const CollapseSearchResultsActionId = 'search.action.collapseSearchResults';
|
|
32
|
+
const ExpandSearchResultsActionId = 'search.action.expandSearchResults';
|
|
33
|
+
const ClearSearchResultsActionId = 'search.action.clearSearchResults';
|
|
34
|
+
const ViewAsTreeActionId = 'search.action.viewAsTree';
|
|
35
|
+
const ViewAsListActionId = 'search.action.viewAsList';
|
|
36
|
+
const ToggleQueryDetailsActionId = 'workbench.action.search.toggleQueryDetails';
|
|
37
|
+
const ExcludeFolderFromSearchId = 'search.action.excludeFromSearch';
|
|
38
|
+
const FocusNextInputActionId = 'search.focus.nextInputBox';
|
|
39
|
+
const FocusPreviousInputActionId = 'search.focus.previousInputBox';
|
|
40
|
+
const RestrictSearchToFolderId = 'search.action.restrictSearchToFolder';
|
|
41
|
+
const FindInFolderId = 'filesExplorer.findInFolder';
|
|
42
|
+
const FindInWorkspaceId = 'filesExplorer.findInWorkspace';
|
|
43
|
+
const SearchViewVisibleKey = ( new RawContextKey('searchViewletVisible', true));
|
|
44
|
+
const SearchViewFocusedKey = ( new RawContextKey('searchViewletFocus', false));
|
|
45
|
+
const InputBoxFocusedKey = ( new RawContextKey('inputBoxFocus', false));
|
|
46
|
+
const SearchInputBoxFocusedKey = ( new RawContextKey('searchInputBoxFocus', false));
|
|
47
|
+
const ReplaceInputBoxFocusedKey = ( new RawContextKey('replaceInputBoxFocus', false));
|
|
48
|
+
const PatternIncludesFocusedKey = ( new RawContextKey('patternIncludesInputBoxFocus', false));
|
|
49
|
+
const PatternExcludesFocusedKey = ( new RawContextKey('patternExcludesInputBoxFocus', false));
|
|
50
|
+
const ReplaceActiveKey = ( new RawContextKey('replaceActive', false));
|
|
51
|
+
const HasSearchResults = ( new RawContextKey('hasSearchResult', false));
|
|
52
|
+
const FirstMatchFocusKey = ( new RawContextKey('firstMatchFocus', false));
|
|
53
|
+
const FileMatchOrMatchFocusKey = ( new RawContextKey('fileMatchOrMatchFocus', false));
|
|
54
|
+
const FileMatchOrFolderMatchFocusKey = ( new RawContextKey('fileMatchOrFolderMatchFocus', false));
|
|
55
|
+
const FileMatchOrFolderMatchWithResourceFocusKey = ( new RawContextKey('fileMatchOrFolderMatchWithResourceFocus', false));
|
|
56
|
+
const FileFocusKey = ( new RawContextKey('fileMatchFocus', false));
|
|
57
|
+
const FolderFocusKey = ( new RawContextKey('folderMatchFocus', false));
|
|
58
|
+
const ResourceFolderFocusKey = ( new RawContextKey('folderMatchWithResourceFocus', false));
|
|
59
|
+
const IsEditableItemKey = ( new RawContextKey('isEditableItem', true));
|
|
60
|
+
const MatchFocusKey = ( new RawContextKey('matchFocus', false));
|
|
61
|
+
const ViewHasSearchPatternKey = ( new RawContextKey('viewHasSearchPattern', false));
|
|
62
|
+
const ViewHasReplacePatternKey = ( new RawContextKey('viewHasReplacePattern', false));
|
|
63
|
+
const ViewHasFilePatternKey = ( new RawContextKey('viewHasFilePattern', false));
|
|
64
|
+
const ViewHasSomeCollapsibleKey = ( new RawContextKey('viewHasSomeCollapsibleResult', false));
|
|
65
|
+
const InTreeViewKey = ( new RawContextKey('inTreeView', false));
|
|
66
|
+
export { AddCursorsAtSearchResults, CancelSearchActionId, ClearSearchHistoryCommandId, ClearSearchResultsActionId, CloseReplaceWidgetActionId, CollapseSearchResultsActionId, CopyAllCommandId, CopyMatchCommandId, CopyPathCommandId, ExcludeFolderFromSearchId, ExpandSearchResultsActionId, FileFocusKey, FileMatchOrFolderMatchFocusKey, FileMatchOrFolderMatchWithResourceFocusKey, FileMatchOrMatchFocusKey, FindInFilesActionId, FindInFolderId, FindInWorkspaceId, FirstMatchFocusKey, FocusNextInputActionId, FocusNextSearchResultActionId, FocusPreviousInputActionId, FocusPreviousSearchResultActionId, FocusSearchFromResults, FocusSearchListCommandID, FolderFocusKey, HasSearchResults, InTreeViewKey, InputBoxFocusedKey, IsEditableItemKey, MatchFocusKey, OpenInEditorCommandId, OpenMatch, OpenMatchToSide, PatternExcludesFocusedKey, PatternIncludesFocusedKey, QuickTextSearchActionId, RefreshSearchResultsActionId, RemoveActionId, ReplaceActionId, ReplaceActiveKey, ReplaceAllInFileActionId, ReplaceAllInFolderActionId, ReplaceInFilesActionId, ReplaceInputBoxFocusedKey, ResourceFolderFocusKey, RestrictSearchToFolderId, RevealInSideBarForSearchResults, SearchInputBoxFocusedKey, SearchViewFocusedKey, SearchViewVisibleKey, ShowAllSymbolsActionId, ToggleCaseSensitiveCommandId, TogglePreserveCaseId, ToggleQueryDetailsActionId, ToggleRegexCommandId, ToggleSearchOnTypeActionId, ToggleWholeWordCommandId, ViewAsListActionId, ViewAsTreeActionId, ViewHasFilePatternKey, ViewHasReplacePatternKey, ViewHasSearchPatternKey, ViewHasSomeCollapsibleKey };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
2
|
+
const InSearchEditor = ( new RawContextKey('inSearchEditor', false));
|
|
3
|
+
const SearchEditorScheme = 'search-editor';
|
|
4
|
+
const SearchEditorWorkingCopyTypeId = 'search/editor';
|
|
5
|
+
const SearchEditorFindMatchClass = 'searchEditorFindMatch';
|
|
6
|
+
const SearchEditorID = 'workbench.editor.searchEditor';
|
|
7
|
+
const OpenNewEditorCommandId = 'search.action.openNewEditor';
|
|
8
|
+
const OpenEditorCommandId = 'search.action.openEditor';
|
|
9
|
+
const ToggleSearchEditorContextLinesCommandId = 'toggleSearchEditorContextLines';
|
|
10
|
+
const SearchEditorInputTypeId = 'workbench.editorinputs.searchEditorInput';
|
|
11
|
+
export { InSearchEditor, OpenEditorCommandId, OpenNewEditorCommandId, SearchEditorFindMatchClass, SearchEditorID, SearchEditorInputTypeId, SearchEditorScheme, SearchEditorWorkingCopyTypeId, ToggleSearchEditorContextLinesCommandId };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EditorAction2 } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
|
|
2
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
4
|
+
const defaultOptions = {
|
|
5
|
+
category: {
|
|
6
|
+
value: ( localizeWithPath(
|
|
7
|
+
'vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions',
|
|
8
|
+
'snippets',
|
|
9
|
+
'Snippets'
|
|
10
|
+
)),
|
|
11
|
+
original: 'Snippets'
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
class SnippetsAction extends Action2 {
|
|
15
|
+
constructor(desc) {
|
|
16
|
+
super({ ...defaultOptions, ...desc });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
class SnippetEditorAction extends EditorAction2 {
|
|
20
|
+
constructor(desc) {
|
|
21
|
+
super({ ...defaultOptions, ...desc });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export { SnippetEditorAction, SnippetsAction };
|