@codingame/monaco-vscode-api 1.79.1 → 1.79.2-next.0
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 +11 -2
- package/dist/api.js +10 -8
- package/dist/composite.d.ts +65 -0
- package/dist/configurationRegistry.d.ts +212 -0
- package/dist/contextkey.d.ts +1 -1
- package/dist/default-extensions/json.js +1 -0
- package/dist/default-extensions/theme-defaults.js +2 -2
- package/dist/editorBrowser.d.ts +272 -3
- package/dist/event.d.ts +6 -1
- package/dist/{extension-tools-0c4c1ad7.js → extension-tools-3c2bf0a4.js} +698 -507
- package/dist/extensions.d.ts +3 -2
- package/dist/extensions.d2.ts +6 -17
- package/dist/extensionsRegistry.d.ts +15 -9
- package/dist/files.d.ts +71 -7
- package/dist/jsonSchema.d.ts +1 -1
- package/dist/keybinding.d.ts +2 -2
- package/dist/languageFeatures.d.ts +703 -61
- package/dist/monaco.d.ts +5 -4
- package/dist/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/browser/notebookEditor.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -1
- package/dist/platform.d.ts +11 -0
- package/dist/rollup-extension-directory-plugin.js +1 -1
- package/dist/rollup-vsix-plugin.js +1 -1
- package/dist/service-override/configuration.d.ts +5 -206
- package/dist/service-override/files.d.ts +2 -2
- package/dist/service-override/files.js +1 -1
- package/dist/service-override/markers.d.ts +7 -0
- package/dist/service-override/markers.js +6 -0
- package/dist/service-override/output.d.ts +7 -0
- package/dist/service-override/output.js +22 -0
- package/dist/service-override/preferences.js +7 -1
- package/dist/service-override/quickaccess.js +0 -9
- package/dist/service-override/search.d.ts +7 -0
- package/dist/service-override/search.js +19 -0
- package/dist/service-override/terminal.d.ts +607 -0
- package/dist/service-override/terminal.js +98 -0
- package/dist/service-override/tools/editor.js +1 -1
- package/dist/service-override/views.d.ts +561 -335
- package/dist/service-override/views.js +51 -11
- package/dist/services.d.ts +2627 -108
- package/dist/services.js +3 -0
- package/dist/severity.d.ts +16 -0
- package/dist/uri.d.ts +22 -11
- package/dist/views.d.ts +270 -0
- package/dist/vscode/vs/base/common/processes.js +24 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/decorations.js +20 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/delegatingEditorImpl.js +106 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorSash.js +59 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +41 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.js +369 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffModel.js +247 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.js +179 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/overviewRulerPart.js +121 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/style.css.js +4 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/unchangedRanges.js +184 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/utils.js +88 -0
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagement.js +38 -1
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagementUtil.js +5 -1
- package/dist/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +13 -5
- package/dist/vscode/vs/platform/files/common/fileService.js +43 -5
- package/dist/vscode/vs/platform/files/common/files.js +3 -1
- package/dist/vscode/vs/platform/languagePacks/common/languagePacks.js +4 -1
- package/dist/vscode/vs/platform/log/common/bufferLog.js +34 -0
- package/dist/vscode/vs/platform/log/common/fileLog.js +105 -0
- package/dist/vscode/vs/platform/quickinput/browser/quickPickPin.js +1 -1
- package/dist/vscode/vs/platform/remote/common/remoteAuthorityResolver.js +20 -1
- package/dist/vscode/vs/platform/request/browser/requestService.js +1 -1
- package/dist/vscode/vs/platform/request/common/request.js +3 -3
- package/dist/vscode/vs/platform/storage/common/storage.js +3 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +39 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +565 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +27 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +22 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +46 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +80 -0
- package/dist/vscode/vs/platform/terminal/common/environmentVariable.js +7 -0
- package/dist/vscode/vs/platform/terminal/common/environmentVariableCollection.js +196 -0
- package/dist/vscode/vs/platform/terminal/common/environmentVariableShared.js +23 -0
- package/dist/vscode/vs/platform/terminal/common/terminal.js +21 -1
- package/dist/vscode/vs/platform/terminal/common/terminalDataBuffering.js +45 -0
- package/dist/vscode/vs/platform/terminal/common/terminalEnvironment.js +37 -0
- package/dist/vscode/vs/platform/terminal/common/terminalPlatformConfiguration.js +622 -0
- package/dist/vscode/vs/platform/terminal/common/terminalProfiles.js +107 -0
- package/dist/vscode/vs/platform/terminal/common/terminalRecorder.js +66 -0
- package/dist/vscode/vs/platform/terminal/common/terminalStrings.js +16 -0
- package/dist/vscode/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +321 -0
- package/dist/vscode/vs/platform/userDataSync/common/settingsMerge.js +39 -1
- package/dist/vscode/vs/platform/userDataSync/common/userDataSync.js +19 -0
- package/dist/vscode/vs/platform/workspace/common/canonicalUri.js +3 -0
- package/dist/vscode/vs/platform/workspace/common/virtualWorkspace.js +4 -1
- package/dist/vscode/vs/platform/workspaces/common/workspaces.js +2 -2
- package/dist/vscode/vs/workbench/api/browser/mainThreadCommands.js +2 -3
- package/dist/vscode/vs/workbench/api/browser/mainThreadEditorTabs.js +473 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadLanguageFeatures.js +45 -38
- package/dist/vscode/vs/workbench/api/browser/mainThreadSearch.js +146 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadStatusBar.js +33 -52
- package/dist/vscode/vs/workbench/api/browser/mainThreadTerminalService.js +395 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadTheming.js +22 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadTreeViews.js +10 -5
- package/dist/vscode/vs/workbench/api/browser/mainThreadWindow.js +11 -4
- package/dist/vscode/vs/workbench/api/browser/mainThreadWorkspace.js +34 -11
- package/dist/vscode/vs/workbench/api/browser/statusBarExtensionPoint.js +81 -0
- package/dist/vscode/vs/workbench/api/common/extHost.protocol.js +7 -2
- package/dist/vscode/vs/workbench/api/common/extHostDebugService.js +4 -13
- package/dist/vscode/vs/workbench/api/common/extHostExtensionService.js +30 -15
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemConsumer.js +20 -6
- package/dist/vscode/vs/workbench/api/common/extHostLanguageFeatures.js +41 -8
- package/dist/vscode/vs/workbench/api/common/extHostManagedSockets.js +3 -0
- package/dist/vscode/vs/workbench/api/common/extHostSearch.js +109 -0
- package/dist/vscode/vs/workbench/api/common/extHostStatusBar.js +33 -6
- package/dist/vscode/vs/workbench/api/common/extHostTerminalService.js +879 -1
- package/dist/vscode/vs/workbench/api/common/extHostTheming.js +38 -0
- package/dist/vscode/vs/workbench/api/common/extHostTreeViews.js +8 -5
- package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +15 -17
- package/dist/vscode/vs/workbench/api/common/extHostTypes.js +117 -4
- package/dist/vscode/vs/workbench/api/common/extHostWindow.js +28 -6
- package/dist/vscode/vs/workbench/api/common/extHostWorkspace.js +28 -0
- package/dist/vscode/vs/workbench/api/common/shared/dataTransferCache.js +11 -14
- package/dist/vscode/vs/workbench/api/node/extHostTerminalService.js +22 -0
- package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +2 -1
- package/dist/vscode/vs/workbench/browser/actions/windowActions.js +2 -2
- package/dist/vscode/vs/workbench/browser/dnd.js +56 -2
- package/dist/vscode/vs/workbench/browser/parts/compositePart.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/dialogs/dialogHandler.js +2 -2
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +1 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.js +1 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorCommands.js +9 -10
- package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupView.js +15 -9
- package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupWatermark.js +13 -17
- package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorsObserver.js +2 -2
- package/dist/vscode/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/noTabsTitleControl.js +3 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/tabsTitleControl.js +60 -11
- package/dist/vscode/vs/workbench/browser/parts/editor/textDiffEditor.js +16 -10
- package/dist/vscode/vs/workbench/browser/parts/editor/textResourceEditor.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/statusbar/media/statusbarpart.css.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/views/checkbox.js +10 -0
- package/dist/vscode/vs/workbench/browser/parts/views/treeView.js +78 -14
- package/dist/vscode/vs/workbench/browser/parts/views/viewPaneContainer.js +1 -1
- package/dist/vscode/vs/workbench/browser/workbench.contribution.js +65 -6
- package/dist/vscode/vs/workbench/common/configuration.js +8 -1
- package/dist/vscode/vs/workbench/common/contextkeys.js +9 -1
- package/dist/vscode/vs/workbench/common/editor/editorGroupModel.js +5 -1
- package/dist/vscode/vs/workbench/common/editor/resourceEditorInput.js +6 -3
- package/dist/vscode/vs/workbench/common/editor/textResourceEditorInput.js +9 -6
- package/dist/vscode/vs/workbench/common/editor.js +1 -5
- package/dist/vscode/vs/workbench/common/resources.js +111 -34
- package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +1 -1
- package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +1 -1
- package/dist/vscode/vs/workbench/contrib/chat/browser/chat.js +3 -0
- package/dist/vscode/vs/workbench/contrib/chat/common/chatService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +6 -4
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +250 -0
- package/dist/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput.js +290 -0
- package/dist/vscode/vs/workbench/contrib/customEditor/common/customEditor.js +3 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugActionViewItems.js +1 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugCommands.js +2 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +20 -20
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorActions.js +5 -3
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorContribution.js +5 -2
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugHover.js +33 -6
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugSession.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugTaskRunner.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/repl.js +3 -3
- package/dist/vscode/vs/workbench/contrib/debug/common/debugModel.js +29 -17
- package/dist/vscode/vs/workbench/contrib/debug/common/debugStorage.js +11 -10
- package/dist/vscode/vs/workbench/contrib/debug/common/debugger.js +10 -6
- package/dist/vscode/vs/workbench/contrib/extensions/browser/extensionsActions.js +2514 -0
- package/dist/vscode/vs/workbench/contrib/extensions/browser/extensionsIcons.js +82 -0
- package/dist/vscode/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/extensions/common/extensions.js +6 -1
- package/dist/vscode/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +16 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +2 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +2 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/explorerService.js +10 -6
- package/dist/vscode/vs/workbench/contrib/files/browser/explorerViewlet.js +3 -18
- package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.contribution.js +37 -2
- package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.js +65 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/fileCommands.js +3 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/fileConstants.js +3 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/files.contribution.js +41 -6
- package/dist/vscode/vs/workbench/contrib/files/browser/files.js +1 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/views/explorerView.js +3 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/views/explorerViewer.js +6 -2
- package/dist/vscode/vs/workbench/contrib/files/common/explorerModel.js +16 -9
- package/dist/vscode/vs/workbench/contrib/files/common/files.js +1 -6
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +200 -0
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markers.contribution.js +586 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersFilterOptions.js +75 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersModel.js +201 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersTable.js +451 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersTreeViewer.js +670 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersView.js +857 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersViewActions.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersViewActions.js +132 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/media/markers.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/messages.js +171 -0
- package/dist/vscode/vs/workbench/contrib/markers/common/markers.js +15 -1
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +135 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +421 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +55 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +334 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +606 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +36 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/utils.js +68 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +2 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +158 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser.js +6 -1
- package/dist/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookCommon.js +16 -1
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/logViewer.js +64 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/output.contribution.js +378 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/outputServices.js +39 -3
- package/dist/vscode/vs/workbench/contrib/output/browser/outputView.js +220 -0
- package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModel.js +12 -3
- package/dist/vscode/vs/workbench/contrib/output/common/outputLinkComputer.js +129 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +270 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/keybindingsEditor.js +1080 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/keybindings.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/keybindingsEditor.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/preferences.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferences.contribution.js +1154 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesActions.js +94 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesEditor.js +47 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesIcons.js +37 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesRenderers.js +731 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesSearch.js +271 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +479 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsEditor2.js +1465 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.js +506 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsLayout.js +296 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsSearchMenu.js +79 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsTree.js +1984 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +759 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsWidgets.js +1008 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/tocTree.js +196 -0
- package/dist/vscode/vs/workbench/contrib/preferences/common/preferences.js +68 -0
- package/dist/vscode/vs/workbench/contrib/preferences/common/preferencesContribution.js +157 -0
- package/dist/vscode/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +67 -0
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +16 -16
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +1 -2
- package/dist/vscode/vs/workbench/contrib/remote/browser/remoteExplorer.js +23 -2
- package/dist/vscode/vs/workbench/contrib/remote/browser/tunnelView.js +5 -5
- package/dist/vscode/vs/workbench/contrib/search/browser/media/searchview.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/patternInputWidget.js +217 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/replace.js +3 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/replaceContributions.js +7 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/replaceService.js +222 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/search.contribution.js +54 -15
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsBase.js +17 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchFindInput.js +41 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchIcons.js +35 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchMessage.js +58 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchModel.js +1842 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchNotebookHelpers.js +49 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchResultsView.js +379 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchView.js +1867 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchWidget.js +628 -0
- package/dist/vscode/vs/workbench/contrib/search/common/constants.js +30 -1
- package/dist/vscode/vs/workbench/contrib/search/common/search.js +9 -1
- package/dist/vscode/vs/workbench/contrib/search/common/searchHistoryService.js +42 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +477 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditor.js +697 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +188 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +295 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +135 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +268 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/tabCompletion.js +2 -2
- package/dist/vscode/vs/workbench/contrib/tasks/common/taskService.js +16 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +119 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/scrollbar.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/terminal.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/widgets.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/xterm.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminal.contribution.js +238 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalActions.js +1930 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalCommands.js +22 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalConfigHelper.js +213 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +17 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditor.js +186 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +199 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditorService.js +239 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalExtensions.js +22 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalGroup.js +482 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalGroupService.js +372 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalIcon.js +60 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalIcons.js +37 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalInstance.js +2123 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalInstanceService.js +79 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalMainContribution.js +82 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalMenus.js +850 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +142 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +618 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileQuickpick.js +278 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.js +417 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileService.js +213 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +144 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +267 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalService.js +1063 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalStatusList.js +108 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTabbedView.js +417 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTabsList.js +680 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTooltip.js +72 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalUri.js +39 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalView.js +535 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +36 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +469 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +97 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +56 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +416 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +390 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +587 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/environmentVariable.js +3 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/environmentVariableService.js +94 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/history.js +356 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminal.js +266 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -16
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalConfiguration.js +965 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalContextKey.js +157 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalEnvironment.js +272 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalExtensionPoints.js +27 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalStrings.js +86 -0
- package/dist/vscode/vs/workbench/contrib/terminal/electron-sandbox/terminalProfileResolverService.js +46 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/links/browser/links.js +3 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkProviderService.js +26 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix.js +3 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixService.js +143 -0
- package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput.js +85 -0
- package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.js +52 -0
- package/dist/vscode/vs/workbench/services/actions/common/menusExtensionPoint.js +14 -6
- package/dist/vscode/vs/workbench/services/assignment/common/assignmentService.js +3 -0
- package/dist/vscode/vs/workbench/services/configuration/browser/configurationService.js +13 -13
- package/dist/vscode/vs/workbench/services/configuration/common/configuration.js +2 -1
- package/dist/vscode/vs/workbench/services/configuration/common/configurationEditing.js +2 -2
- package/dist/vscode/vs/workbench/services/configuration/common/jsonEditingService.js +2 -2
- package/dist/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.js +3 -2
- package/dist/vscode/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.js +4 -0
- package/dist/vscode/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +2 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionManifestPropertiesService.js +3 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensions.js +14 -2
- package/dist/vscode/vs/workbench/services/extensions/common/extensionsApiProposals.js +10 -1
- package/dist/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +70 -3
- package/dist/vscode/vs/workbench/services/hover/browser/hoverService.js +1 -1
- package/dist/vscode/vs/workbench/services/hover/browser/hoverWidget.js +2 -1
- package/dist/vscode/vs/workbench/services/hover/browser/media/hover.css.js +1 -1
- package/dist/vscode/vs/workbench/services/keybinding/common/keybindingEditing.js +275 -0
- package/dist/vscode/vs/workbench/services/localization/common/locale.js +3 -0
- package/dist/vscode/vs/workbench/services/log/common/logConstants.js +2 -0
- package/dist/vscode/vs/workbench/services/output/common/output.js +4 -1
- package/dist/vscode/vs/workbench/services/preferences/common/preferences.js +22 -1
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesModels.js +6 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesValidation.js +37 -1
- package/dist/vscode/vs/workbench/services/remote/common/remoteAgentService.js +69 -0
- package/dist/vscode/vs/workbench/services/remote/common/remoteExplorerService.js +66 -27
- package/dist/vscode/vs/workbench/services/search/common/fileSearchManager.js +265 -0
- package/dist/vscode/vs/workbench/services/search/common/queryBuilder.js +6 -0
- package/dist/vscode/vs/workbench/services/search/common/replace.js +203 -0
- package/dist/vscode/vs/workbench/services/search/common/search.js +227 -1
- package/dist/vscode/vs/workbench/services/search/common/searchExtTypes.js +6 -0
- package/dist/vscode/vs/workbench/services/search/common/searchHelpers.js +72 -0
- package/dist/vscode/vs/workbench/services/search/common/searchService.js +355 -0
- package/dist/vscode/vs/workbench/services/search/common/textSearchManager.js +309 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/media/suggest.css.js +4 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleCompletionItem.js +10 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleCompletionModel.js +98 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +399 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +83 -0
- package/dist/vscode/vs/workbench/services/terminal/common/embedderTerminalService.js +3 -0
- package/dist/vscode/vs/workbench/services/textfile/browser/textFileService.js +1 -1
- package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModel.js +10 -3
- package/dist/vscode/vs/workbench/services/themes/browser/fileIconThemeData.js +3 -3
- package/dist/vscode/vs/workbench/services/themes/browser/productIconThemeData.js +3 -3
- package/dist/vscode/vs/workbench/services/themes/common/colorThemeData.js +3 -3
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput.js +6 -4
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorModel.js +3 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js +4 -0
- package/dist/vscode/vs/workbench/services/userActivity/common/userActivityRegistry.js +15 -0
- package/dist/vscode/vs/workbench/services/userActivity/common/userActivityService.js +37 -0
- package/dist/vscode/vs/workbench/services/userDataSync/common/userDataSync.js +7 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService.js +40 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyService.js +12 -0
- package/dist/vscode/vs/workbench/services/workspaces/common/canonicalUriService.js +19 -0
- package/dist/vscode-default-extensions/css/syntaxes/css.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/json/package.json.js +1 -1
- package/dist/vscode-default-extensions/json/syntaxes/JSONC.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/json/syntaxes/JSONL.tmLanguage.json.extensionResource.js +2 -0
- package/dist/vscode-default-extensions/latex/syntaxes/Bibtex.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/LaTeX.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/TeX.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/lua/syntaxes/lua.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/perl/package.json.js +1 -1
- package/dist/vscode-default-extensions/php/snippets/php.code-snippets.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/sql/language-configuration.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-abyss/themes/abyss-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/package.json.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/dark_modern.json.extensionResource.js +2 -0
- package/dist/vscode-default-extensions/theme-defaults/themes/dark_vs.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/hc_black.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/hc_light.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/light_modern.json.extensionResource.js +2 -0
- package/dist/vscode-default-extensions/theme-defaults/themes/light_vs.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-monokai/themes/monokai-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-quietlight/themes/quietlight-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-red/themes/Red-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-seti/icons/vs-seti-icon-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-solarized-light/themes/solarized-light-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/vb/language-configuration.json.extensionResource.js +1 -1
- package/dist/vscode-services/env.js +4 -2
- package/dist/vscode-services/extHost.js +32 -48
- package/dist/vscode-services/missing-services.js +407 -29
- package/dist/vscode-services/window.js +59 -65
- package/dist/vscode-services/workspace.js +19 -5
- package/dist/workers/outputLinkComputer.worker.d.ts +2 -0
- package/dist/workers/outputLinkComputer.worker.js +3 -0
- package/dist/workspace.d.ts +1 -1
- package/monaco-editor-treemending.patch +1305 -1184
- package/package.json +65 -19
- package/dist/activity.d.ts +0 -2802
- package/dist/collections.d.ts +0 -7
- package/dist/colorRegistry.d.ts +0 -710
- package/dist/vscode/vs/platform/product/common/product.js +0 -48
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionFollowups.js +0 -30
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionInputPart.js +0 -196
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionListRenderer.js +0 -622
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionOptions.js +0 -77
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.js +0 -311
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/media/interactiveSession.css.js +0 -4
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionContextKeys.js +0 -56
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionModel.js +0 -305
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionService.js +0 -13
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionServiceImpl.js +0 -379
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionViewModel.js +0 -207
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionWidgetHistoryService.js +0 -3
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionWordCounter.js +0 -25
- package/dist/vscode-default-extensions/theme-defaults/themes/dark_plus_experimental.json.extensionResource.js +0 -2
- package/dist/vscode-default-extensions/theme-defaults/themes/light_plus_experimental.json.extensionResource.js +0 -2
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
2
|
+
import { withNullAsUndefined } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
3
|
+
import './media/searchEditor.css.js';
|
|
4
|
+
import { isDiffEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
5
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
6
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
7
|
+
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
8
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
9
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
10
|
+
import { IViewsService } from '../../../common/views.js';
|
|
11
|
+
import { getSearchView } from '../../search/browser/searchActionsBase.js';
|
|
12
|
+
import { SearchEditorInput, getOrMakeSearchEditorInput } from './searchEditorInput.js';
|
|
13
|
+
import { serializeSearchResultForEditor } from './searchEditorSerialization.js';
|
|
14
|
+
import { IConfigurationResolverService } from '../../../services/configurationResolver/common/configurationResolver.js';
|
|
15
|
+
import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js';
|
|
16
|
+
import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from '../../../services/editor/common/editorService.js';
|
|
17
|
+
import { IHistoryService } from '../../../services/history/common/history.js';
|
|
18
|
+
const toggleSearchEditorCaseSensitiveCommand = (accessor) => {
|
|
19
|
+
const editorService = accessor.get(IEditorService);
|
|
20
|
+
const input = editorService.activeEditor;
|
|
21
|
+
if (input instanceof SearchEditorInput) {
|
|
22
|
+
editorService.activeEditorPane.toggleCaseSensitive();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const toggleSearchEditorWholeWordCommand = (accessor) => {
|
|
26
|
+
const editorService = accessor.get(IEditorService);
|
|
27
|
+
const input = editorService.activeEditor;
|
|
28
|
+
if (input instanceof SearchEditorInput) {
|
|
29
|
+
editorService.activeEditorPane.toggleWholeWords();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const toggleSearchEditorRegexCommand = (accessor) => {
|
|
33
|
+
const editorService = accessor.get(IEditorService);
|
|
34
|
+
const input = editorService.activeEditor;
|
|
35
|
+
if (input instanceof SearchEditorInput) {
|
|
36
|
+
editorService.activeEditorPane.toggleRegex();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const toggleSearchEditorContextLinesCommand = (accessor) => {
|
|
40
|
+
const editorService = accessor.get(IEditorService);
|
|
41
|
+
const input = editorService.activeEditor;
|
|
42
|
+
if (input instanceof SearchEditorInput) {
|
|
43
|
+
editorService.activeEditorPane.toggleContextLines();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const modifySearchEditorContextLinesCommand = (accessor, increase) => {
|
|
47
|
+
const editorService = accessor.get(IEditorService);
|
|
48
|
+
const input = editorService.activeEditor;
|
|
49
|
+
if (input instanceof SearchEditorInput) {
|
|
50
|
+
editorService.activeEditorPane.modifyContextLines(increase);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const selectAllSearchEditorMatchesCommand = (accessor) => {
|
|
54
|
+
const editorService = accessor.get(IEditorService);
|
|
55
|
+
const input = editorService.activeEditor;
|
|
56
|
+
if (input instanceof SearchEditorInput) {
|
|
57
|
+
editorService.activeEditorPane.focusAllResults();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
async function openSearchEditor(accessor) {
|
|
61
|
+
const viewsService = accessor.get(IViewsService);
|
|
62
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
63
|
+
const searchView = getSearchView(viewsService);
|
|
64
|
+
if (searchView) {
|
|
65
|
+
await instantiationService.invokeFunction(openNewSearchEditor, {
|
|
66
|
+
filesToInclude: searchView.searchIncludePattern.getValue(),
|
|
67
|
+
onlyOpenEditors: searchView.searchIncludePattern.onlySearchInOpenEditors(),
|
|
68
|
+
filesToExclude: searchView.searchExcludePattern.getValue(),
|
|
69
|
+
isRegexp: searchView.searchAndReplaceWidget.searchInput?.getRegex(),
|
|
70
|
+
isCaseSensitive: searchView.searchAndReplaceWidget.searchInput?.getCaseSensitive(),
|
|
71
|
+
matchWholeWord: searchView.searchAndReplaceWidget.searchInput?.getWholeWords(),
|
|
72
|
+
useExcludeSettingsAndIgnoreFiles: searchView.searchExcludePattern.useExcludesAndIgnoreFiles(),
|
|
73
|
+
showIncludesExcludes: !!(searchView.searchIncludePattern.getValue() || searchView.searchExcludePattern.getValue() || !searchView.searchExcludePattern.useExcludesAndIgnoreFiles())
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
await instantiationService.invokeFunction(openNewSearchEditor);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const openNewSearchEditor = async (accessor, _args = {}, toSide = false) => {
|
|
81
|
+
const editorService = accessor.get(IEditorService);
|
|
82
|
+
const editorGroupsService = accessor.get(IEditorGroupsService);
|
|
83
|
+
const telemetryService = accessor.get(ITelemetryService);
|
|
84
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
85
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
86
|
+
const configurationResolverService = accessor.get(IConfigurationResolverService);
|
|
87
|
+
const workspaceContextService = accessor.get(IWorkspaceContextService);
|
|
88
|
+
const historyService = accessor.get(IHistoryService);
|
|
89
|
+
const activeWorkspaceRootUri = historyService.getLastActiveWorkspaceRoot(Schemas.file);
|
|
90
|
+
const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? withNullAsUndefined(workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri)) : undefined;
|
|
91
|
+
const activeEditorControl = editorService.activeTextEditorControl;
|
|
92
|
+
let activeModel;
|
|
93
|
+
let selected = '';
|
|
94
|
+
if (activeEditorControl) {
|
|
95
|
+
if (isDiffEditor(activeEditorControl)) {
|
|
96
|
+
if (activeEditorControl.getOriginalEditor().hasTextFocus()) {
|
|
97
|
+
activeModel = activeEditorControl.getOriginalEditor();
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
activeModel = activeEditorControl.getModifiedEditor();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
activeModel = activeEditorControl;
|
|
105
|
+
}
|
|
106
|
+
const selection = activeModel?.getSelection();
|
|
107
|
+
selected = (selection && activeModel?.getModel()?.getValueInRange(selection)) ?? '';
|
|
108
|
+
if (selection?.isEmpty() && configurationService.getValue('search').seedWithNearestWord) {
|
|
109
|
+
const wordAtPosition = activeModel.getModel()?.getWordAtPosition(selection.getStartPosition());
|
|
110
|
+
if (wordAtPosition) {
|
|
111
|
+
selected = wordAtPosition.word;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
if (editorService.activeEditor instanceof SearchEditorInput) {
|
|
117
|
+
const active = editorService.activeEditorPane;
|
|
118
|
+
selected = active.getSelected();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
telemetryService.publicLog2('searchEditor/openNewSearchEditor');
|
|
122
|
+
const seedSearchStringFromSelection = _args.location === 'new' || configurationService.getValue('editor').find.seedSearchStringFromSelection;
|
|
123
|
+
const args = { query: seedSearchStringFromSelection ? selected : undefined };
|
|
124
|
+
for (const entry of Object.entries(_args)) {
|
|
125
|
+
const name = entry[0];
|
|
126
|
+
const value = entry[1];
|
|
127
|
+
if (value !== undefined) {
|
|
128
|
+
args[name] = (typeof value === 'string') ? await configurationResolverService.resolveAsync(lastActiveWorkspaceRoot, value) : value;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const existing = editorService.getEditors(0 ).find(id => id.editor.typeId === SearchEditorInput.ID);
|
|
132
|
+
let editor;
|
|
133
|
+
if (existing && args.location === 'reuse') {
|
|
134
|
+
const group = editorGroupsService.getGroup(existing.groupId);
|
|
135
|
+
if (!group) {
|
|
136
|
+
throw new Error('Invalid group id for search editor');
|
|
137
|
+
}
|
|
138
|
+
const input = existing.editor;
|
|
139
|
+
editor = (await group.openEditor(input));
|
|
140
|
+
if (selected) {
|
|
141
|
+
editor.setQuery(selected);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
editor.selectQuery();
|
|
145
|
+
}
|
|
146
|
+
editor.setSearchConfig(args);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
const input = instantiationService.invokeFunction(getOrMakeSearchEditorInput, { config: args, resultsContents: '', from: 'rawData' });
|
|
150
|
+
editor = await editorService.openEditor(input, { pinned: true }, toSide ? SIDE_GROUP : ACTIVE_GROUP);
|
|
151
|
+
}
|
|
152
|
+
const searchOnType = configurationService.getValue('search').searchOnType;
|
|
153
|
+
if (args.triggerSearch === true ||
|
|
154
|
+
args.triggerSearch !== false && searchOnType && args.query) {
|
|
155
|
+
editor.triggerSearch({ focusResults: args.focusResults });
|
|
156
|
+
}
|
|
157
|
+
if (!args.focusResults) {
|
|
158
|
+
editor.focusSearchInput();
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const createEditorFromSearchResult = async (accessor, searchResult, rawIncludePattern, rawExcludePattern, onlySearchInOpenEditors) => {
|
|
162
|
+
if (!searchResult.query) {
|
|
163
|
+
console.error('Expected searchResult.query to be defined. Got', searchResult);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const editorService = accessor.get(IEditorService);
|
|
167
|
+
const telemetryService = accessor.get(ITelemetryService);
|
|
168
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
169
|
+
const labelService = accessor.get(ILabelService);
|
|
170
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
171
|
+
const sortOrder = configurationService.getValue('search').sortOrder;
|
|
172
|
+
telemetryService.publicLog2('searchEditor/createEditorFromSearchResult');
|
|
173
|
+
const labelFormatter = (uri) => labelService.getUriLabel(uri, { relative: true });
|
|
174
|
+
const { text, matchRanges, config } = serializeSearchResultForEditor(searchResult, rawIncludePattern, rawExcludePattern, 0, labelFormatter, sortOrder);
|
|
175
|
+
config.onlyOpenEditors = onlySearchInOpenEditors;
|
|
176
|
+
const contextLines = configurationService.getValue('search').searchEditor.defaultNumberOfContextLines;
|
|
177
|
+
if (searchResult.isDirty || contextLines === 0 || contextLines === null) {
|
|
178
|
+
const input = instantiationService.invokeFunction(getOrMakeSearchEditorInput, { resultsContents: text, config, from: 'rawData' });
|
|
179
|
+
await editorService.openEditor(input, { pinned: true });
|
|
180
|
+
input.setMatchRanges(matchRanges);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
const input = instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'rawData', resultsContents: '', config: { ...config, contextLines } });
|
|
184
|
+
const editor = await editorService.openEditor(input, { pinned: true });
|
|
185
|
+
editor.triggerSearch({ focusResults: true });
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
export { createEditorFromSearchResult, modifySearchEditorContextLinesCommand, openNewSearchEditor, openSearchEditor, selectAllSearchEditorMatchesCommand, toggleSearchEditorCaseSensitiveCommand, toggleSearchEditorContextLinesCommand, toggleSearchEditorRegexCommand, toggleSearchEditorWholeWordCommand };
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import './media/searchEditor.css.js';
|
|
3
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
4
|
+
import { basename } from 'monaco-editor/esm/vs/base/common/path.js';
|
|
5
|
+
import { isEqual, extname, joinPath } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
6
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
7
|
+
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
8
|
+
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
9
|
+
import { IFileDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
|
|
10
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
11
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
12
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
13
|
+
import { EditorResourceAccessor } from '../../../common/editor.js';
|
|
14
|
+
import { Memento } from '../../../common/memento.js';
|
|
15
|
+
import { SearchEditorInputTypeId, SearchEditorScheme, SearchEditorWorkingCopyTypeId, SearchEditorFindMatchClass } from './constants.js';
|
|
16
|
+
import { SearchEditorModel, searchEditorModelFactory } from './searchEditorModel.js';
|
|
17
|
+
import { serializeSearchConfiguration, parseSavedSearchEditor, defaultSearchConfig } from './searchEditorSerialization.js';
|
|
18
|
+
import { IPathService } from '../../../services/path/common/pathService.js';
|
|
19
|
+
import { ITextFileService } from '../../../services/textfile/common/textfiles.js';
|
|
20
|
+
import { IWorkingCopyService } from '../../../services/workingCopy/common/workingCopyService.js';
|
|
21
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
22
|
+
import { bufferToReadable, VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
23
|
+
import { EditorInput } from '../../../common/editor/editorInput.js';
|
|
24
|
+
const SEARCH_EDITOR_EXT = '.code-search';
|
|
25
|
+
let SearchEditorInput = class SearchEditorInput extends EditorInput {
|
|
26
|
+
get typeId() {
|
|
27
|
+
return SearchEditorInput.ID;
|
|
28
|
+
}
|
|
29
|
+
get editorId() {
|
|
30
|
+
return this.typeId;
|
|
31
|
+
}
|
|
32
|
+
get capabilities() {
|
|
33
|
+
let capabilities = 8 ;
|
|
34
|
+
if (!this.backingUri) {
|
|
35
|
+
capabilities |= 4 ;
|
|
36
|
+
}
|
|
37
|
+
return capabilities;
|
|
38
|
+
}
|
|
39
|
+
get resource() {
|
|
40
|
+
return this.backingUri || this.modelUri;
|
|
41
|
+
}
|
|
42
|
+
constructor(modelUri, backingUri, modelService, textFileService, fileDialogService, instantiationService, workingCopyService, telemetryService, pathService, storageService) {
|
|
43
|
+
super();
|
|
44
|
+
this.modelUri = modelUri;
|
|
45
|
+
this.backingUri = backingUri;
|
|
46
|
+
this.modelService = modelService;
|
|
47
|
+
this.textFileService = textFileService;
|
|
48
|
+
this.fileDialogService = fileDialogService;
|
|
49
|
+
this.instantiationService = instantiationService;
|
|
50
|
+
this.workingCopyService = workingCopyService;
|
|
51
|
+
this.telemetryService = telemetryService;
|
|
52
|
+
this.pathService = pathService;
|
|
53
|
+
this.dirty = false;
|
|
54
|
+
this._onDidChangeContent = this._register(( new Emitter()));
|
|
55
|
+
this.onDidChangeContent = this._onDidChangeContent.event;
|
|
56
|
+
this._onDidSave = this._register(( new Emitter()));
|
|
57
|
+
this.onDidSave = this._onDidSave.event;
|
|
58
|
+
this.oldDecorationsIDs = [];
|
|
59
|
+
this.model = instantiationService.createInstance(SearchEditorModel, modelUri);
|
|
60
|
+
if (this.modelUri.scheme !== SearchEditorScheme) {
|
|
61
|
+
throw Error('SearchEditorInput must be invoked with a SearchEditorScheme uri');
|
|
62
|
+
}
|
|
63
|
+
this.memento = ( new Memento(SearchEditorInput.ID, storageService));
|
|
64
|
+
storageService.onWillSaveState(() => this.memento.saveMemento());
|
|
65
|
+
const input = this;
|
|
66
|
+
const workingCopyAdapter = new (class {
|
|
67
|
+
constructor() {
|
|
68
|
+
this.typeId = SearchEditorWorkingCopyTypeId;
|
|
69
|
+
this.resource = input.modelUri;
|
|
70
|
+
this.capabilities = input.hasCapability(4 ) ? 2 : 0 ;
|
|
71
|
+
this.onDidChangeDirty = input.onDidChangeDirty;
|
|
72
|
+
this.onDidChangeContent = input.onDidChangeContent;
|
|
73
|
+
this.onDidSave = input.onDidSave;
|
|
74
|
+
}
|
|
75
|
+
get name() { return input.getName(); }
|
|
76
|
+
isDirty() { return input.isDirty(); }
|
|
77
|
+
isModified() { return input.isDirty(); }
|
|
78
|
+
backup(token) { return input.backup(token); }
|
|
79
|
+
save(options) { return input.save(0, options).then(editor => !!editor); }
|
|
80
|
+
revert(options) { return input.revert(0, options); }
|
|
81
|
+
});
|
|
82
|
+
this._register(this.workingCopyService.registerWorkingCopy(workingCopyAdapter));
|
|
83
|
+
}
|
|
84
|
+
async save(group, options) {
|
|
85
|
+
if (((await this.resolveModels()).resultsModel).isDisposed()) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (this.backingUri) {
|
|
89
|
+
await this.textFileService.write(this.backingUri, await this.serializeForDisk(), options);
|
|
90
|
+
this.setDirty(false);
|
|
91
|
+
this._onDidSave.fire({ reason: options?.reason, source: options?.source });
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return this.saveAs(group, options);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
tryReadConfigSync() {
|
|
99
|
+
return this._cachedConfigurationModel?.config;
|
|
100
|
+
}
|
|
101
|
+
async serializeForDisk() {
|
|
102
|
+
const { configurationModel, resultsModel } = await this.resolveModels();
|
|
103
|
+
return serializeSearchConfiguration(configurationModel.config) + '\n' + resultsModel.getValue();
|
|
104
|
+
}
|
|
105
|
+
registerConfigChangeListeners(model) {
|
|
106
|
+
this.configChangeListenerDisposable?.dispose();
|
|
107
|
+
if (!this.isDisposed()) {
|
|
108
|
+
this.configChangeListenerDisposable = model.onConfigDidUpdate(() => {
|
|
109
|
+
if (this.lastLabel !== this.getName()) {
|
|
110
|
+
this._onDidChangeLabel.fire();
|
|
111
|
+
this.lastLabel = this.getName();
|
|
112
|
+
}
|
|
113
|
+
this.memento.getMemento(1 , 1 ).searchConfig = model.config;
|
|
114
|
+
});
|
|
115
|
+
this._register(this.configChangeListenerDisposable);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async resolveModels() {
|
|
119
|
+
return this.model.resolve().then(data => {
|
|
120
|
+
this._cachedResultsModel = data.resultsModel;
|
|
121
|
+
this._cachedConfigurationModel = data.configurationModel;
|
|
122
|
+
if (this.lastLabel !== this.getName()) {
|
|
123
|
+
this._onDidChangeLabel.fire();
|
|
124
|
+
this.lastLabel = this.getName();
|
|
125
|
+
}
|
|
126
|
+
this.registerConfigChangeListeners(data.configurationModel);
|
|
127
|
+
return data;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
async saveAs(group, options) {
|
|
131
|
+
const path = await this.fileDialogService.pickFileToSave(await this.suggestFileName(), options?.availableFileSystems);
|
|
132
|
+
if (path) {
|
|
133
|
+
this.telemetryService.publicLog2('searchEditor/saveSearchResults');
|
|
134
|
+
const toWrite = await this.serializeForDisk();
|
|
135
|
+
if (await this.textFileService.create([{ resource: path, value: toWrite, options: { overwrite: true } }])) {
|
|
136
|
+
this.setDirty(false);
|
|
137
|
+
if (!isEqual(path, this.modelUri)) {
|
|
138
|
+
const input = this.instantiationService.invokeFunction(getOrMakeSearchEditorInput, { fileUri: path, from: 'existingFile' });
|
|
139
|
+
input.setMatchRanges(this.getMatchRanges());
|
|
140
|
+
return input;
|
|
141
|
+
}
|
|
142
|
+
return this;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
getName(maxLength = 12) {
|
|
148
|
+
const trimToMax = (label) => (label.length < maxLength ? label : `${label.slice(0, maxLength - 3)}...`);
|
|
149
|
+
if (this.backingUri) {
|
|
150
|
+
const originalURI = EditorResourceAccessor.getOriginalUri(this);
|
|
151
|
+
return ( localize(
|
|
152
|
+
'searchTitle.withQuery',
|
|
153
|
+
"Search: {0}",
|
|
154
|
+
basename((originalURI ?? this.backingUri).path, SEARCH_EDITOR_EXT)
|
|
155
|
+
));
|
|
156
|
+
}
|
|
157
|
+
const query = this._cachedConfigurationModel?.config?.query?.trim();
|
|
158
|
+
if (query) {
|
|
159
|
+
return ( localize('searchTitle.withQuery', "Search: {0}", trimToMax(query)));
|
|
160
|
+
}
|
|
161
|
+
return ( localize('searchTitle', "Search"));
|
|
162
|
+
}
|
|
163
|
+
setDirty(dirty) {
|
|
164
|
+
const wasDirty = this.dirty;
|
|
165
|
+
this.dirty = dirty;
|
|
166
|
+
if (wasDirty !== dirty) {
|
|
167
|
+
this._onDidChangeDirty.fire();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
isDirty() {
|
|
171
|
+
return this.dirty;
|
|
172
|
+
}
|
|
173
|
+
async rename(group, target) {
|
|
174
|
+
if (extname(target) === SEARCH_EDITOR_EXT) {
|
|
175
|
+
return {
|
|
176
|
+
editor: this.instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'existingFile', fileUri: target })
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
181
|
+
dispose() {
|
|
182
|
+
this.modelService.destroyModel(this.modelUri);
|
|
183
|
+
super.dispose();
|
|
184
|
+
}
|
|
185
|
+
matches(other) {
|
|
186
|
+
if (super.matches(other)) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
if (other instanceof SearchEditorInput) {
|
|
190
|
+
return !!(other.modelUri.fragment && other.modelUri.fragment === this.modelUri.fragment) || !!(other.backingUri && isEqual(other.backingUri, this.backingUri));
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
getMatchRanges() {
|
|
195
|
+
return ( (this._cachedResultsModel?.getAllDecorations() ?? [])
|
|
196
|
+
.filter(decoration => decoration.options.className === SearchEditorFindMatchClass)
|
|
197
|
+
.filter(({ range }) => !(range.startColumn === 1 && range.endColumn === 1))
|
|
198
|
+
.map(({ range }) => range));
|
|
199
|
+
}
|
|
200
|
+
async setMatchRanges(ranges) {
|
|
201
|
+
this.oldDecorationsIDs = (await this.resolveModels()).resultsModel.deltaDecorations(this.oldDecorationsIDs, ( ranges.map(
|
|
202
|
+
range => ({ range, options: { description: 'search-editor-find-match', className: SearchEditorFindMatchClass, stickiness: 1 } })
|
|
203
|
+
)));
|
|
204
|
+
}
|
|
205
|
+
async revert(group, options) {
|
|
206
|
+
if (options?.soft) {
|
|
207
|
+
this.setDirty(false);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (this.backingUri) {
|
|
211
|
+
const { config, text } = await this.instantiationService.invokeFunction(parseSavedSearchEditor, this.backingUri);
|
|
212
|
+
const { resultsModel, configurationModel } = await this.resolveModels();
|
|
213
|
+
resultsModel.setValue(text);
|
|
214
|
+
configurationModel.updateConfig(config);
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
(await this.resolveModels()).resultsModel.setValue('');
|
|
218
|
+
}
|
|
219
|
+
super.revert(group, options);
|
|
220
|
+
this.setDirty(false);
|
|
221
|
+
}
|
|
222
|
+
async backup(token) {
|
|
223
|
+
const contents = await this.serializeForDisk();
|
|
224
|
+
if (token.isCancellationRequested) {
|
|
225
|
+
return {};
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
content: bufferToReadable(VSBuffer.fromString(contents))
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
async suggestFileName() {
|
|
232
|
+
const query = (await this.resolveModels()).configurationModel.config.query;
|
|
233
|
+
const searchFileName = (query.replace(/[^\w \-_]+/g, '_') || 'Search') + SEARCH_EDITOR_EXT;
|
|
234
|
+
return joinPath(await this.fileDialogService.defaultFilePath(this.pathService.defaultUriScheme), searchFileName);
|
|
235
|
+
}
|
|
236
|
+
toUntyped() {
|
|
237
|
+
if (this.hasCapability(4 )) {
|
|
238
|
+
return undefined;
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
resource: this.resource,
|
|
242
|
+
options: {
|
|
243
|
+
override: SearchEditorInput.ID
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
SearchEditorInput.ID = SearchEditorInputTypeId;
|
|
249
|
+
SearchEditorInput = ( __decorate([
|
|
250
|
+
( __param(2, IModelService)),
|
|
251
|
+
( __param(3, ITextFileService)),
|
|
252
|
+
( __param(4, IFileDialogService)),
|
|
253
|
+
( __param(5, IInstantiationService)),
|
|
254
|
+
( __param(6, IWorkingCopyService)),
|
|
255
|
+
( __param(7, ITelemetryService)),
|
|
256
|
+
( __param(8, IPathService)),
|
|
257
|
+
( __param(9, IStorageService))
|
|
258
|
+
], SearchEditorInput));
|
|
259
|
+
const getOrMakeSearchEditorInput = (accessor, existingData) => {
|
|
260
|
+
const storageService = accessor.get(IStorageService);
|
|
261
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
262
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
263
|
+
const modelUri = existingData.from === 'model' ? existingData.modelUri : ( URI.from({ scheme: SearchEditorScheme, fragment: `${Math.random()}` }));
|
|
264
|
+
if (!( searchEditorModelFactory.models.has(modelUri))) {
|
|
265
|
+
if (existingData.from === 'existingFile') {
|
|
266
|
+
instantiationService.invokeFunction(accessor => searchEditorModelFactory.initializeModelFromExistingFile(accessor, modelUri, existingData.fileUri));
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
const searchEditorSettings = configurationService.getValue('search').searchEditor;
|
|
270
|
+
const reuseOldSettings = searchEditorSettings.reusePriorSearchConfiguration;
|
|
271
|
+
const defaultNumberOfContextLines = searchEditorSettings.defaultNumberOfContextLines;
|
|
272
|
+
const priorConfig = reuseOldSettings ? ( new Memento(SearchEditorInput.ID, storageService)).getMemento(1 , 1 ).searchConfig : {};
|
|
273
|
+
const defaultConfig = defaultSearchConfig();
|
|
274
|
+
const config = { ...defaultConfig, ...priorConfig, ...existingData.config };
|
|
275
|
+
if (defaultNumberOfContextLines !== null && defaultNumberOfContextLines !== undefined) {
|
|
276
|
+
config.contextLines = existingData?.config?.contextLines ?? defaultNumberOfContextLines;
|
|
277
|
+
}
|
|
278
|
+
if (existingData.from === 'rawData') {
|
|
279
|
+
if (existingData.resultsContents) {
|
|
280
|
+
config.contextLines = 0;
|
|
281
|
+
}
|
|
282
|
+
instantiationService.invokeFunction(accessor => searchEditorModelFactory.initializeModelFromRawData(accessor, modelUri, config, existingData.resultsContents));
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
instantiationService.invokeFunction(accessor => searchEditorModelFactory.initializeModelFromExistingModel(accessor, modelUri, config));
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return instantiationService.createInstance(SearchEditorInput, modelUri, existingData.from === 'existingFile'
|
|
290
|
+
? existingData.fileUri
|
|
291
|
+
: existingData.from === 'model'
|
|
292
|
+
? existingData.backupOf
|
|
293
|
+
: undefined);
|
|
294
|
+
};
|
|
295
|
+
export { SEARCH_EDITOR_EXT, SearchEditorInput, getOrMakeSearchEditorInput };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
2
|
+
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
3
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
4
|
+
import { parseSavedSearchEditor, parseSerializedSearchEditor } from './searchEditorSerialization.js';
|
|
5
|
+
import { IWorkingCopyBackupService } from '../../../services/workingCopy/common/workingCopyBackup.js';
|
|
6
|
+
import { assertIsDefined } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
7
|
+
import { createTextBufferFactoryFromStream } from 'monaco-editor/esm/vs/editor/common/model/textModel.js';
|
|
8
|
+
import { SearchEditorWorkingCopyTypeId } from './constants.js';
|
|
9
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
10
|
+
import { ResourceMap } from 'monaco-editor/esm/vs/base/common/map.js';
|
|
11
|
+
class SearchConfigurationModel {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
this._onConfigDidUpdate = ( new Emitter());
|
|
15
|
+
this.onConfigDidUpdate = this._onConfigDidUpdate.event;
|
|
16
|
+
}
|
|
17
|
+
updateConfig(config) { this.config = config; this._onConfigDidUpdate.fire(config); }
|
|
18
|
+
}
|
|
19
|
+
class SearchEditorModel {
|
|
20
|
+
constructor(resource) {
|
|
21
|
+
this.resource = resource;
|
|
22
|
+
}
|
|
23
|
+
async resolve() {
|
|
24
|
+
return assertIsDefined(searchEditorModelFactory.models.get(this.resource)).resolve();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
class SearchEditorModelFactory {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.models = ( new ResourceMap());
|
|
30
|
+
}
|
|
31
|
+
initializeModelFromExistingModel(accessor, resource, config) {
|
|
32
|
+
if (( this.models.has(resource))) {
|
|
33
|
+
throw Error('Unable to contruct model for resource that already exists');
|
|
34
|
+
}
|
|
35
|
+
const languageService = accessor.get(ILanguageService);
|
|
36
|
+
const modelService = accessor.get(IModelService);
|
|
37
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
38
|
+
const workingCopyBackupService = accessor.get(IWorkingCopyBackupService);
|
|
39
|
+
let ongoingResolve;
|
|
40
|
+
this.models.set(resource, {
|
|
41
|
+
resolve: () => {
|
|
42
|
+
if (!ongoingResolve) {
|
|
43
|
+
ongoingResolve = (async () => {
|
|
44
|
+
const backup = await this.tryFetchModelFromBackupService(resource, languageService, modelService, workingCopyBackupService, instantiationService);
|
|
45
|
+
if (backup) {
|
|
46
|
+
return backup;
|
|
47
|
+
}
|
|
48
|
+
return Promise.resolve({
|
|
49
|
+
resultsModel: modelService.getModel(resource) ?? modelService.createModel('', languageService.createById('search-result'), resource),
|
|
50
|
+
configurationModel: ( new SearchConfigurationModel(config))
|
|
51
|
+
});
|
|
52
|
+
})();
|
|
53
|
+
}
|
|
54
|
+
return ongoingResolve;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
initializeModelFromRawData(accessor, resource, config, contents) {
|
|
59
|
+
if (( this.models.has(resource))) {
|
|
60
|
+
throw Error('Unable to contruct model for resource that already exists');
|
|
61
|
+
}
|
|
62
|
+
const languageService = accessor.get(ILanguageService);
|
|
63
|
+
const modelService = accessor.get(IModelService);
|
|
64
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
65
|
+
const workingCopyBackupService = accessor.get(IWorkingCopyBackupService);
|
|
66
|
+
let ongoingResolve;
|
|
67
|
+
this.models.set(resource, {
|
|
68
|
+
resolve: () => {
|
|
69
|
+
if (!ongoingResolve) {
|
|
70
|
+
ongoingResolve = (async () => {
|
|
71
|
+
const backup = await this.tryFetchModelFromBackupService(resource, languageService, modelService, workingCopyBackupService, instantiationService);
|
|
72
|
+
if (backup) {
|
|
73
|
+
return backup;
|
|
74
|
+
}
|
|
75
|
+
return Promise.resolve({
|
|
76
|
+
resultsModel: modelService.createModel(contents ?? '', languageService.createById('search-result'), resource),
|
|
77
|
+
configurationModel: ( new SearchConfigurationModel(config))
|
|
78
|
+
});
|
|
79
|
+
})();
|
|
80
|
+
}
|
|
81
|
+
return ongoingResolve;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
initializeModelFromExistingFile(accessor, resource, existingFile) {
|
|
86
|
+
if (( this.models.has(resource))) {
|
|
87
|
+
throw Error('Unable to contruct model for resource that already exists');
|
|
88
|
+
}
|
|
89
|
+
const languageService = accessor.get(ILanguageService);
|
|
90
|
+
const modelService = accessor.get(IModelService);
|
|
91
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
92
|
+
const workingCopyBackupService = accessor.get(IWorkingCopyBackupService);
|
|
93
|
+
let ongoingResolve;
|
|
94
|
+
this.models.set(resource, {
|
|
95
|
+
resolve: async () => {
|
|
96
|
+
if (!ongoingResolve) {
|
|
97
|
+
ongoingResolve = (async () => {
|
|
98
|
+
const backup = await this.tryFetchModelFromBackupService(resource, languageService, modelService, workingCopyBackupService, instantiationService);
|
|
99
|
+
if (backup) {
|
|
100
|
+
return backup;
|
|
101
|
+
}
|
|
102
|
+
const { text, config } = await instantiationService.invokeFunction(parseSavedSearchEditor, existingFile);
|
|
103
|
+
return ({
|
|
104
|
+
resultsModel: modelService.createModel(text ?? '', languageService.createById('search-result'), resource),
|
|
105
|
+
configurationModel: ( new SearchConfigurationModel(config))
|
|
106
|
+
});
|
|
107
|
+
})();
|
|
108
|
+
}
|
|
109
|
+
return ongoingResolve;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
async tryFetchModelFromBackupService(resource, languageService, modelService, workingCopyBackupService, instantiationService) {
|
|
114
|
+
const backup = await workingCopyBackupService.resolve({ resource, typeId: SearchEditorWorkingCopyTypeId });
|
|
115
|
+
let model = modelService.getModel(resource);
|
|
116
|
+
if (!model && backup) {
|
|
117
|
+
const factory = await createTextBufferFactoryFromStream(backup.value);
|
|
118
|
+
model = modelService.createModel(factory, languageService.createById('search-result'), resource);
|
|
119
|
+
}
|
|
120
|
+
if (model) {
|
|
121
|
+
const existingFile = model.getValue();
|
|
122
|
+
const { text, config } = parseSerializedSearchEditor(existingFile);
|
|
123
|
+
modelService.destroyModel(resource);
|
|
124
|
+
return ({
|
|
125
|
+
resultsModel: modelService.createModel(text ?? '', languageService.createById('search-result'), resource),
|
|
126
|
+
configurationModel: ( new SearchConfigurationModel(config))
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const searchEditorModelFactory = ( new SearchEditorModelFactory());
|
|
135
|
+
export { SearchConfigurationModel, SearchEditorModel, searchEditorModelFactory };
|