@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
|
@@ -28,6 +28,12 @@ var TunnelType;
|
|
|
28
28
|
TunnelType["Forwarded"] = "Forwarded";
|
|
29
29
|
TunnelType["Add"] = "Add";
|
|
30
30
|
})(TunnelType || (TunnelType = {}))));
|
|
31
|
+
var TunnelCloseReason;
|
|
32
|
+
( ((function(TunnelCloseReason) {
|
|
33
|
+
TunnelCloseReason["Other"] = "Other";
|
|
34
|
+
TunnelCloseReason["User"] = "User";
|
|
35
|
+
TunnelCloseReason["AutoForwardEnd"] = "AutoForwardEnd";
|
|
36
|
+
})(TunnelCloseReason || (TunnelCloseReason = {}))));
|
|
31
37
|
var TunnelEditId;
|
|
32
38
|
( ((function(TunnelEditId) {
|
|
33
39
|
TunnelEditId[TunnelEditId["None"] = 0] = "None";
|
|
@@ -324,6 +330,7 @@ let TunnelModel = class TunnelModel extends Disposable {
|
|
|
324
330
|
this.onEnvironmentTunnelsSet = this._onEnvironmentTunnelsSet.event;
|
|
325
331
|
this._environmentTunnelsSet = false;
|
|
326
332
|
this.unrestoredExtensionTunnels = ( (new Map()));
|
|
333
|
+
this.sessionCachedProperties = ( (new Map()));
|
|
327
334
|
this.portAttributesProviders = [];
|
|
328
335
|
this.mismatchCooldown = ( (new Date()));
|
|
329
336
|
this.configPortsAttributes = ( (new PortsAttributes(configurationService)));
|
|
@@ -385,10 +392,10 @@ let TunnelModel = class TunnelModel extends Disposable {
|
|
|
385
392
|
this._onForwardPort.fire(this.forwarded.get(key));
|
|
386
393
|
}));
|
|
387
394
|
this._register(this.tunnelService.onTunnelClosed(address => {
|
|
388
|
-
return this.onTunnelClosed(address);
|
|
395
|
+
return this.onTunnelClosed(address, TunnelCloseReason.Other);
|
|
389
396
|
}));
|
|
390
397
|
}
|
|
391
|
-
async onTunnelClosed(address) {
|
|
398
|
+
async onTunnelClosed(address, reason) {
|
|
392
399
|
const key = makeAddress(address.host, address.port);
|
|
393
400
|
if (( (this.forwarded.has(key)))) {
|
|
394
401
|
this.forwarded.delete(key);
|
|
@@ -509,7 +516,8 @@ let TunnelModel = class TunnelModel extends Disposable {
|
|
|
509
516
|
} : undefined;
|
|
510
517
|
const key = makeAddress(tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
511
518
|
this.inProgress.set(key, true);
|
|
512
|
-
|
|
519
|
+
tunnelProperties = this.mergeCachedAndUnrestoredProperties(key, tunnelProperties);
|
|
520
|
+
const tunnel = await this.tunnelService.openTunnel(addressProvider, tunnelProperties.remote.host, tunnelProperties.remote.port, undefined, localPort, (!tunnelProperties.elevateIfNeeded) ? attributes?.elevateIfNeeded : tunnelProperties.elevateIfNeeded, tunnelProperties.privacy, attributes?.protocol);
|
|
513
521
|
if (tunnel && tunnel.localAddress) {
|
|
514
522
|
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
515
523
|
const protocol = (tunnel.protocol ?
|
|
@@ -536,37 +544,59 @@ let TunnelModel = class TunnelModel extends Disposable {
|
|
|
536
544
|
await this.storeForwarded();
|
|
537
545
|
await this.showPortMismatchModalIfNeeded(tunnel, localPort, attributes);
|
|
538
546
|
this._onForwardPort.fire(newForward);
|
|
539
|
-
if (( (this.unrestoredExtensionTunnels.has(key)))) {
|
|
540
|
-
const updateProps = this.unrestoredExtensionTunnels.get(key);
|
|
541
|
-
this.unrestoredExtensionTunnels.delete(key);
|
|
542
|
-
if (updateProps) {
|
|
543
|
-
tunnel = await this.forward({
|
|
544
|
-
remote: { host: newForward.remoteHost, port: newForward.remotePort },
|
|
545
|
-
local: newForward.localPort,
|
|
546
|
-
name: newForward.name,
|
|
547
|
-
privacy: updateProps.privacy,
|
|
548
|
-
elevateIfNeeded: true,
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
547
|
return tunnel;
|
|
553
548
|
}
|
|
554
549
|
this.inProgress.delete(key);
|
|
555
550
|
}
|
|
556
551
|
else {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
552
|
+
return this.mergeAttributesIntoExistingTunnel(existingTunnel, tunnelProperties, attributes);
|
|
553
|
+
}
|
|
554
|
+
return undefined;
|
|
555
|
+
}
|
|
556
|
+
mergeCachedAndUnrestoredProperties(key, tunnelProperties) {
|
|
557
|
+
const map = ( (this.unrestoredExtensionTunnels.has(key))) ? this.unrestoredExtensionTunnels : (( (this.sessionCachedProperties.has(key))) ? this.sessionCachedProperties : undefined);
|
|
558
|
+
if (map) {
|
|
559
|
+
const updateProps = map.get(key);
|
|
560
|
+
map.delete(key);
|
|
561
|
+
if (updateProps) {
|
|
562
|
+
tunnelProperties.name = updateProps.name ?? tunnelProperties.name;
|
|
563
|
+
tunnelProperties.local = (('local' in updateProps) ? updateProps.local : (('localPort' in updateProps) ? updateProps.localPort : undefined)) ?? tunnelProperties.local;
|
|
564
|
+
tunnelProperties.privacy = updateProps.privacy ?? tunnelProperties.privacy;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return tunnelProperties;
|
|
568
|
+
}
|
|
569
|
+
async mergeAttributesIntoExistingTunnel(existingTunnel, tunnelProperties, attributes) {
|
|
570
|
+
const newName = attributes?.label ?? tunnelProperties.name;
|
|
571
|
+
let MergedAttributeAction;
|
|
572
|
+
( ((function(MergedAttributeAction) {
|
|
573
|
+
MergedAttributeAction[MergedAttributeAction["None"] = 0] = "None";
|
|
574
|
+
MergedAttributeAction[MergedAttributeAction["Fire"] = 1] = "Fire";
|
|
575
|
+
MergedAttributeAction[MergedAttributeAction["Reopen"] = 2] = "Reopen";
|
|
576
|
+
})(MergedAttributeAction || (MergedAttributeAction = {}))));
|
|
577
|
+
let mergedAction = MergedAttributeAction.None;
|
|
578
|
+
if (newName !== existingTunnel.name) {
|
|
579
|
+
existingTunnel.name = newName;
|
|
580
|
+
mergedAction = MergedAttributeAction.Fire;
|
|
581
|
+
}
|
|
582
|
+
if ((attributes?.protocol || (existingTunnel.protocol !== TunnelProtocol.Http)) && (attributes?.protocol !== existingTunnel.protocol)) {
|
|
583
|
+
tunnelProperties.source = existingTunnel.source;
|
|
584
|
+
mergedAction = MergedAttributeAction.Reopen;
|
|
585
|
+
}
|
|
586
|
+
if (tunnelProperties.privacy && (existingTunnel.privacy !== tunnelProperties.privacy)) {
|
|
587
|
+
mergedAction = MergedAttributeAction.Reopen;
|
|
588
|
+
}
|
|
589
|
+
switch (mergedAction) {
|
|
590
|
+
case MergedAttributeAction.Fire: {
|
|
560
591
|
this._onForwardPort.fire();
|
|
592
|
+
break;
|
|
561
593
|
}
|
|
562
|
-
|
|
563
|
-
await this.close(existingTunnel.remoteHost, existingTunnel.remotePort);
|
|
564
|
-
tunnelProperties.source = existingTunnel.source;
|
|
594
|
+
case MergedAttributeAction.Reopen: {
|
|
595
|
+
await this.close(existingTunnel.remoteHost, existingTunnel.remotePort, TunnelCloseReason.User);
|
|
565
596
|
await this.forward(tunnelProperties, attributes);
|
|
566
597
|
}
|
|
567
|
-
return mapHasAddressLocalhostOrAllInterfaces(this.remoteTunnels, tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
568
598
|
}
|
|
569
|
-
return
|
|
599
|
+
return mapHasAddressLocalhostOrAllInterfaces(this.remoteTunnels, tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
570
600
|
}
|
|
571
601
|
async name(host, port, name) {
|
|
572
602
|
const existingForwarded = mapHasAddressLocalhostOrAllInterfaces(this.forwarded, host, port);
|
|
@@ -582,9 +612,18 @@ let TunnelModel = class TunnelModel extends Disposable {
|
|
|
582
612
|
this._onPortName.fire({ host, port });
|
|
583
613
|
}
|
|
584
614
|
}
|
|
585
|
-
async close(host, port) {
|
|
615
|
+
async close(host, port, reason) {
|
|
616
|
+
const key = makeAddress(host, port);
|
|
617
|
+
const oldTunnel = this.forwarded.get(key);
|
|
618
|
+
if (reason === TunnelCloseReason.AutoForwardEnd) {
|
|
619
|
+
this.sessionCachedProperties.set(key, {
|
|
620
|
+
local: oldTunnel.localPort,
|
|
621
|
+
name: oldTunnel.name,
|
|
622
|
+
privacy: oldTunnel.privacy,
|
|
623
|
+
});
|
|
624
|
+
}
|
|
586
625
|
await this.tunnelService.closeTunnel(host, port);
|
|
587
|
-
return this.onTunnelClosed({ host, port });
|
|
626
|
+
return this.onTunnelClosed({ host, port }, reason);
|
|
588
627
|
}
|
|
589
628
|
address(host, port) {
|
|
590
629
|
const key = makeAddress(host, port);
|
|
@@ -779,4 +818,4 @@ TunnelModel = ( (__decorate([
|
|
|
779
818
|
( (__param(6, ILogService))),
|
|
780
819
|
( (__param(7, IDialogService)))
|
|
781
820
|
], TunnelModel)));
|
|
782
|
-
export { AutoTunnelSource, IRemoteExplorerService, OnPortForward, PortsAttributes, TUNNEL_VIEW_ID, TunnelEditId, TunnelModel, TunnelSource, TunnelType, UserTunnelSource, makeAddress, mapHasAddress, mapHasAddressLocalhostOrAllInterfaces, parseAddress };
|
|
821
|
+
export { AutoTunnelSource, IRemoteExplorerService, OnPortForward, PortsAttributes, TUNNEL_VIEW_ID, TunnelCloseReason, TunnelEditId, TunnelModel, TunnelSource, TunnelType, UserTunnelSource, makeAddress, mapHasAddress, mapHasAddressLocalhostOrAllInterfaces, parseAddress };
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import * as path from 'monaco-editor/esm/vs/base/common/path.js';
|
|
2
|
+
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
3
|
+
import { toErrorMessage } from 'monaco-editor/esm/vs/base/common/errorMessage.js';
|
|
4
|
+
import * as glob from 'monaco-editor/esm/vs/base/common/glob.js';
|
|
5
|
+
import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
6
|
+
import { StopWatch } from 'monaco-editor/esm/vs/base/common/stopwatch.js';
|
|
7
|
+
import { resolvePatternsForProvider, QueryGlobTester, hasSiblingFn } from './search.js';
|
|
8
|
+
class FileSearchEngine {
|
|
9
|
+
constructor(config, provider, sessionToken) {
|
|
10
|
+
this.config = config;
|
|
11
|
+
this.provider = provider;
|
|
12
|
+
this.sessionToken = sessionToken;
|
|
13
|
+
this.isLimitHit = false;
|
|
14
|
+
this.resultCount = 0;
|
|
15
|
+
this.isCanceled = false;
|
|
16
|
+
this.filePattern = config.filePattern;
|
|
17
|
+
this.includePattern = config.includePattern && glob.parse(config.includePattern);
|
|
18
|
+
this.maxResults = config.maxResults || undefined;
|
|
19
|
+
this.exists = config.exists;
|
|
20
|
+
this.activeCancellationTokens = ( new Set());
|
|
21
|
+
this.globalExcludePattern = config.excludePattern && glob.parse(config.excludePattern);
|
|
22
|
+
}
|
|
23
|
+
cancel() {
|
|
24
|
+
this.isCanceled = true;
|
|
25
|
+
this.activeCancellationTokens.forEach(t => t.cancel());
|
|
26
|
+
this.activeCancellationTokens = ( new Set());
|
|
27
|
+
}
|
|
28
|
+
search(_onResult) {
|
|
29
|
+
const folderQueries = this.config.folderQueries || [];
|
|
30
|
+
return ( new Promise((resolve, reject) => {
|
|
31
|
+
const onResult = (match) => {
|
|
32
|
+
this.resultCount++;
|
|
33
|
+
_onResult(match);
|
|
34
|
+
};
|
|
35
|
+
if (this.isCanceled) {
|
|
36
|
+
return resolve({ limitHit: this.isLimitHit });
|
|
37
|
+
}
|
|
38
|
+
if (this.config.extraFileResources) {
|
|
39
|
+
this.config.extraFileResources
|
|
40
|
+
.forEach(extraFile => {
|
|
41
|
+
const extraFileStr = ( extraFile.toString());
|
|
42
|
+
const basename = path.basename(extraFileStr);
|
|
43
|
+
if (this.globalExcludePattern && this.globalExcludePattern(extraFileStr, basename)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.matchFile(onResult, { base: extraFile, basename });
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
Promise.all(( folderQueries.map(fq => {
|
|
50
|
+
return this.searchInFolder(fq, onResult);
|
|
51
|
+
}))).then(stats => {
|
|
52
|
+
resolve({
|
|
53
|
+
limitHit: this.isLimitHit,
|
|
54
|
+
stats: stats[0] || undefined
|
|
55
|
+
});
|
|
56
|
+
}, (err) => {
|
|
57
|
+
reject(( new Error(toErrorMessage(err))));
|
|
58
|
+
});
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
async searchInFolder(fq, onResult) {
|
|
62
|
+
const cancellation = ( new CancellationTokenSource());
|
|
63
|
+
const options = this.getSearchOptionsForFolder(fq);
|
|
64
|
+
const tree = this.initDirectoryTree();
|
|
65
|
+
const queryTester = ( new QueryGlobTester(this.config, fq));
|
|
66
|
+
const noSiblingsClauses = !queryTester.hasSiblingExcludeClauses();
|
|
67
|
+
let providerSW;
|
|
68
|
+
try {
|
|
69
|
+
this.activeCancellationTokens.add(cancellation);
|
|
70
|
+
providerSW = StopWatch.create();
|
|
71
|
+
const results = await this.provider.provideFileSearchResults({
|
|
72
|
+
pattern: this.config.filePattern || ''
|
|
73
|
+
}, options, cancellation.token);
|
|
74
|
+
const providerTime = providerSW.elapsed();
|
|
75
|
+
const postProcessSW = StopWatch.create();
|
|
76
|
+
if (this.isCanceled && !this.isLimitHit) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
if (results) {
|
|
80
|
+
results.forEach(result => {
|
|
81
|
+
const relativePath = path.posix.relative(fq.folder.path, result.path);
|
|
82
|
+
if (noSiblingsClauses) {
|
|
83
|
+
const basename = path.basename(result.path);
|
|
84
|
+
this.matchFile(onResult, { base: fq.folder, relativePath, basename });
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this.addDirectoryEntries(tree, fq.folder, relativePath, onResult);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (this.isCanceled && !this.isLimitHit) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
this.matchDirectoryTree(tree, queryTester, onResult);
|
|
94
|
+
return {
|
|
95
|
+
providerTime,
|
|
96
|
+
postProcessTime: postProcessSW.elapsed()
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
cancellation.dispose();
|
|
101
|
+
this.activeCancellationTokens.delete(cancellation);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
getSearchOptionsForFolder(fq) {
|
|
105
|
+
const includes = resolvePatternsForProvider(this.config.includePattern, fq.includePattern);
|
|
106
|
+
const excludes = resolvePatternsForProvider(this.config.excludePattern, fq.excludePattern);
|
|
107
|
+
return {
|
|
108
|
+
folder: fq.folder,
|
|
109
|
+
excludes,
|
|
110
|
+
includes,
|
|
111
|
+
useIgnoreFiles: !fq.disregardIgnoreFiles,
|
|
112
|
+
useGlobalIgnoreFiles: !fq.disregardGlobalIgnoreFiles,
|
|
113
|
+
useParentIgnoreFiles: !fq.disregardParentIgnoreFiles,
|
|
114
|
+
followSymlinks: !fq.ignoreSymlinks,
|
|
115
|
+
maxResults: this.config.maxResults,
|
|
116
|
+
session: this.sessionToken
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
initDirectoryTree() {
|
|
120
|
+
const tree = {
|
|
121
|
+
rootEntries: [],
|
|
122
|
+
pathToEntries: Object.create(null)
|
|
123
|
+
};
|
|
124
|
+
tree.pathToEntries['.'] = tree.rootEntries;
|
|
125
|
+
return tree;
|
|
126
|
+
}
|
|
127
|
+
addDirectoryEntries({ pathToEntries }, base, relativeFile, onResult) {
|
|
128
|
+
if (relativeFile === this.filePattern) {
|
|
129
|
+
const basename = path.basename(this.filePattern);
|
|
130
|
+
this.matchFile(onResult, { base: base, relativePath: this.filePattern, basename });
|
|
131
|
+
}
|
|
132
|
+
function add(relativePath) {
|
|
133
|
+
const basename = path.basename(relativePath);
|
|
134
|
+
const dirname = path.dirname(relativePath);
|
|
135
|
+
let entries = pathToEntries[dirname];
|
|
136
|
+
if (!entries) {
|
|
137
|
+
entries = pathToEntries[dirname] = [];
|
|
138
|
+
add(dirname);
|
|
139
|
+
}
|
|
140
|
+
entries.push({
|
|
141
|
+
base,
|
|
142
|
+
relativePath,
|
|
143
|
+
basename
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
add(relativeFile);
|
|
147
|
+
}
|
|
148
|
+
matchDirectoryTree({ rootEntries, pathToEntries }, queryTester, onResult) {
|
|
149
|
+
const self = this;
|
|
150
|
+
const filePattern = this.filePattern;
|
|
151
|
+
function matchDirectory(entries) {
|
|
152
|
+
const hasSibling = hasSiblingFn(() => ( entries.map(entry => entry.basename)));
|
|
153
|
+
for (let i = 0, n = entries.length; i < n; i++) {
|
|
154
|
+
const entry = entries[i];
|
|
155
|
+
const { relativePath, basename } = entry;
|
|
156
|
+
if (queryTester.matchesExcludesSync(relativePath, basename, filePattern !== basename ? hasSibling : undefined)) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const sub = pathToEntries[relativePath];
|
|
160
|
+
if (sub) {
|
|
161
|
+
matchDirectory(sub);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
if (relativePath === filePattern) {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
self.matchFile(onResult, entry);
|
|
168
|
+
}
|
|
169
|
+
if (self.isLimitHit) {
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
matchDirectory(rootEntries);
|
|
175
|
+
}
|
|
176
|
+
matchFile(onResult, candidate) {
|
|
177
|
+
if (!this.includePattern || (candidate.relativePath && this.includePattern(candidate.relativePath, candidate.basename))) {
|
|
178
|
+
if (this.exists || (this.maxResults && this.resultCount >= this.maxResults)) {
|
|
179
|
+
this.isLimitHit = true;
|
|
180
|
+
this.cancel();
|
|
181
|
+
}
|
|
182
|
+
if (!this.isLimitHit) {
|
|
183
|
+
onResult(candidate);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
class FileSearchManager {
|
|
189
|
+
constructor() {
|
|
190
|
+
this.sessions = ( new Map());
|
|
191
|
+
}
|
|
192
|
+
fileSearch(config, provider, onBatch, token) {
|
|
193
|
+
const sessionTokenSource = this.getSessionTokenSource(config.cacheKey);
|
|
194
|
+
const engine = ( new FileSearchEngine(config, provider, sessionTokenSource && sessionTokenSource.token));
|
|
195
|
+
let resultCount = 0;
|
|
196
|
+
const onInternalResult = (batch) => {
|
|
197
|
+
resultCount += batch.length;
|
|
198
|
+
onBatch(( batch.map(m => this.rawMatchToSearchItem(m))));
|
|
199
|
+
};
|
|
200
|
+
return this.doSearch(engine, FileSearchManager.BATCH_SIZE, onInternalResult, token).then(result => {
|
|
201
|
+
return {
|
|
202
|
+
limitHit: result.limitHit,
|
|
203
|
+
stats: {
|
|
204
|
+
fromCache: false,
|
|
205
|
+
type: 'fileSearchProvider',
|
|
206
|
+
resultCount,
|
|
207
|
+
detailStats: result.stats
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
clearCache(cacheKey) {
|
|
213
|
+
const sessionTokenSource = this.getSessionTokenSource(cacheKey);
|
|
214
|
+
sessionTokenSource?.cancel();
|
|
215
|
+
}
|
|
216
|
+
getSessionTokenSource(cacheKey) {
|
|
217
|
+
if (!cacheKey) {
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
if (!( this.sessions.has(cacheKey))) {
|
|
221
|
+
this.sessions.set(cacheKey, ( new CancellationTokenSource()));
|
|
222
|
+
}
|
|
223
|
+
return this.sessions.get(cacheKey);
|
|
224
|
+
}
|
|
225
|
+
rawMatchToSearchItem(match) {
|
|
226
|
+
if (match.relativePath) {
|
|
227
|
+
return {
|
|
228
|
+
resource: resources.joinPath(match.base, match.relativePath)
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
return {
|
|
233
|
+
resource: match.base
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
doSearch(engine, batchSize, onResultBatch, token) {
|
|
238
|
+
token.onCancellationRequested(() => {
|
|
239
|
+
engine.cancel();
|
|
240
|
+
});
|
|
241
|
+
const _onResult = (match) => {
|
|
242
|
+
if (match) {
|
|
243
|
+
batch.push(match);
|
|
244
|
+
if (batchSize > 0 && batch.length >= batchSize) {
|
|
245
|
+
onResultBatch(batch);
|
|
246
|
+
batch = [];
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
let batch = [];
|
|
251
|
+
return engine.search(_onResult).then(result => {
|
|
252
|
+
if (batch.length) {
|
|
253
|
+
onResultBatch(batch);
|
|
254
|
+
}
|
|
255
|
+
return result;
|
|
256
|
+
}, error => {
|
|
257
|
+
if (batch.length) {
|
|
258
|
+
onResultBatch(batch);
|
|
259
|
+
}
|
|
260
|
+
return Promise.reject(error);
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
FileSearchManager.BATCH_SIZE = 512;
|
|
265
|
+
export { FileSearchManager };
|
|
@@ -67,6 +67,12 @@ let QueryBuilder = class QueryBuilder {
|
|
|
67
67
|
}
|
|
68
68
|
newPattern.notebookInfo.isInNotebookMarkdownInput = options.notebookSearchConfig.includeMarkupInput;
|
|
69
69
|
}
|
|
70
|
+
if (options.notebookSearchConfig?.includeMarkupPreview) {
|
|
71
|
+
if (!newPattern.notebookInfo) {
|
|
72
|
+
newPattern.notebookInfo = {};
|
|
73
|
+
}
|
|
74
|
+
newPattern.notebookInfo.isInNotebookMarkdownPreview = options.notebookSearchConfig.includeMarkupPreview;
|
|
75
|
+
}
|
|
70
76
|
if (options.notebookSearchConfig?.includeCodeInput) {
|
|
71
77
|
if (!newPattern.notebookInfo) {
|
|
72
78
|
newPattern.notebookInfo = {};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
2
|
+
import { buildReplaceStringWithCasePreserved } from 'monaco-editor/esm/vs/base/common/search.js';
|
|
3
|
+
class ReplacePattern {
|
|
4
|
+
constructor(replaceString, arg2, arg3) {
|
|
5
|
+
this._hasParameters = false;
|
|
6
|
+
this._replacePattern = replaceString;
|
|
7
|
+
let searchPatternInfo;
|
|
8
|
+
let parseParameters;
|
|
9
|
+
if (typeof arg2 === 'boolean') {
|
|
10
|
+
parseParameters = arg2;
|
|
11
|
+
this._regExp = arg3;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
searchPatternInfo = arg2;
|
|
15
|
+
parseParameters = !!searchPatternInfo.isRegExp;
|
|
16
|
+
this._regExp = strings.createRegExp(searchPatternInfo.pattern, !!searchPatternInfo.isRegExp, { matchCase: searchPatternInfo.isCaseSensitive, wholeWord: searchPatternInfo.isWordMatch, multiline: searchPatternInfo.isMultiline, global: false, unicode: true });
|
|
17
|
+
}
|
|
18
|
+
if (parseParameters) {
|
|
19
|
+
this.parseReplaceString(replaceString);
|
|
20
|
+
}
|
|
21
|
+
if (this._regExp.global) {
|
|
22
|
+
this._regExp = strings.createRegExp(this._regExp.source, true, { matchCase: !this._regExp.ignoreCase, wholeWord: false, multiline: this._regExp.multiline, global: false });
|
|
23
|
+
}
|
|
24
|
+
this._caseOpsRegExp = ( new RegExp(/([\s\S]*?)((?:\\[uUlL])+?|)(\$[0-9]+)([\s\S]*?)/g));
|
|
25
|
+
}
|
|
26
|
+
get hasParameters() {
|
|
27
|
+
return this._hasParameters;
|
|
28
|
+
}
|
|
29
|
+
get pattern() {
|
|
30
|
+
return this._replacePattern;
|
|
31
|
+
}
|
|
32
|
+
get regExp() {
|
|
33
|
+
return this._regExp;
|
|
34
|
+
}
|
|
35
|
+
getReplaceString(text, preserveCase) {
|
|
36
|
+
this._regExp.lastIndex = 0;
|
|
37
|
+
const match = this._regExp.exec(text);
|
|
38
|
+
if (match) {
|
|
39
|
+
if (this.hasParameters) {
|
|
40
|
+
const replaceString = this.replaceWithCaseOperations(text, this._regExp, this.buildReplaceString(match, preserveCase));
|
|
41
|
+
if (match[0] === text) {
|
|
42
|
+
return replaceString;
|
|
43
|
+
}
|
|
44
|
+
return replaceString.substr(match.index, match[0].length - (text.length - replaceString.length));
|
|
45
|
+
}
|
|
46
|
+
return this.buildReplaceString(match, preserveCase);
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
replaceWithCaseOperations(text, regex, replaceString) {
|
|
51
|
+
if (!/\\[uUlL]/.test(replaceString)) {
|
|
52
|
+
return text.replace(regex, replaceString);
|
|
53
|
+
}
|
|
54
|
+
const firstMatch = regex.exec(text);
|
|
55
|
+
if (firstMatch === null) {
|
|
56
|
+
return text.replace(regex, replaceString);
|
|
57
|
+
}
|
|
58
|
+
let patMatch;
|
|
59
|
+
let newReplaceString = '';
|
|
60
|
+
let lastIndex = 0;
|
|
61
|
+
let lastMatch = '';
|
|
62
|
+
while ((patMatch = this._caseOpsRegExp.exec(replaceString)) !== null) {
|
|
63
|
+
lastIndex = patMatch.index;
|
|
64
|
+
const fullMatch = patMatch[0];
|
|
65
|
+
lastMatch = fullMatch;
|
|
66
|
+
let caseOps = patMatch[2];
|
|
67
|
+
const money = patMatch[3];
|
|
68
|
+
if (!caseOps) {
|
|
69
|
+
newReplaceString += fullMatch;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const replacement = firstMatch[parseInt(money.slice(1))];
|
|
73
|
+
if (!replacement) {
|
|
74
|
+
newReplaceString += fullMatch;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const replacementLen = replacement.length;
|
|
78
|
+
newReplaceString += patMatch[1];
|
|
79
|
+
caseOps = caseOps.replace(/\\/g, '');
|
|
80
|
+
let i = 0;
|
|
81
|
+
for (; i < caseOps.length; i++) {
|
|
82
|
+
switch (caseOps[i]) {
|
|
83
|
+
case 'U':
|
|
84
|
+
newReplaceString += replacement.slice(i).toUpperCase();
|
|
85
|
+
i = replacementLen;
|
|
86
|
+
break;
|
|
87
|
+
case 'u':
|
|
88
|
+
newReplaceString += replacement[i].toUpperCase();
|
|
89
|
+
break;
|
|
90
|
+
case 'L':
|
|
91
|
+
newReplaceString += replacement.slice(i).toLowerCase();
|
|
92
|
+
i = replacementLen;
|
|
93
|
+
break;
|
|
94
|
+
case 'l':
|
|
95
|
+
newReplaceString += replacement[i].toLowerCase();
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (i < replacementLen) {
|
|
100
|
+
newReplaceString += replacement.slice(i);
|
|
101
|
+
}
|
|
102
|
+
newReplaceString += patMatch[4];
|
|
103
|
+
}
|
|
104
|
+
newReplaceString += replaceString.slice(lastIndex + lastMatch.length);
|
|
105
|
+
return text.replace(regex, newReplaceString);
|
|
106
|
+
}
|
|
107
|
+
buildReplaceString(matches, preserveCase) {
|
|
108
|
+
if (preserveCase) {
|
|
109
|
+
return buildReplaceStringWithCasePreserved(matches, this._replacePattern);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return this._replacePattern;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
parseReplaceString(replaceString) {
|
|
116
|
+
if (!replaceString || replaceString.length === 0) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
let substrFrom = 0, result = '';
|
|
120
|
+
for (let i = 0, len = replaceString.length; i < len; i++) {
|
|
121
|
+
const chCode = replaceString.charCodeAt(i);
|
|
122
|
+
if (chCode === 92 ) {
|
|
123
|
+
i++;
|
|
124
|
+
if (i >= len) {
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
const nextChCode = replaceString.charCodeAt(i);
|
|
128
|
+
let replaceWithCharacter = null;
|
|
129
|
+
switch (nextChCode) {
|
|
130
|
+
case 92 :
|
|
131
|
+
replaceWithCharacter = '\\';
|
|
132
|
+
break;
|
|
133
|
+
case 110 :
|
|
134
|
+
replaceWithCharacter = '\n';
|
|
135
|
+
break;
|
|
136
|
+
case 116 :
|
|
137
|
+
replaceWithCharacter = '\t';
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
if (replaceWithCharacter) {
|
|
141
|
+
result += replaceString.substring(substrFrom, i - 1) + replaceWithCharacter;
|
|
142
|
+
substrFrom = i + 1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (chCode === 36 ) {
|
|
146
|
+
i++;
|
|
147
|
+
if (i >= len) {
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
const nextChCode = replaceString.charCodeAt(i);
|
|
151
|
+
let replaceWithCharacter = null;
|
|
152
|
+
switch (nextChCode) {
|
|
153
|
+
case 48 :
|
|
154
|
+
replaceWithCharacter = '$&';
|
|
155
|
+
this._hasParameters = true;
|
|
156
|
+
break;
|
|
157
|
+
case 96 :
|
|
158
|
+
case 39 :
|
|
159
|
+
this._hasParameters = true;
|
|
160
|
+
break;
|
|
161
|
+
default: {
|
|
162
|
+
if (!this.between(nextChCode, 49 , 57 )) {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
if (i === replaceString.length - 1) {
|
|
166
|
+
this._hasParameters = true;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
let charCode = replaceString.charCodeAt(++i);
|
|
170
|
+
if (!this.between(charCode, 48 , 57 )) {
|
|
171
|
+
this._hasParameters = true;
|
|
172
|
+
--i;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
if (i === replaceString.length - 1) {
|
|
176
|
+
this._hasParameters = true;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
charCode = replaceString.charCodeAt(++i);
|
|
180
|
+
if (!this.between(charCode, 48 , 57 )) {
|
|
181
|
+
this._hasParameters = true;
|
|
182
|
+
--i;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (replaceWithCharacter) {
|
|
189
|
+
result += replaceString.substring(substrFrom, i - 1) + replaceWithCharacter;
|
|
190
|
+
substrFrom = i + 1;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (substrFrom === 0) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
this._replacePattern = result + replaceString.substring(substrFrom);
|
|
198
|
+
}
|
|
199
|
+
between(value, from, to) {
|
|
200
|
+
return from <= value && value <= to;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
export { ReplacePattern };
|