@codingame/monaco-vscode-api 1.82.4-next.1 → 1.82.5-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/extensions.d.ts +3 -3
- package/external/xterm/typings/xterm.d.ts +1729 -0
- package/external/xterm-addon-canvas/typings/xterm-addon-canvas.d.ts +38 -0
- package/external/xterm-addon-image/typings/xterm-addon-image.d.ts +115 -0
- package/external/xterm-addon-search/typings/xterm-addon-search.d.ts +141 -0
- package/external/xterm-addon-serialize/typings/xterm-addon-serialize.d.ts +83 -0
- package/external/xterm-addon-unicode11/typings/xterm-addon-unicode11.d.ts +9 -0
- package/external/xterm-addon-webgl/typings/xterm-addon-webgl.d.ts +43 -0
- package/external/xterm-headless/typings/xterm-headless.d.ts +49 -0
- package/missing-services.js +0 -1
- package/monaco-editor-treemending.patch +551 -551
- package/package.json +21 -1
- package/service-override/bulkEdit.js +0 -1
- package/service-override/environment.js +0 -1
- package/service-override/extensions.js +1 -1
- package/service-override/files.js +0 -1
- package/service-override/keybindings.js +1 -6
- package/service-override/layout.js +0 -1
- package/service-override/output.js +0 -1
- package/service-override/quickaccess.js +0 -1
- package/services.js +10 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +7 -7
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm-private.d.ts +1 -1
- package/README.md +0 -392
- package/override/vs/workbench/contrib/notebook/browser/notebookEditor.js +0 -2
- package/service-override/accessibility.d.ts +0 -5
- package/service-override/accessibility.js +0 -11
- package/service-override/audioCue.d.ts +0 -5
- package/service-override/audioCue.js +0 -13
- package/service-override/bulkEdit.d.ts +0 -5
- package/service-override/configuration.d.ts +0 -17
- package/service-override/configuration.js +0 -117
- package/service-override/debug.d.ts +0 -5
- package/service-override/debug.js +0 -23
- package/service-override/dialogs.d.ts +0 -5
- package/service-override/dialogs.js +0 -57
- package/service-override/editor.d.ts +0 -10
- package/service-override/editor.js +0 -37
- package/service-override/environment.d.ts +0 -6
- package/service-override/extensions.d.ts +0 -50
- package/service-override/files.d.ts +0 -103
- package/service-override/keybindings.d.ts +0 -10
- package/service-override/languageDetectionWorker.d.ts +0 -5
- package/service-override/languageDetectionWorker.js +0 -15
- package/service-override/languages.d.ts +0 -11
- package/service-override/languages.js +0 -27
- package/service-override/layout.d.ts +0 -71
- package/service-override/lifecycle.d.ts +0 -5
- package/service-override/lifecycle.js +0 -10
- package/service-override/markers.d.ts +0 -5
- package/service-override/markers.js +0 -6
- package/service-override/model.d.ts +0 -5
- package/service-override/model.js +0 -10
- package/service-override/notifications.d.ts +0 -5
- package/service-override/notifications.js +0 -34
- package/service-override/output.d.ts +0 -6
- package/service-override/preferences.d.ts +0 -5
- package/service-override/preferences.js +0 -16
- package/service-override/quickaccess.d.ts +0 -10
- package/service-override/remoteAgent.d.ts +0 -6
- package/service-override/remoteAgent.js +0 -42
- package/service-override/search.d.ts +0 -5
- package/service-override/search.js +0 -19
- package/service-override/snippets.d.ts +0 -9
- package/service-override/snippets.js +0 -21
- package/service-override/storage.d.ts +0 -40
- package/service-override/storage.js +0 -116
- package/service-override/terminal.d.ts +0 -69
- package/service-override/terminal.js +0 -117
- package/service-override/textmate.d.ts +0 -6
- package/service-override/textmate.js +0 -41
- package/service-override/theme.d.ts +0 -7
- package/service-override/theme.js +0 -26
- package/service-override/viewBanner.d.ts +0 -6
- package/service-override/viewBanner.js +0 -10
- package/service-override/viewStatusBar.d.ts +0 -6
- package/service-override/viewStatusBar.js +0 -10
- package/service-override/viewTitleBar.d.ts +0 -6
- package/service-override/viewTitleBar.js +0 -10
- package/service-override/views.d.ts +0 -74
- package/service-override/views.js +0 -511
- package/service-override/workspaceTrust.d.ts +0 -5
- package/service-override/workspaceTrust.js +0 -13
- package/vscode/src/vs/base/browser/broadcast.js +0 -52
- package/vscode/src/vs/base/browser/indexedDB.d.ts +0 -17
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +0 -178
- package/vscode/src/vs/base/browser/ui/grid/grid.js +0 -465
- package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +0 -4
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +0 -977
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +0 -60
- package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +0 -14
- package/vscode/src/vs/base/common/codicons.d.ts +0 -556
- package/vscode/src/vs/base/common/processes.js +0 -24
- package/vscode/src/vs/editor/common/services/languageFeaturesService.js +0 -42
- package/vscode/src/vs/editor/common/services/modelUndoRedoParticipant.js +0 -56
- package/vscode/src/vs/editor/common/services/textResourceConfigurationService.js +0 -116
- package/vscode/src/vs/platform/actions/browser/toolbar.d.ts +0 -67
- package/vscode/src/vs/platform/audioCues/browser/media/all.mp3.js +0 -20
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +0 -10
- package/vscode/src/vs/platform/download/common/downloadIpc.js +0 -16
- package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.d.ts +0 -43
- package/vscode/src/vs/platform/files/common/diskFileSystemProviderClient.js +0 -136
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.d.ts +0 -50
- package/vscode/src/vs/platform/log/common/logIpc.js +0 -24
- package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +0 -94
- package/vscode/src/vs/platform/remote/browser/browserSocketFactory.js +0 -193
- package/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.js +0 -107
- package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +0 -41
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +0 -566
- package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +0 -29
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +0 -22
- package/vscode/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +0 -46
- package/vscode/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +0 -94
- package/vscode/src/vs/platform/terminal/common/environmentVariable.js +0 -7
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +0 -196
- package/vscode/src/vs/platform/terminal/common/terminalEnvironment.js +0 -37
- package/vscode/src/vs/platform/terminal/common/terminalLogService.js +0 -42
- package/vscode/src/vs/platform/terminal/common/terminalPlatformConfiguration.js +0 -467
- package/vscode/src/vs/platform/terminal/common/terminalProfiles.js +0 -107
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +0 -66
- package/vscode/src/vs/platform/terminal/common/terminalStrings.js +0 -16
- package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +0 -319
- package/vscode/src/vs/platform/userDataSync/common/settingsMerge.js +0 -40
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +0 -22
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +0 -62
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +0 -699
- package/vscode/src/vs/workbench/api/common/configurationExtensionPoint.js +0 -450
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.d.ts +0 -14
- package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +0 -236
- package/vscode/src/vs/workbench/api/common/extHostConfiguration.d.ts +0 -43
- package/vscode/src/vs/workbench/api/common/extHostExtensionActivator.d.ts +0 -33
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.d.ts +0 -138
- package/vscode/src/vs/workbench/api/common/extHostFileSystemInfo.d.ts +0 -21
- package/vscode/src/vs/workbench/api/common/extHostInitDataService.d.ts +0 -9
- package/vscode/src/vs/workbench/api/common/extHostLocalizationService.d.ts +0 -29
- package/vscode/src/vs/workbench/api/common/extHostManagedSockets.d.ts +0 -11
- package/vscode/src/vs/workbench/api/common/extHostRpcService.d.ts +0 -9
- package/vscode/src/vs/workbench/api/common/extHostStoragePaths.d.ts +0 -14
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.d.ts +0 -53
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.d.ts +0 -19
- package/vscode/src/vs/workbench/api/common/extHostTypes.d.ts +0 -12
- package/vscode/src/vs/workbench/api/common/extHostUriTransformerService.d.ts +0 -9
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.d.ts +0 -91
- package/vscode/src/vs/workbench/api/worker/extHostExtensionService.d.ts +0 -21
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +0 -605
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarActions.js +0 -597
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.d.ts +0 -116
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +0 -783
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +0 -88
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/banner/bannerPart.js +0 -228
- package/vscode/src/vs/workbench/browser/parts/banner/media/bannerpart.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +0 -691
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.d.ts +0 -7
- package/vscode/src/vs/workbench/browser/parts/compositePart.d.ts +0 -84
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +0 -318
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js +0 -69
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.js +0 -127
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +0 -692
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +0 -141
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +0 -414
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +0 -507
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +0 -1233
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +0 -133
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +0 -306
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +0 -850
- package/vscode/src/vs/workbench/browser/parts/editor/media/breadcrumbscontrol.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/editor/media/titlecontrol.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/editor/noTabsTitleControl.js +0 -247
- package/vscode/src/vs/workbench/browser/parts/editor/tabsTitleControl.js +0 -1569
- package/vscode/src/vs/workbench/browser/parts/editor/titleControl.js +0 -292
- package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsActions.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsList.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +0 -124
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +0 -58
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +0 -227
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +0 -212
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +0 -419
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +0 -398
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +0 -78
- package/vscode/src/vs/workbench/browser/parts/panel/media/basepanelpart.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.d.ts +0 -134
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +0 -756
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +0 -59
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +0 -217
- package/vscode/src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarActions.js +0 -109
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarItem.js +0 -234
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarModel.js +0 -249
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.js +0 -439
- package/vscode/src/vs/workbench/browser/parts/titlebar/commandCenterControl.js +0 -134
- package/vscode/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.d.ts +0 -115
- package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.d.ts +0 -77
- package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.js +0 -365
- package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +0 -216
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +0 -104
- package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +0 -4
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +0 -1589
- package/vscode/src/vs/workbench/common/activity.js +0 -3
- package/vscode/src/vs/workbench/common/dialogs.js +0 -31
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibility.contribution.js +0 -13
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +0 -312
- package/vscode/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.js +0 -63
- package/vscode/src/vs/workbench/contrib/audioCues/browser/audioCueDebuggerContribution.js +0 -45
- package/vscode/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.js +0 -170
- package/vscode/src/vs/workbench/contrib/audioCues/browser/audioCues.contribution.js +0 -181
- package/vscode/src/vs/workbench/contrib/audioCues/browser/commands.js +0 -49
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +0 -262
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +0 -339
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +0 -119
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.js +0 -35
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +0 -345
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.js +0 -362
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.js +0 -255
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +0 -249
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +0 -14
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +0 -137
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +0 -212
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +0 -72
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +0 -61
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +0 -106
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +0 -198
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +0 -783
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +0 -397
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +0 -1296
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +0 -176
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +0 -958
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +0 -496
- package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +0 -345
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +0 -297
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +0 -398
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +0 -825
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +0 -619
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +0 -58
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +0 -525
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +0 -679
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +0 -354
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +0 -204
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +0 -80
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +0 -141
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +0 -1172
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +0 -1142
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +0 -104
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +0 -66
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +0 -273
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +0 -312
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +0 -166
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +0 -661
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +0 -103
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +0 -229
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +0 -629
- package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +0 -693
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +0 -951
- package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +0 -46
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +0 -334
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +0 -96
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +0 -573
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +0 -413
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +0 -100
- package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +0 -19
- package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +0 -15
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +0 -98
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +0 -57
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +0 -1480
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +0 -344
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +0 -121
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +0 -173
- package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +0 -34
- package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +0 -115
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +0 -258
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +0 -25
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +0 -81
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +0 -281
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +0 -2414
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +0 -16
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +0 -5
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +0 -73
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +0 -36
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +0 -325
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +0 -230
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +0 -97
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +0 -352
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -426
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -508
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -615
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution2.js +0 -94
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +0 -144
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +0 -53
- package/vscode/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.js +0 -134
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +0 -353
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/markers/browser/markers.contribution.js +0 -586
- package/vscode/src/vs/workbench/contrib/markers/browser/markersFilterOptions.js +0 -75
- package/vscode/src/vs/workbench/contrib/markers/browser/markersModel.js +0 -200
- package/vscode/src/vs/workbench/contrib/markers/browser/markersTable.js +0 -455
- package/vscode/src/vs/workbench/contrib/markers/browser/markersTreeViewer.js +0 -670
- package/vscode/src/vs/workbench/contrib/markers/browser/markersView.js +0 -873
- package/vscode/src/vs/workbench/contrib/markers/browser/markersViewActions.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/markers/browser/markersViewActions.js +0 -132
- package/vscode/src/vs/workbench/contrib/markers/browser/media/markers.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/markers/browser/messages.js +0 -170
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +0 -70
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +0 -158
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +0 -3
- package/vscode/src/vs/workbench/contrib/outline/browser/outline.contribution.js +0 -261
- package/vscode/src/vs/workbench/contrib/outline/browser/outline.js +0 -10
- package/vscode/src/vs/workbench/contrib/outline/browser/outlinePane.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/outline/browser/outlinePane.js +0 -290
- package/vscode/src/vs/workbench/contrib/outline/browser/outlineViewState.js +0 -66
- package/vscode/src/vs/workbench/contrib/output/common/outputLinkComputer.js +0 -129
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +0 -272
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.js +0 -1102
- package/vscode/src/vs/workbench/contrib/preferences/browser/media/keybindings.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/preferences/browser/media/keybindingsEditor.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/preferences/browser/media/preferences.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferences.contribution.js +0 -1213
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesActions.js +0 -94
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesEditor.js +0 -47
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesIcons.js +0 -37
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.js +0 -747
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesSearch.js +0 -349
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +0 -468
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsEditor2.js +0 -1477
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.js +0 -504
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsLayout.js +0 -296
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsSearchMenu.js +0 -79
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTree.js +0 -2041
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +0 -771
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsWidgets.js +0 -1004
- package/vscode/src/vs/workbench/contrib/preferences/browser/tocTree.js +0 -196
- package/vscode/src/vs/workbench/contrib/preferences/common/preferencesContribution.js +0 -151
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +0 -67
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +0 -207
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +0 -27
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +0 -1666
- package/vscode/src/vs/workbench/contrib/remote/common/remote.contribution.js +0 -481
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +0 -759
- package/vscode/src/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/search/browser/media/searchview.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearchContributions.js +0 -7
- package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +0 -220
- package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +0 -232
- package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +0 -7
- package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +0 -224
- package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +0 -513
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +0 -46
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +0 -204
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +0 -354
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +0 -459
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +0 -365
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +0 -35
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +0 -23
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +0 -308
- package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +0 -41
- package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +0 -39
- package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +0 -58
- package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +0 -383
- package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +0 -1916
- package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +0 -636
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +0 -220
- package/vscode/src/vs/workbench/contrib/search/common/cacheState.js +0 -85
- package/vscode/src/vs/workbench/contrib/search/common/constants.js +0 -66
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +0 -11
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +0 -477
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +0 -700
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +0 -187
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +0 -298
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +0 -135
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +0 -268
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +0 -20
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/configureSnippets.js +0 -264
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +0 -87
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/insertSnippet.js +0 -126
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet.js +0 -56
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCodeActionProvider.js +0 -136
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetPicker.js +0 -83
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippets.contribution.js +0 -113
- package/vscode/src/vs/workbench/contrib/terminal/browser/baseTerminalBackend.js +0 -101
- package/vscode/src/vs/workbench/contrib/terminal/browser/detachedTerminal.js +0 -54
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +0 -119
- package/vscode/src/vs/workbench/contrib/terminal/browser/media/scrollbar.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/media/terminal.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/media/widgets.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/media/xterm.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/remotePty.js +0 -175
- package/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.js +0 -311
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.contribution.js +0 -240
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +0 -1964
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalCommands.js +0 -22
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.js +0 -215
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +0 -16
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditor.js +0 -186
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorService.js +0 -239
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEvents.js +0 -47
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +0 -25
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalGroup.js +0 -482
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalGroupService.js +0 -367
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +0 -37
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +0 -2101
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.js +0 -82
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalMainContribution.js +0 -82
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalMenus.js +0 -762
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +0 -617
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProfileQuickpick.js +0 -278
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.js +0 -316
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProfileService.js +0 -218
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +0 -146
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +0 -269
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalService.js +0 -1134
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +0 -108
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.js +0 -420
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +0 -676
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +0 -72
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalUri.js +0 -39
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalView.js +0 -598
- package/vscode/src/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +0 -36
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +0 -469
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +0 -97
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +0 -56
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +0 -416
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +0 -390
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +0 -793
- package/vscode/src/vs/workbench/contrib/terminal/common/environmentVariableService.js +0 -96
- package/vscode/src/vs/workbench/contrib/terminal/common/history.js +0 -356
- package/vscode/src/vs/workbench/contrib/terminal/common/remote/remoteTerminalChannel.js +0 -253
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalConfiguration.js +0 -1016
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +0 -272
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +0 -93
- package/vscode/src/vs/workbench/contrib/terminal/electron-sandbox/terminalProfileResolverService.js +0 -42
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/bufferContentTracker.js +0 -110
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminal.accessibility.contribution.js +0 -232
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibilityHelp.js +0 -138
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBuffer.js +0 -226
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleWidget.js +0 -142
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/textAreaSyncAddon.js +0 -98
- package/vscode/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkProviderService.js +0 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixService.js +0 -155
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +0 -247
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +0 -334
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +0 -117
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +0 -288
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +0 -94
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +0 -86
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +0 -640
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +0 -63
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +0 -57
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +0 -120
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +0 -119
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +0 -61
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +0 -232
- package/vscode/src/vs/workbench/contrib/workspace/browser/media/workspaceTrustEditor.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.js +0 -842
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +0 -1047
- package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +0 -14
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +0 -94
- package/vscode/src/vs/workbench/services/configuration/browser/configuration.js +0 -878
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.js +0 -1170
- package/vscode/src/vs/workbench/services/configuration/common/configurationCache.js +0 -80
- package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.js +0 -589
- package/vscode/src/vs/workbench/services/configuration/common/configurationModels.js +0 -119
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +0 -303
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +0 -26
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +0 -174
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +0 -10
- package/vscode/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.js +0 -320
- package/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.js +0 -989
- package/vscode/src/vs/workbench/services/dialogs/common/dialogService.js +0 -66
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +0 -622
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.js +0 -4
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +0 -2
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +0 -1454
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.js +0 -162
- package/vscode/src/vs/workbench/services/hover/browser/hoverWidget.js +0 -523
- package/vscode/src/vs/workbench/services/hover/browser/media/hover.css.js +0 -4
- package/vscode/src/vs/workbench/services/label/common/labelService.js +0 -412
- package/vscode/src/vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker.js +0 -173
- package/vscode/src/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.js +0 -259
- package/vscode/src/vs/workbench/services/lifecycle/browser/lifecycleService.js +0 -121
- package/vscode/src/vs/workbench/services/localization/common/locale.js +0 -3
- package/vscode/src/vs/workbench/services/notification/common/notificationService.js +0 -188
- package/vscode/src/vs/workbench/services/outline/browser/outlineService.js +0 -35
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +0 -37
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +0 -556
- package/vscode/src/vs/workbench/services/preferences/browser/preferencesService.js +0 -547
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +0 -39
- package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.js +0 -1039
- package/vscode/src/vs/workbench/services/preferences/common/preferencesValidation.js +0 -393
- package/vscode/src/vs/workbench/services/remote/browser/remoteAgentService.js +0 -71
- package/vscode/src/vs/workbench/services/remote/common/abstractRemoteAgentService.js +0 -177
- package/vscode/src/vs/workbench/services/remote/common/remoteAgentEnvironmentChannel.js +0 -51
- package/vscode/src/vs/workbench/services/remote/common/remoteFileSystemProviderClient.js +0 -38
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.d.ts +0 -35
- package/vscode/src/vs/workbench/services/search/common/searchService.js +0 -370
- package/vscode/src/vs/workbench/services/storage/browser/storageService.d.ts +0 -40
- package/vscode/src/vs/workbench/services/storage/browser/storageService.js +0 -280
- package/vscode/src/vs/workbench/services/suggest/browser/media/suggest.css.js +0 -4
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.js +0 -10
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.js +0 -98
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +0 -399
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +0 -83
- package/vscode/src/vs/workbench/services/textMate/browser/arrayOperation.js +0 -62
- package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/textMateWorkerTokenizerController.js +0 -157
- package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/threadedBackgroundTokenizerFactory.js +0 -200
- package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker.js +0 -87
- package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateWorkerTokenizer.js +0 -140
- package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.d.ts +0 -11
- package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +0 -459
- package/vscode/src/vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport.js +0 -72
- package/vscode/src/vs/workbench/services/textMate/browser/tokenizationSupport/tokenizationSupportWithLineLimit.js +0 -36
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammarFactory.js +0 -118
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +0 -93
- package/vscode/src/vs/workbench/services/textMate/common/TMScopeRegistry.js +0 -24
- package/vscode/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.js +0 -187
- package/vscode/src/vs/workbench/services/themes/browser/fileIconThemeData.js +0 -353
- package/vscode/src/vs/workbench/services/themes/browser/productIconThemeData.js +0 -290
- package/vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.js +0 -742
- package/vscode/src/vs/workbench/services/themes/common/colorThemeData.js +0 -864
- package/vscode/src/vs/workbench/services/themes/common/colorThemeSchema.js +0 -265
- package/vscode/src/vs/workbench/services/themes/common/fileIconThemeSchema.js +0 -303
- package/vscode/src/vs/workbench/services/themes/common/plistParser.js +0 -439
- package/vscode/src/vs/workbench/services/themes/common/productIconThemeSchema.js +0 -94
- package/vscode/src/vs/workbench/services/themes/common/textMateScopeMatcher.js +0 -120
- package/vscode/src/vs/workbench/services/themes/common/themeCompatibility.js +0 -66
- package/vscode/src/vs/workbench/services/themes/common/themeConfiguration.js +0 -372
- package/vscode/src/vs/workbench/services/themes/common/themeExtensionPoints.js +0 -254
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +0 -689
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +0 -612
- package/vscode/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +0 -322
- package/vscode/src/vs/workbench/services/workspaces/browser/workspaceTrustEditorInput.js +0 -27
- package/vscode/src/vs/workbench/services/workspaces/browser/workspacesService.js +0 -151
- package/workers/languageDetection.worker.js +0 -8
- package/workers/outputLinkComputer.worker.js +0 -3
- package/workers/textmate.worker.js +0 -3
|
@@ -1,1916 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
-
import { StandardKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/keyboardEvent.js';
|
|
4
|
-
import * as aria from 'monaco-editor/esm/vs/base/browser/ui/aria/aria.js';
|
|
5
|
-
import { ObjectTreeElementCollapseState } from 'monaco-editor/esm/vs/base/browser/ui/tree/tree.js';
|
|
6
|
-
import { Delayer, RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
7
|
-
import * as errors from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
8
|
-
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
9
|
-
import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js';
|
|
10
|
-
import { DisposableStore, Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
11
|
-
import * as platform from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
12
|
-
import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
13
|
-
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
14
|
-
import * as network from 'monaco-editor/esm/vs/base/common/network.js';
|
|
15
|
-
import './media/searchview.css.js';
|
|
16
|
-
import { isCodeEditor, isDiffEditor, getCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
17
|
-
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
18
|
-
import { EmbeddedCodeEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js';
|
|
19
|
-
import { Selection } from 'monaco-editor/esm/vs/editor/common/core/selection.js';
|
|
20
|
-
import { CommonFindController } from 'monaco-editor/esm/vs/editor/contrib/find/browser/findController.js';
|
|
21
|
-
import { MultiCursorSelectionController } from 'monaco-editor/esm/vs/editor/contrib/multicursor/browser/multicursor.js';
|
|
22
|
-
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
23
|
-
import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
|
|
24
|
-
import { MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
25
|
-
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
26
|
-
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
27
|
-
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
28
|
-
import { IContextViewService, IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
29
|
-
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
30
|
-
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
31
|
-
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
32
|
-
import { ServiceCollection } from 'monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js';
|
|
33
|
-
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
34
|
-
import { WorkbenchCompressibleObjectTree, getSelectionKeyboardEvent } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
|
|
35
|
-
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
36
|
-
import { withSelection, IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
|
|
37
|
-
import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
38
|
-
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
39
|
-
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
40
|
-
import { defaultInputBoxStyles, defaultToggleStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
41
|
-
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
42
|
-
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
43
|
-
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
44
|
-
import { OpenFileFolderAction, OpenFolderAction } from '../../../browser/actions/workspaceActions.js';
|
|
45
|
-
import { ResourceListDnDHandler } from '../../../browser/dnd.js';
|
|
46
|
-
import { ResourceLabels } from '../../../browser/labels.js';
|
|
47
|
-
import { ViewPane } from '../../../browser/parts/views/viewPane.js';
|
|
48
|
-
import { Memento } from '../../../common/memento.js';
|
|
49
|
-
import { IViewDescriptorService } from '../../../common/views.js';
|
|
50
|
-
import { NotebookEditor } from '../../../../../../../override/vs/workbench/contrib/notebook/browser/notebookEditor.js';
|
|
51
|
-
import { IncludePatternInputWidget, ExcludePatternInputWidget } from './patternInputWidget.js';
|
|
52
|
-
import { appendKeyBindingLabel } from './searchActionsBase.js';
|
|
53
|
-
import { searchDetailsIcon } from './searchIcons.js';
|
|
54
|
-
import { renderSearchMessage } from './searchMessage.js';
|
|
55
|
-
import { SearchAccessibilityProvider, SearchDelegate, FolderMatchRenderer, FileMatchRenderer, MatchRenderer } from './searchResultsView.js';
|
|
56
|
-
import { SearchWidget } from './searchWidget.js';
|
|
57
|
-
import { SearchViewVisibleKey, FirstMatchFocusKey, FileMatchOrMatchFocusKey, FileMatchOrFolderMatchFocusKey, FileMatchOrFolderMatchWithResourceFocusKey, FileFocusKey, FolderFocusKey, ResourceFolderFocusKey, HasSearchResults, MatchFocusKey, ViewHasSearchPatternKey, ViewHasReplacePatternKey, ViewHasFilePatternKey, ViewHasSomeCollapsibleKey, InTreeViewKey, SearchViewFocusedKey, InputBoxFocusedKey, PatternIncludesFocusedKey, PatternExcludesFocusedKey, IsEditableItemKey, OpenInEditorCommandId } from '../common/constants.js';
|
|
58
|
-
import { IReplaceService } from './replace.js';
|
|
59
|
-
import { SearchStateKey, SearchUIState, getOutOfWorkspaceEditorResources } from '../common/search.js';
|
|
60
|
-
import { SearchHistoryService, ISearchHistoryService } from '../common/searchHistoryService.js';
|
|
61
|
-
import { searchMatchComparer, FileMatch, SearchResult, FolderMatch, Match, FolderMatchWithResource, MatchInNotebook, ISearchViewModelWorkbenchService } from './searchModel.js';
|
|
62
|
-
import { createEditorFromSearchResult } from '../../searchEditor/browser/searchEditorActions.js';
|
|
63
|
-
import { SIDE_GROUP, ACTIVE_GROUP, IEditorService } from '../../../services/editor/common/editorService.js';
|
|
64
|
-
import { IPreferencesService } from '../../../services/preferences/common/preferences.js';
|
|
65
|
-
import { QueryBuilder } from '../../../services/search/common/queryBuilder.js';
|
|
66
|
-
import '../../../services/search/common/search.js';
|
|
67
|
-
import { ITextFileService } from '../../../services/textfile/common/textfiles.js';
|
|
68
|
-
import { INotebookService } from '../../notebook/common/notebookService.js';
|
|
69
|
-
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
70
|
-
import { TextSearchCompleteMessageType } from '../../../services/search/common/searchExtTypes.js';
|
|
71
|
-
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
|
|
72
|
-
var SearchView_1;
|
|
73
|
-
const $ = dom.$;
|
|
74
|
-
const SEARCH_CANCELLED_MESSAGE = ( nls.localize(
|
|
75
|
-
'searchCanceled',
|
|
76
|
-
"Search was canceled before any results could be found - "
|
|
77
|
-
));
|
|
78
|
-
const DEBOUNCE_DELAY = 75;
|
|
79
|
-
let SearchView = class SearchView extends ViewPane {
|
|
80
|
-
static { SearchView_1 = this; }
|
|
81
|
-
static { this.ACTIONS_RIGHT_CLASS_NAME = 'actions-right'; }
|
|
82
|
-
constructor(options, fileService, editorService, codeEditorService, progressService, notificationService, dialogService, commandService, contextViewService, instantiationService, viewDescriptorService, configurationService, contextService, searchViewModelWorkbenchService, contextKeyService, replaceService, textFileService, preferencesService, themeService, searchHistoryService, contextMenuService, accessibilityService, keybindingService, storageService, openerService, telemetryService, notebookService, logService) {
|
|
83
|
-
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
84
|
-
this.fileService = fileService;
|
|
85
|
-
this.editorService = editorService;
|
|
86
|
-
this.codeEditorService = codeEditorService;
|
|
87
|
-
this.progressService = progressService;
|
|
88
|
-
this.notificationService = notificationService;
|
|
89
|
-
this.dialogService = dialogService;
|
|
90
|
-
this.commandService = commandService;
|
|
91
|
-
this.contextViewService = contextViewService;
|
|
92
|
-
this.contextService = contextService;
|
|
93
|
-
this.searchViewModelWorkbenchService = searchViewModelWorkbenchService;
|
|
94
|
-
this.replaceService = replaceService;
|
|
95
|
-
this.textFileService = textFileService;
|
|
96
|
-
this.preferencesService = preferencesService;
|
|
97
|
-
this.searchHistoryService = searchHistoryService;
|
|
98
|
-
this.accessibilityService = accessibilityService;
|
|
99
|
-
this.storageService = storageService;
|
|
100
|
-
this.notebookService = notebookService;
|
|
101
|
-
this.logService = logService;
|
|
102
|
-
this.isDisposed = false;
|
|
103
|
-
this.lastFocusState = 'input';
|
|
104
|
-
this.messageDisposables = ( new DisposableStore());
|
|
105
|
-
this.changedWhileHidden = false;
|
|
106
|
-
this.currentSearchQ = Promise.resolve();
|
|
107
|
-
this.pauseSearching = false;
|
|
108
|
-
this._visibleMatches = 0;
|
|
109
|
-
this.container = dom.$('.search-view');
|
|
110
|
-
this.viewletVisible = SearchViewVisibleKey.bindTo(this.contextKeyService);
|
|
111
|
-
this.firstMatchFocused = FirstMatchFocusKey.bindTo(this.contextKeyService);
|
|
112
|
-
this.fileMatchOrMatchFocused = FileMatchOrMatchFocusKey.bindTo(this.contextKeyService);
|
|
113
|
-
this.fileMatchOrFolderMatchFocus = FileMatchOrFolderMatchFocusKey.bindTo(this.contextKeyService);
|
|
114
|
-
this.fileMatchOrFolderMatchWithResourceFocus = FileMatchOrFolderMatchWithResourceFocusKey.bindTo(this.contextKeyService);
|
|
115
|
-
this.fileMatchFocused = FileFocusKey.bindTo(this.contextKeyService);
|
|
116
|
-
this.folderMatchFocused = FolderFocusKey.bindTo(this.contextKeyService);
|
|
117
|
-
this.folderMatchWithResourceFocused = ResourceFolderFocusKey.bindTo(this.contextKeyService);
|
|
118
|
-
this.hasSearchResultsKey = HasSearchResults.bindTo(this.contextKeyService);
|
|
119
|
-
this.matchFocused = MatchFocusKey.bindTo(this.contextKeyService);
|
|
120
|
-
this.searchStateKey = SearchStateKey.bindTo(this.contextKeyService);
|
|
121
|
-
this.hasSearchPatternKey = ViewHasSearchPatternKey.bindTo(this.contextKeyService);
|
|
122
|
-
this.hasReplacePatternKey = ViewHasReplacePatternKey.bindTo(this.contextKeyService);
|
|
123
|
-
this.hasFilePatternKey = ViewHasFilePatternKey.bindTo(this.contextKeyService);
|
|
124
|
-
this.hasSomeCollapsibleResultKey = ViewHasSomeCollapsibleKey.bindTo(this.contextKeyService);
|
|
125
|
-
this.treeViewKey = InTreeViewKey.bindTo(this.contextKeyService);
|
|
126
|
-
this.contextKeyService = this._register(this.contextKeyService.createScoped(this.container));
|
|
127
|
-
SearchViewFocusedKey.bindTo(this.contextKeyService).set(true);
|
|
128
|
-
this.inputBoxFocused = InputBoxFocusedKey.bindTo(this.contextKeyService);
|
|
129
|
-
this.inputPatternIncludesFocused = PatternIncludesFocusedKey.bindTo(this.contextKeyService);
|
|
130
|
-
this.inputPatternExclusionsFocused = PatternExcludesFocusedKey.bindTo(this.contextKeyService);
|
|
131
|
-
this.isEditableItem = IsEditableItemKey.bindTo(this.contextKeyService);
|
|
132
|
-
this.instantiationService = this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.contextKeyService])));
|
|
133
|
-
this.configurationService.onDidChangeConfiguration(e => {
|
|
134
|
-
if (e.affectsConfiguration('search.sortOrder')) {
|
|
135
|
-
if (this.searchConfig.sortOrder === "modified" ) {
|
|
136
|
-
this.removeFileStats();
|
|
137
|
-
}
|
|
138
|
-
this.refreshTree();
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
this.viewModel = this._register(this.searchViewModelWorkbenchService.searchModel);
|
|
142
|
-
this.queryBuilder = this.instantiationService.createInstance(QueryBuilder);
|
|
143
|
-
this.memento = ( new Memento(this.id, storageService));
|
|
144
|
-
this.viewletState = this.memento.getMemento(1 , 1 );
|
|
145
|
-
this._register(this.fileService.onDidFilesChange(e => this.onFilesChanged(e)));
|
|
146
|
-
this._register(this.textFileService.untitled.onWillDispose(model => this.onUntitledDidDispose(model.resource)));
|
|
147
|
-
this._register(this.contextService.onDidChangeWorkbenchState(() => this.onDidChangeWorkbenchState()));
|
|
148
|
-
this._register(this.searchHistoryService.onDidClearHistory(() => this.clearHistory()));
|
|
149
|
-
this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e)));
|
|
150
|
-
this.delayedRefresh = this._register(( new Delayer(250)));
|
|
151
|
-
this.addToSearchHistoryDelayer = this._register(( new Delayer(2000)));
|
|
152
|
-
this.toggleCollapseStateDelayer = this._register(( new Delayer(100)));
|
|
153
|
-
this.triggerQueryDelayer = this._register(( new Delayer(0)));
|
|
154
|
-
this.treeAccessibilityProvider = this.instantiationService.createInstance(SearchAccessibilityProvider, this.viewModel);
|
|
155
|
-
this.isTreeLayoutViewVisible = this.viewletState['view.treeLayout'] ?? ((this.searchConfig.defaultViewMode === "tree") );
|
|
156
|
-
this._refreshResultsScheduler = this._register(( new RunOnceScheduler(this._updateResults.bind(this), 80)));
|
|
157
|
-
this._register(this.storageService.onWillSaveState(() => {
|
|
158
|
-
this._saveSearchHistoryService();
|
|
159
|
-
}));
|
|
160
|
-
this._register(this.storageService.onDidChangeValue(1 , SearchHistoryService.SEARCH_HISTORY_KEY, this._register(( new DisposableStore())))(() => {
|
|
161
|
-
const restoredHistory = this.searchHistoryService.load();
|
|
162
|
-
if (restoredHistory.include) {
|
|
163
|
-
this.inputPatternIncludes.prependHistory(restoredHistory.include);
|
|
164
|
-
}
|
|
165
|
-
if (restoredHistory.exclude) {
|
|
166
|
-
this.inputPatternExcludes.prependHistory(restoredHistory.exclude);
|
|
167
|
-
}
|
|
168
|
-
if (restoredHistory.search) {
|
|
169
|
-
this.searchWidget.prependSearchHistory(restoredHistory.search);
|
|
170
|
-
}
|
|
171
|
-
if (restoredHistory.replace) {
|
|
172
|
-
this.searchWidget.prependReplaceHistory(restoredHistory.replace);
|
|
173
|
-
}
|
|
174
|
-
}));
|
|
175
|
-
}
|
|
176
|
-
get isTreeLayoutViewVisible() {
|
|
177
|
-
return this.treeViewKey.get() ?? false;
|
|
178
|
-
}
|
|
179
|
-
set isTreeLayoutViewVisible(visible) {
|
|
180
|
-
this.treeViewKey.set(visible);
|
|
181
|
-
}
|
|
182
|
-
setTreeView(visible) {
|
|
183
|
-
if (visible === this.isTreeLayoutViewVisible) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
this.isTreeLayoutViewVisible = visible;
|
|
187
|
-
this.updateIndentStyles(this.themeService.getFileIconTheme());
|
|
188
|
-
this.refreshTree();
|
|
189
|
-
}
|
|
190
|
-
get state() {
|
|
191
|
-
return this.searchStateKey.get() ?? SearchUIState.Idle;
|
|
192
|
-
}
|
|
193
|
-
set state(v) {
|
|
194
|
-
this.searchStateKey.set(v);
|
|
195
|
-
}
|
|
196
|
-
getContainer() {
|
|
197
|
-
return this.container;
|
|
198
|
-
}
|
|
199
|
-
get searchResult() {
|
|
200
|
-
return this.viewModel && this.viewModel.searchResult;
|
|
201
|
-
}
|
|
202
|
-
onDidChangeWorkbenchState() {
|
|
203
|
-
if (this.contextService.getWorkbenchState() !== 1 && this.searchWithoutFolderMessageElement) {
|
|
204
|
-
dom.hide(this.searchWithoutFolderMessageElement);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
refreshInputs() {
|
|
208
|
-
this.pauseSearching = true;
|
|
209
|
-
this.searchWidget.setValue(this.viewModel.searchResult.query?.contentPattern.pattern ?? '');
|
|
210
|
-
this.searchWidget.setReplaceAllActionState(false);
|
|
211
|
-
this.searchWidget.toggleReplace(true);
|
|
212
|
-
this.inputPatternIncludes.setOnlySearchInOpenEditors(this.viewModel.searchResult.query?.onlyOpenEditors || false);
|
|
213
|
-
this.inputPatternExcludes.setUseExcludesAndIgnoreFiles(!this.viewModel.searchResult.query?.userDisabledExcludesAndIgnoreFiles || true);
|
|
214
|
-
this.searchIncludePattern.setValue('');
|
|
215
|
-
this.searchExcludePattern.setValue('');
|
|
216
|
-
this.pauseSearching = false;
|
|
217
|
-
}
|
|
218
|
-
async importSearchResult(searchModel) {
|
|
219
|
-
searchModel.transferSearchResult(this.viewModel);
|
|
220
|
-
this.onSearchResultsChanged();
|
|
221
|
-
this.refreshInputs();
|
|
222
|
-
const collapseResults = this.searchConfig.collapseResults;
|
|
223
|
-
if (collapseResults !== 'alwaysCollapse' && this.viewModel.searchResult.matches().length === 1) {
|
|
224
|
-
const onlyMatch = this.viewModel.searchResult.matches()[0];
|
|
225
|
-
if (onlyMatch.count() < 50) {
|
|
226
|
-
this.tree.expand(onlyMatch);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
renderBody(parent) {
|
|
231
|
-
super.renderBody(parent);
|
|
232
|
-
this.container = dom.append(parent, dom.$('.search-view'));
|
|
233
|
-
this.searchWidgetsContainerElement = dom.append(this.container, $('.search-widgets-container'));
|
|
234
|
-
this.createSearchWidget(this.searchWidgetsContainerElement);
|
|
235
|
-
const history = this.searchHistoryService.load();
|
|
236
|
-
const filePatterns = this.viewletState['query.filePatterns'] || '';
|
|
237
|
-
const patternExclusions = this.viewletState['query.folderExclusions'] || '';
|
|
238
|
-
const patternExclusionsHistory = history.exclude || [];
|
|
239
|
-
const patternIncludes = this.viewletState['query.folderIncludes'] || '';
|
|
240
|
-
const patternIncludesHistory = history.include || [];
|
|
241
|
-
const onlyOpenEditors = this.viewletState['query.onlyOpenEditors'] || false;
|
|
242
|
-
const queryDetailsExpanded = this.viewletState['query.queryDetailsExpanded'] || '';
|
|
243
|
-
const useExcludesAndIgnoreFiles = typeof this.viewletState['query.useExcludesAndIgnoreFiles'] === 'boolean' ?
|
|
244
|
-
this.viewletState['query.useExcludesAndIgnoreFiles'] : true;
|
|
245
|
-
this.queryDetails = dom.append(this.searchWidgetsContainerElement, $('.query-details'));
|
|
246
|
-
this.toggleQueryDetailsButton = dom.append(this.queryDetails, $('.more' + ThemeIcon.asCSSSelector(searchDetailsIcon), { tabindex: 0, role: 'button', title: ( nls.localize('moreSearch', "Toggle Search Details")) }));
|
|
247
|
-
this._register(dom.addDisposableListener(this.toggleQueryDetailsButton, dom.EventType.CLICK, e => {
|
|
248
|
-
dom.EventHelper.stop(e);
|
|
249
|
-
this.toggleQueryDetails(!this.accessibilityService.isScreenReaderOptimized());
|
|
250
|
-
}));
|
|
251
|
-
this._register(dom.addDisposableListener(this.toggleQueryDetailsButton, dom.EventType.KEY_UP, (e) => {
|
|
252
|
-
const event = ( new StandardKeyboardEvent(e));
|
|
253
|
-
if (event.equals(3 ) || event.equals(10 )) {
|
|
254
|
-
dom.EventHelper.stop(e);
|
|
255
|
-
this.toggleQueryDetails(false);
|
|
256
|
-
}
|
|
257
|
-
}));
|
|
258
|
-
this._register(dom.addDisposableListener(this.toggleQueryDetailsButton, dom.EventType.KEY_DOWN, (e) => {
|
|
259
|
-
const event = ( new StandardKeyboardEvent(e));
|
|
260
|
-
if (event.equals(1024 | 2 )) {
|
|
261
|
-
if (this.searchWidget.isReplaceActive()) {
|
|
262
|
-
this.searchWidget.focusReplaceAllAction();
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
this.searchWidget.isReplaceShown() ? this.searchWidget.replaceInput?.focusOnPreserve() : this.searchWidget.focusRegexAction();
|
|
266
|
-
}
|
|
267
|
-
dom.EventHelper.stop(e);
|
|
268
|
-
}
|
|
269
|
-
}));
|
|
270
|
-
const folderIncludesList = dom.append(this.queryDetails, $('.file-types.includes'));
|
|
271
|
-
const filesToIncludeTitle = ( nls.localize('searchScope.includes', "files to include"));
|
|
272
|
-
dom.append(folderIncludesList, $('h4', undefined, filesToIncludeTitle));
|
|
273
|
-
this.inputPatternIncludes = this._register(this.instantiationService.createInstance(IncludePatternInputWidget, folderIncludesList, this.contextViewService, {
|
|
274
|
-
ariaLabel: filesToIncludeTitle,
|
|
275
|
-
placeholder: ( nls.localize('placeholder.includes', "e.g. *.ts, src/**/include")),
|
|
276
|
-
showPlaceholderOnFocus: true,
|
|
277
|
-
history: patternIncludesHistory,
|
|
278
|
-
inputBoxStyles: defaultInputBoxStyles
|
|
279
|
-
}));
|
|
280
|
-
this.inputPatternIncludes.setValue(patternIncludes);
|
|
281
|
-
this.inputPatternIncludes.setOnlySearchInOpenEditors(onlyOpenEditors);
|
|
282
|
-
this._register(this.inputPatternIncludes.onCancel(() => this.cancelSearch(false)));
|
|
283
|
-
this._register(this.inputPatternIncludes.onChangeSearchInEditorsBox(() => this.triggerQueryChange()));
|
|
284
|
-
this.trackInputBox(this.inputPatternIncludes.inputFocusTracker, this.inputPatternIncludesFocused);
|
|
285
|
-
const excludesList = dom.append(this.queryDetails, $('.file-types.excludes'));
|
|
286
|
-
const excludesTitle = ( nls.localize('searchScope.excludes', "files to exclude"));
|
|
287
|
-
dom.append(excludesList, $('h4', undefined, excludesTitle));
|
|
288
|
-
this.inputPatternExcludes = this._register(this.instantiationService.createInstance(ExcludePatternInputWidget, excludesList, this.contextViewService, {
|
|
289
|
-
ariaLabel: excludesTitle,
|
|
290
|
-
placeholder: ( nls.localize('placeholder.excludes', "e.g. *.ts, src/**/exclude")),
|
|
291
|
-
showPlaceholderOnFocus: true,
|
|
292
|
-
history: patternExclusionsHistory,
|
|
293
|
-
inputBoxStyles: defaultInputBoxStyles
|
|
294
|
-
}));
|
|
295
|
-
this.inputPatternExcludes.setValue(patternExclusions);
|
|
296
|
-
this.inputPatternExcludes.setUseExcludesAndIgnoreFiles(useExcludesAndIgnoreFiles);
|
|
297
|
-
this._register(this.inputPatternExcludes.onCancel(() => this.cancelSearch(false)));
|
|
298
|
-
this._register(this.inputPatternExcludes.onChangeIgnoreBox(() => this.triggerQueryChange()));
|
|
299
|
-
this.trackInputBox(this.inputPatternExcludes.inputFocusTracker, this.inputPatternExclusionsFocused);
|
|
300
|
-
const updateHasFilePatternKey = () => this.hasFilePatternKey.set(this.inputPatternIncludes.getValue().length > 0 || this.inputPatternExcludes.getValue().length > 0);
|
|
301
|
-
updateHasFilePatternKey();
|
|
302
|
-
const onFilePatternSubmit = (triggeredOnType) => {
|
|
303
|
-
this.triggerQueryChange({ triggeredOnType, delay: this.searchConfig.searchOnTypeDebouncePeriod });
|
|
304
|
-
if (triggeredOnType) {
|
|
305
|
-
updateHasFilePatternKey();
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
this._register(this.inputPatternIncludes.onSubmit(onFilePatternSubmit));
|
|
309
|
-
this._register(this.inputPatternExcludes.onSubmit(onFilePatternSubmit));
|
|
310
|
-
this.messagesElement = dom.append(this.container, $('.messages.text-search-provider-messages'));
|
|
311
|
-
if (this.contextService.getWorkbenchState() === 1 ) {
|
|
312
|
-
this.showSearchWithoutFolderMessage();
|
|
313
|
-
}
|
|
314
|
-
this.createSearchResultsView(this.container);
|
|
315
|
-
if (filePatterns !== '' || patternExclusions !== '' || patternIncludes !== '' || queryDetailsExpanded !== '' || !useExcludesAndIgnoreFiles) {
|
|
316
|
-
this.toggleQueryDetails(true, true, true);
|
|
317
|
-
}
|
|
318
|
-
this._register(this.viewModel.onSearchResultChanged((event) => this.onSearchResultsChanged(event)));
|
|
319
|
-
this._register(this.onDidChangeBodyVisibility(visible => this.onVisibilityChanged(visible)));
|
|
320
|
-
this.updateIndentStyles(this.themeService.getFileIconTheme());
|
|
321
|
-
this._register(this.themeService.onDidFileIconThemeChange(this.updateIndentStyles, this));
|
|
322
|
-
}
|
|
323
|
-
updateIndentStyles(theme) {
|
|
324
|
-
this.resultsElement.classList.toggle('hide-arrows', this.isTreeLayoutViewVisible && theme.hidesExplorerArrows);
|
|
325
|
-
}
|
|
326
|
-
onVisibilityChanged(visible) {
|
|
327
|
-
this.viewletVisible.set(visible);
|
|
328
|
-
if (visible) {
|
|
329
|
-
if (this.changedWhileHidden) {
|
|
330
|
-
this.refreshAndUpdateCount();
|
|
331
|
-
this.changedWhileHidden = false;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
this.lastFocusState = 'input';
|
|
336
|
-
}
|
|
337
|
-
this.viewModel?.searchResult.toggleHighlights(visible);
|
|
338
|
-
}
|
|
339
|
-
get searchAndReplaceWidget() {
|
|
340
|
-
return this.searchWidget;
|
|
341
|
-
}
|
|
342
|
-
get searchIncludePattern() {
|
|
343
|
-
return this.inputPatternIncludes;
|
|
344
|
-
}
|
|
345
|
-
get searchExcludePattern() {
|
|
346
|
-
return this.inputPatternExcludes;
|
|
347
|
-
}
|
|
348
|
-
createSearchWidget(container) {
|
|
349
|
-
const contentPattern = this.viewletState['query.contentPattern'] || '';
|
|
350
|
-
const replaceText = this.viewletState['query.replaceText'] || '';
|
|
351
|
-
const isRegex = this.viewletState['query.regex'] === true;
|
|
352
|
-
const isWholeWords = this.viewletState['query.wholeWords'] === true;
|
|
353
|
-
const isCaseSensitive = this.viewletState['query.caseSensitive'] === true;
|
|
354
|
-
const history = this.searchHistoryService.load();
|
|
355
|
-
const searchHistory = history.search || this.viewletState['query.searchHistory'] || [];
|
|
356
|
-
const replaceHistory = history.replace || this.viewletState['query.replaceHistory'] || [];
|
|
357
|
-
const showReplace = typeof this.viewletState['view.showReplace'] === 'boolean' ? this.viewletState['view.showReplace'] : true;
|
|
358
|
-
const preserveCase = this.viewletState['query.preserveCase'] === true;
|
|
359
|
-
const isInNotebookMarkdownInput = this.viewletState['query.isInNotebookMarkdownInput'] ?? true;
|
|
360
|
-
const isInNotebookMarkdownPreview = this.viewletState['query.isInNotebookMarkdownPreview'] ?? true;
|
|
361
|
-
const isInNotebookCellInput = this.viewletState['query.isInNotebookCellInput'] ?? true;
|
|
362
|
-
const isInNotebookCellOutput = this.viewletState['query.isInNotebookCellOutput'] ?? true;
|
|
363
|
-
this.searchWidget = this._register(this.instantiationService.createInstance(SearchWidget, container, {
|
|
364
|
-
value: contentPattern,
|
|
365
|
-
replaceValue: replaceText,
|
|
366
|
-
isRegex: isRegex,
|
|
367
|
-
isCaseSensitive: isCaseSensitive,
|
|
368
|
-
isWholeWords: isWholeWords,
|
|
369
|
-
searchHistory: searchHistory,
|
|
370
|
-
replaceHistory: replaceHistory,
|
|
371
|
-
preserveCase: preserveCase,
|
|
372
|
-
inputBoxStyles: defaultInputBoxStyles,
|
|
373
|
-
toggleStyles: defaultToggleStyles,
|
|
374
|
-
notebookOptions: {
|
|
375
|
-
isInNotebookMarkdownInput,
|
|
376
|
-
isInNotebookMarkdownPreview,
|
|
377
|
-
isInNotebookCellInput,
|
|
378
|
-
isInNotebookCellOutput,
|
|
379
|
-
}
|
|
380
|
-
}));
|
|
381
|
-
if (!this.searchWidget.searchInput || !this.searchWidget.replaceInput) {
|
|
382
|
-
this.logService.warn(`Cannot fully create search widget. Search or replace input undefined. SearchInput: ${this.searchWidget.searchInput}, ReplaceInput: ${this.searchWidget.replaceInput}`);
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
if (showReplace) {
|
|
386
|
-
this.searchWidget.toggleReplace(true);
|
|
387
|
-
}
|
|
388
|
-
this._register(this.searchWidget.onSearchSubmit(options => this.triggerQueryChange(options)));
|
|
389
|
-
this._register(this.searchWidget.onSearchCancel(({ focus }) => this.cancelSearch(focus)));
|
|
390
|
-
this._register(this.searchWidget.searchInput.onDidOptionChange(() => this.triggerQueryChange()));
|
|
391
|
-
this._register(this.searchWidget.getNotebookFilters().onDidChange(() => this.triggerQueryChange()));
|
|
392
|
-
const updateHasPatternKey = () => this.hasSearchPatternKey.set(this.searchWidget.searchInput ? (this.searchWidget.searchInput.getValue().length > 0) : false);
|
|
393
|
-
updateHasPatternKey();
|
|
394
|
-
this._register(this.searchWidget.searchInput.onDidChange(() => updateHasPatternKey()));
|
|
395
|
-
const updateHasReplacePatternKey = () => this.hasReplacePatternKey.set(this.searchWidget.getReplaceValue().length > 0);
|
|
396
|
-
updateHasReplacePatternKey();
|
|
397
|
-
this._register(this.searchWidget.replaceInput.inputBox.onDidChange(() => updateHasReplacePatternKey()));
|
|
398
|
-
this._register(this.searchWidget.onDidHeightChange(() => this.reLayout()));
|
|
399
|
-
this._register(this.searchWidget.onReplaceToggled(() => this.reLayout()));
|
|
400
|
-
this._register(this.searchWidget.onReplaceStateChange((state) => {
|
|
401
|
-
this.viewModel.replaceActive = state;
|
|
402
|
-
this.refreshTree();
|
|
403
|
-
}));
|
|
404
|
-
this._register(this.searchWidget.onPreserveCaseChange((state) => {
|
|
405
|
-
this.viewModel.preserveCase = state;
|
|
406
|
-
this.refreshTree();
|
|
407
|
-
}));
|
|
408
|
-
this._register(this.searchWidget.onReplaceValueChanged(() => {
|
|
409
|
-
this.viewModel.replaceString = this.searchWidget.getReplaceValue();
|
|
410
|
-
this.delayedRefresh.trigger(() => this.refreshTree());
|
|
411
|
-
}));
|
|
412
|
-
this._register(this.searchWidget.onBlur(() => {
|
|
413
|
-
this.toggleQueryDetailsButton.focus();
|
|
414
|
-
}));
|
|
415
|
-
this._register(this.searchWidget.onReplaceAll(() => this.replaceAll()));
|
|
416
|
-
this.trackInputBox(this.searchWidget.searchInputFocusTracker);
|
|
417
|
-
this.trackInputBox(this.searchWidget.replaceInputFocusTracker);
|
|
418
|
-
}
|
|
419
|
-
onConfigurationUpdated(event) {
|
|
420
|
-
if (event && (event.affectsConfiguration('search.decorations.colors') || event.affectsConfiguration('search.decorations.badges'))) {
|
|
421
|
-
this.refreshTree();
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
trackInputBox(inputFocusTracker, contextKey) {
|
|
425
|
-
if (!inputFocusTracker) {
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
this._register(inputFocusTracker.onDidFocus(() => {
|
|
429
|
-
this.lastFocusState = 'input';
|
|
430
|
-
this.inputBoxFocused.set(true);
|
|
431
|
-
contextKey?.set(true);
|
|
432
|
-
}));
|
|
433
|
-
this._register(inputFocusTracker.onDidBlur(() => {
|
|
434
|
-
this.inputBoxFocused.set(this.searchWidget.searchInputHasFocus()
|
|
435
|
-
|| this.searchWidget.replaceInputHasFocus()
|
|
436
|
-
|| this.inputPatternIncludes.inputHasFocus()
|
|
437
|
-
|| this.inputPatternExcludes.inputHasFocus());
|
|
438
|
-
contextKey?.set(false);
|
|
439
|
-
}));
|
|
440
|
-
}
|
|
441
|
-
onSearchResultsChanged(event) {
|
|
442
|
-
if (this.isVisible()) {
|
|
443
|
-
return this.refreshAndUpdateCount(event);
|
|
444
|
-
}
|
|
445
|
-
else {
|
|
446
|
-
this.changedWhileHidden = true;
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
refreshAndUpdateCount(event) {
|
|
450
|
-
this.searchWidget.setReplaceAllActionState(!this.viewModel.searchResult.isEmpty());
|
|
451
|
-
this.updateSearchResultCount(this.viewModel.searchResult.query.userDisabledExcludesAndIgnoreFiles, this.viewModel.searchResult.query?.onlyOpenEditors, event?.clearingAll);
|
|
452
|
-
return this.refreshTree(event);
|
|
453
|
-
}
|
|
454
|
-
refreshTree(event) {
|
|
455
|
-
const collapseResults = this.searchConfig.collapseResults;
|
|
456
|
-
if (!event || event.added || event.removed) {
|
|
457
|
-
if (this.searchConfig.sortOrder === "modified" ) {
|
|
458
|
-
this.retrieveFileStats()
|
|
459
|
-
.then(() => this.tree.setChildren(null, this.createResultIterator(collapseResults)));
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
this.tree.setChildren(null, this.createResultIterator(collapseResults));
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
else {
|
|
466
|
-
if (this.searchConfig.sortOrder === "countAscending" ||
|
|
467
|
-
this.searchConfig.sortOrder === "countDescending" ) {
|
|
468
|
-
this.tree.setChildren(null, this.createResultIterator(collapseResults));
|
|
469
|
-
}
|
|
470
|
-
else {
|
|
471
|
-
event.elements.forEach(element => {
|
|
472
|
-
this.tree.setChildren(element, this.createIterator(element, collapseResults));
|
|
473
|
-
this.tree.rerender(element);
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
createResultIterator(collapseResults) {
|
|
479
|
-
const folderMatches = this.searchResult.folderMatches()
|
|
480
|
-
.filter(fm => !fm.isEmpty())
|
|
481
|
-
.sort(searchMatchComparer);
|
|
482
|
-
if (folderMatches.length === 1) {
|
|
483
|
-
return this.createFolderIterator(folderMatches[0], collapseResults, true);
|
|
484
|
-
}
|
|
485
|
-
return ( Iterable.map(folderMatches, folderMatch => {
|
|
486
|
-
const children = this.createFolderIterator(folderMatch, collapseResults, true);
|
|
487
|
-
return { element: folderMatch, children, incompressible: true };
|
|
488
|
-
}));
|
|
489
|
-
}
|
|
490
|
-
createFolderIterator(folderMatch, collapseResults, childFolderIncompressible) {
|
|
491
|
-
const sortOrder = this.searchConfig.sortOrder;
|
|
492
|
-
const matchArray = this.isTreeLayoutViewVisible ? folderMatch.matches() : folderMatch.allDownstreamFileMatches();
|
|
493
|
-
const matches = matchArray.sort((a, b) => searchMatchComparer(a, b, sortOrder));
|
|
494
|
-
return ( Iterable.map(matches, match => {
|
|
495
|
-
let children;
|
|
496
|
-
if (match instanceof FileMatch) {
|
|
497
|
-
children = this.createFileIterator(match);
|
|
498
|
-
}
|
|
499
|
-
else {
|
|
500
|
-
children = this.createFolderIterator(match, collapseResults, false);
|
|
501
|
-
}
|
|
502
|
-
const collapsed = (collapseResults === 'alwaysCollapse' || (match.count() > 10 && collapseResults !== 'alwaysExpand')) ? ObjectTreeElementCollapseState.PreserveOrCollapsed : ObjectTreeElementCollapseState.PreserveOrExpanded;
|
|
503
|
-
return { element: match, children, collapsed, incompressible: (match instanceof FileMatch) ? true : childFolderIncompressible };
|
|
504
|
-
}));
|
|
505
|
-
}
|
|
506
|
-
createFileIterator(fileMatch) {
|
|
507
|
-
const matches = fileMatch.matches().sort(searchMatchComparer);
|
|
508
|
-
return ( Iterable.map(matches, r => ({ element: r, incompressible: true })));
|
|
509
|
-
}
|
|
510
|
-
createIterator(match, collapseResults) {
|
|
511
|
-
return match instanceof SearchResult ? this.createResultIterator(collapseResults) :
|
|
512
|
-
match instanceof FolderMatch ? this.createFolderIterator(match, collapseResults, false) :
|
|
513
|
-
this.createFileIterator(match);
|
|
514
|
-
}
|
|
515
|
-
replaceAll() {
|
|
516
|
-
if (this.viewModel.searchResult.count() === 0) {
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
const occurrences = this.viewModel.searchResult.count();
|
|
520
|
-
const fileCount = this.viewModel.searchResult.fileCount();
|
|
521
|
-
const replaceValue = this.searchWidget.getReplaceValue() || '';
|
|
522
|
-
const afterReplaceAllMessage = this.buildAfterReplaceAllMessage(occurrences, fileCount, replaceValue);
|
|
523
|
-
let progressComplete;
|
|
524
|
-
let progressReporter;
|
|
525
|
-
this.progressService.withProgress({ location: this.getProgressLocation(), delay: 100, total: occurrences }, p => {
|
|
526
|
-
progressReporter = p;
|
|
527
|
-
return ( new Promise(resolve => progressComplete = resolve));
|
|
528
|
-
});
|
|
529
|
-
const confirmation = {
|
|
530
|
-
title: ( nls.localize('replaceAll.confirmation.title', "Replace All")),
|
|
531
|
-
message: this.buildReplaceAllConfirmationMessage(occurrences, fileCount, replaceValue),
|
|
532
|
-
primaryButton: ( nls.localize(
|
|
533
|
-
{ key: 'replaceAll.confirm.button', comment: ['&& denotes a mnemonic'] },
|
|
534
|
-
"&&Replace"
|
|
535
|
-
))
|
|
536
|
-
};
|
|
537
|
-
this.dialogService.confirm(confirmation).then(res => {
|
|
538
|
-
if (res.confirmed) {
|
|
539
|
-
this.searchWidget.setReplaceAllActionState(false);
|
|
540
|
-
this.viewModel.searchResult.replaceAll(progressReporter).then(() => {
|
|
541
|
-
progressComplete();
|
|
542
|
-
const messageEl = this.clearMessage();
|
|
543
|
-
dom.append(messageEl, afterReplaceAllMessage);
|
|
544
|
-
this.reLayout();
|
|
545
|
-
}, (error) => {
|
|
546
|
-
progressComplete();
|
|
547
|
-
errors.isCancellationError(error);
|
|
548
|
-
this.notificationService.error(error);
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
else {
|
|
552
|
-
progressComplete();
|
|
553
|
-
}
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
buildAfterReplaceAllMessage(occurrences, fileCount, replaceValue) {
|
|
557
|
-
if (occurrences === 1) {
|
|
558
|
-
if (fileCount === 1) {
|
|
559
|
-
if (replaceValue) {
|
|
560
|
-
return ( nls.localize(
|
|
561
|
-
'replaceAll.occurrence.file.message',
|
|
562
|
-
"Replaced {0} occurrence across {1} file with '{2}'.",
|
|
563
|
-
occurrences,
|
|
564
|
-
fileCount,
|
|
565
|
-
replaceValue
|
|
566
|
-
));
|
|
567
|
-
}
|
|
568
|
-
return ( nls.localize(
|
|
569
|
-
'removeAll.occurrence.file.message',
|
|
570
|
-
"Replaced {0} occurrence across {1} file.",
|
|
571
|
-
occurrences,
|
|
572
|
-
fileCount
|
|
573
|
-
));
|
|
574
|
-
}
|
|
575
|
-
if (replaceValue) {
|
|
576
|
-
return ( nls.localize(
|
|
577
|
-
'replaceAll.occurrence.files.message',
|
|
578
|
-
"Replaced {0} occurrence across {1} files with '{2}'.",
|
|
579
|
-
occurrences,
|
|
580
|
-
fileCount,
|
|
581
|
-
replaceValue
|
|
582
|
-
));
|
|
583
|
-
}
|
|
584
|
-
return ( nls.localize(
|
|
585
|
-
'removeAll.occurrence.files.message',
|
|
586
|
-
"Replaced {0} occurrence across {1} files.",
|
|
587
|
-
occurrences,
|
|
588
|
-
fileCount
|
|
589
|
-
));
|
|
590
|
-
}
|
|
591
|
-
if (fileCount === 1) {
|
|
592
|
-
if (replaceValue) {
|
|
593
|
-
return ( nls.localize(
|
|
594
|
-
'replaceAll.occurrences.file.message',
|
|
595
|
-
"Replaced {0} occurrences across {1} file with '{2}'.",
|
|
596
|
-
occurrences,
|
|
597
|
-
fileCount,
|
|
598
|
-
replaceValue
|
|
599
|
-
));
|
|
600
|
-
}
|
|
601
|
-
return ( nls.localize(
|
|
602
|
-
'removeAll.occurrences.file.message',
|
|
603
|
-
"Replaced {0} occurrences across {1} file.",
|
|
604
|
-
occurrences,
|
|
605
|
-
fileCount
|
|
606
|
-
));
|
|
607
|
-
}
|
|
608
|
-
if (replaceValue) {
|
|
609
|
-
return ( nls.localize(
|
|
610
|
-
'replaceAll.occurrences.files.message',
|
|
611
|
-
"Replaced {0} occurrences across {1} files with '{2}'.",
|
|
612
|
-
occurrences,
|
|
613
|
-
fileCount,
|
|
614
|
-
replaceValue
|
|
615
|
-
));
|
|
616
|
-
}
|
|
617
|
-
return ( nls.localize(
|
|
618
|
-
'removeAll.occurrences.files.message',
|
|
619
|
-
"Replaced {0} occurrences across {1} files.",
|
|
620
|
-
occurrences,
|
|
621
|
-
fileCount
|
|
622
|
-
));
|
|
623
|
-
}
|
|
624
|
-
buildReplaceAllConfirmationMessage(occurrences, fileCount, replaceValue) {
|
|
625
|
-
if (occurrences === 1) {
|
|
626
|
-
if (fileCount === 1) {
|
|
627
|
-
if (replaceValue) {
|
|
628
|
-
return ( nls.localize(
|
|
629
|
-
'removeAll.occurrence.file.confirmation.message',
|
|
630
|
-
"Replace {0} occurrence across {1} file with '{2}'?",
|
|
631
|
-
occurrences,
|
|
632
|
-
fileCount,
|
|
633
|
-
replaceValue
|
|
634
|
-
));
|
|
635
|
-
}
|
|
636
|
-
return ( nls.localize(
|
|
637
|
-
'replaceAll.occurrence.file.confirmation.message',
|
|
638
|
-
"Replace {0} occurrence across {1} file?",
|
|
639
|
-
occurrences,
|
|
640
|
-
fileCount
|
|
641
|
-
));
|
|
642
|
-
}
|
|
643
|
-
if (replaceValue) {
|
|
644
|
-
return ( nls.localize(
|
|
645
|
-
'removeAll.occurrence.files.confirmation.message',
|
|
646
|
-
"Replace {0} occurrence across {1} files with '{2}'?",
|
|
647
|
-
occurrences,
|
|
648
|
-
fileCount,
|
|
649
|
-
replaceValue
|
|
650
|
-
));
|
|
651
|
-
}
|
|
652
|
-
return ( nls.localize(
|
|
653
|
-
'replaceAll.occurrence.files.confirmation.message',
|
|
654
|
-
"Replace {0} occurrence across {1} files?",
|
|
655
|
-
occurrences,
|
|
656
|
-
fileCount
|
|
657
|
-
));
|
|
658
|
-
}
|
|
659
|
-
if (fileCount === 1) {
|
|
660
|
-
if (replaceValue) {
|
|
661
|
-
return ( nls.localize(
|
|
662
|
-
'removeAll.occurrences.file.confirmation.message',
|
|
663
|
-
"Replace {0} occurrences across {1} file with '{2}'?",
|
|
664
|
-
occurrences,
|
|
665
|
-
fileCount,
|
|
666
|
-
replaceValue
|
|
667
|
-
));
|
|
668
|
-
}
|
|
669
|
-
return ( nls.localize(
|
|
670
|
-
'replaceAll.occurrences.file.confirmation.message',
|
|
671
|
-
"Replace {0} occurrences across {1} file?",
|
|
672
|
-
occurrences,
|
|
673
|
-
fileCount
|
|
674
|
-
));
|
|
675
|
-
}
|
|
676
|
-
if (replaceValue) {
|
|
677
|
-
return ( nls.localize(
|
|
678
|
-
'removeAll.occurrences.files.confirmation.message',
|
|
679
|
-
"Replace {0} occurrences across {1} files with '{2}'?",
|
|
680
|
-
occurrences,
|
|
681
|
-
fileCount,
|
|
682
|
-
replaceValue
|
|
683
|
-
));
|
|
684
|
-
}
|
|
685
|
-
return ( nls.localize(
|
|
686
|
-
'replaceAll.occurrences.files.confirmation.message',
|
|
687
|
-
"Replace {0} occurrences across {1} files?",
|
|
688
|
-
occurrences,
|
|
689
|
-
fileCount
|
|
690
|
-
));
|
|
691
|
-
}
|
|
692
|
-
clearMessage() {
|
|
693
|
-
this.searchWithoutFolderMessageElement = undefined;
|
|
694
|
-
const wasHidden = this.messagesElement.style.display === 'none';
|
|
695
|
-
dom.clearNode(this.messagesElement);
|
|
696
|
-
dom.show(this.messagesElement);
|
|
697
|
-
this.messageDisposables.clear();
|
|
698
|
-
const newMessage = dom.append(this.messagesElement, $('.message'));
|
|
699
|
-
if (wasHidden) {
|
|
700
|
-
this.reLayout();
|
|
701
|
-
}
|
|
702
|
-
return newMessage;
|
|
703
|
-
}
|
|
704
|
-
createSearchResultsView(container) {
|
|
705
|
-
this.resultsElement = dom.append(container, $('.results.show-file-icons.file-icon-themable-tree'));
|
|
706
|
-
const delegate = this.instantiationService.createInstance(SearchDelegate);
|
|
707
|
-
const identityProvider = {
|
|
708
|
-
getId(element) {
|
|
709
|
-
return element.id();
|
|
710
|
-
}
|
|
711
|
-
};
|
|
712
|
-
this.treeLabels = this._register(this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility }));
|
|
713
|
-
this.tree = this._register(this.instantiationService.createInstance(WorkbenchCompressibleObjectTree, 'SearchView', this.resultsElement, delegate, [
|
|
714
|
-
this._register(this.instantiationService.createInstance(FolderMatchRenderer, this, this.treeLabels)),
|
|
715
|
-
this._register(this.instantiationService.createInstance(FileMatchRenderer, this, this.treeLabels)),
|
|
716
|
-
this._register(this.instantiationService.createInstance(MatchRenderer, this.viewModel, this)),
|
|
717
|
-
], {
|
|
718
|
-
identityProvider,
|
|
719
|
-
accessibilityProvider: this.treeAccessibilityProvider,
|
|
720
|
-
dnd: this.instantiationService.createInstance(ResourceListDnDHandler, element => {
|
|
721
|
-
if (element instanceof FileMatch) {
|
|
722
|
-
return element.resource;
|
|
723
|
-
}
|
|
724
|
-
if (element instanceof Match) {
|
|
725
|
-
return withSelection(element.parent().resource, element.range());
|
|
726
|
-
}
|
|
727
|
-
return null;
|
|
728
|
-
}),
|
|
729
|
-
multipleSelectionSupport: true,
|
|
730
|
-
selectionNavigation: true,
|
|
731
|
-
overrideStyles: {
|
|
732
|
-
listBackground: this.getBackgroundColor()
|
|
733
|
-
},
|
|
734
|
-
paddingBottom: SearchDelegate.ITEM_HEIGHT
|
|
735
|
-
}));
|
|
736
|
-
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
|
737
|
-
const updateHasSomeCollapsible = () => this.toggleCollapseStateDelayer.trigger(() => this.hasSomeCollapsibleResultKey.set(this.hasSomeCollapsible()));
|
|
738
|
-
updateHasSomeCollapsible();
|
|
739
|
-
this._register(this.viewModel.onSearchResultChanged(() => updateHasSomeCollapsible()));
|
|
740
|
-
this._register(this.tree.onDidChangeCollapseState(() => updateHasSomeCollapsible()));
|
|
741
|
-
this._register(Event.debounce(this.tree.onDidOpen, (last, event) => event, DEBOUNCE_DELAY, true)(options => {
|
|
742
|
-
if (options.element instanceof Match) {
|
|
743
|
-
const selectedMatch = options.element;
|
|
744
|
-
this.currentSelectedFileMatch?.setSelectedMatch(null);
|
|
745
|
-
this.currentSelectedFileMatch = selectedMatch.parent();
|
|
746
|
-
this.currentSelectedFileMatch.setSelectedMatch(selectedMatch);
|
|
747
|
-
this.onFocus(selectedMatch, options.editorOptions.preserveFocus, options.sideBySide, options.editorOptions.pinned);
|
|
748
|
-
}
|
|
749
|
-
}));
|
|
750
|
-
this._register(Event.debounce(this.tree.onDidChangeFocus, (last, event) => event, DEBOUNCE_DELAY, true)(() => {
|
|
751
|
-
const selection = this.tree.getSelection();
|
|
752
|
-
const focus = this.tree.getFocus()[0];
|
|
753
|
-
if (selection.length > 1 && focus instanceof Match) {
|
|
754
|
-
this.onFocus(focus, true);
|
|
755
|
-
}
|
|
756
|
-
}));
|
|
757
|
-
this._register(Event.any(this.tree.onDidFocus, this.tree.onDidChangeFocus)(() => {
|
|
758
|
-
const focus = this.tree.getFocus()[0];
|
|
759
|
-
if (this.tree.isDOMFocused()) {
|
|
760
|
-
this.firstMatchFocused.set(this.tree.navigate().first() === focus);
|
|
761
|
-
this.fileMatchOrMatchFocused.set(!!focus);
|
|
762
|
-
this.fileMatchFocused.set(focus instanceof FileMatch);
|
|
763
|
-
this.folderMatchFocused.set(focus instanceof FolderMatch);
|
|
764
|
-
this.matchFocused.set(focus instanceof Match);
|
|
765
|
-
this.fileMatchOrFolderMatchFocus.set(focus instanceof FileMatch || focus instanceof FolderMatch);
|
|
766
|
-
this.fileMatchOrFolderMatchWithResourceFocus.set(focus instanceof FileMatch || focus instanceof FolderMatchWithResource);
|
|
767
|
-
this.folderMatchWithResourceFocused.set(focus instanceof FolderMatchWithResource);
|
|
768
|
-
this.lastFocusState = 'tree';
|
|
769
|
-
}
|
|
770
|
-
let editable = false;
|
|
771
|
-
if (focus instanceof Match) {
|
|
772
|
-
editable = (focus instanceof MatchInNotebook) ? !focus.isWebviewMatch() : true;
|
|
773
|
-
}
|
|
774
|
-
else if (focus instanceof FileMatch) {
|
|
775
|
-
editable = !focus.hasOnlyReadOnlyMatches();
|
|
776
|
-
}
|
|
777
|
-
else if (focus instanceof FolderMatch) {
|
|
778
|
-
editable = !focus.hasOnlyReadOnlyMatches();
|
|
779
|
-
}
|
|
780
|
-
this.isEditableItem.set(editable);
|
|
781
|
-
}));
|
|
782
|
-
this._register(this.tree.onDidBlur(() => {
|
|
783
|
-
this.firstMatchFocused.reset();
|
|
784
|
-
this.fileMatchOrMatchFocused.reset();
|
|
785
|
-
this.fileMatchFocused.reset();
|
|
786
|
-
this.folderMatchFocused.reset();
|
|
787
|
-
this.matchFocused.reset();
|
|
788
|
-
this.fileMatchOrFolderMatchFocus.reset();
|
|
789
|
-
this.fileMatchOrFolderMatchWithResourceFocus.reset();
|
|
790
|
-
this.folderMatchWithResourceFocused.reset();
|
|
791
|
-
this.isEditableItem.reset();
|
|
792
|
-
}));
|
|
793
|
-
}
|
|
794
|
-
onContextMenu(e) {
|
|
795
|
-
e.browserEvent.preventDefault();
|
|
796
|
-
e.browserEvent.stopPropagation();
|
|
797
|
-
this.contextMenuService.showContextMenu({
|
|
798
|
-
menuId: MenuId.SearchContext,
|
|
799
|
-
menuActionOptions: { shouldForwardArgs: true },
|
|
800
|
-
contextKeyService: this.contextKeyService,
|
|
801
|
-
getAnchor: () => e.anchor,
|
|
802
|
-
getActionsContext: () => e.element,
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
hasSomeCollapsible() {
|
|
806
|
-
const viewer = this.getControl();
|
|
807
|
-
const navigator = viewer.navigate();
|
|
808
|
-
let node = navigator.first();
|
|
809
|
-
do {
|
|
810
|
-
if (!viewer.isCollapsed(node)) {
|
|
811
|
-
return true;
|
|
812
|
-
}
|
|
813
|
-
} while (node = navigator.next());
|
|
814
|
-
return false;
|
|
815
|
-
}
|
|
816
|
-
selectNextMatch() {
|
|
817
|
-
if (!this.hasSearchResults()) {
|
|
818
|
-
return;
|
|
819
|
-
}
|
|
820
|
-
const [selected] = this.tree.getSelection();
|
|
821
|
-
if (selected && !(selected instanceof Match)) {
|
|
822
|
-
if (this.tree.isCollapsed(selected)) {
|
|
823
|
-
this.tree.expand(selected);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
const navigator = this.tree.navigate(selected);
|
|
827
|
-
let next = navigator.next();
|
|
828
|
-
if (!next) {
|
|
829
|
-
next = navigator.first();
|
|
830
|
-
}
|
|
831
|
-
while (next && !(next instanceof Match)) {
|
|
832
|
-
if (this.tree.isCollapsed(next)) {
|
|
833
|
-
this.tree.expand(next);
|
|
834
|
-
}
|
|
835
|
-
next = navigator.next();
|
|
836
|
-
}
|
|
837
|
-
if (next) {
|
|
838
|
-
if (next === selected) {
|
|
839
|
-
this.tree.setFocus([]);
|
|
840
|
-
}
|
|
841
|
-
const event = getSelectionKeyboardEvent(undefined, false, false);
|
|
842
|
-
this.tree.setFocus([next], event);
|
|
843
|
-
this.tree.setSelection([next], event);
|
|
844
|
-
this.tree.reveal(next);
|
|
845
|
-
const ariaLabel = this.treeAccessibilityProvider.getAriaLabel(next);
|
|
846
|
-
if (ariaLabel) {
|
|
847
|
-
aria.status(ariaLabel);
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
selectPreviousMatch() {
|
|
852
|
-
if (!this.hasSearchResults()) {
|
|
853
|
-
return;
|
|
854
|
-
}
|
|
855
|
-
const [selected] = this.tree.getSelection();
|
|
856
|
-
let navigator = this.tree.navigate(selected);
|
|
857
|
-
let prev = navigator.previous();
|
|
858
|
-
while (!prev || (!(prev instanceof Match) && !this.tree.isCollapsed(prev))) {
|
|
859
|
-
const nextPrev = prev ? navigator.previous() : navigator.last();
|
|
860
|
-
if (!prev && !nextPrev) {
|
|
861
|
-
return;
|
|
862
|
-
}
|
|
863
|
-
prev = nextPrev;
|
|
864
|
-
}
|
|
865
|
-
while (!(prev instanceof Match)) {
|
|
866
|
-
const nextItem = navigator.next();
|
|
867
|
-
this.tree.expand(prev);
|
|
868
|
-
navigator = this.tree.navigate(nextItem);
|
|
869
|
-
prev = nextItem ? navigator.previous() : navigator.last();
|
|
870
|
-
}
|
|
871
|
-
if (prev) {
|
|
872
|
-
if (prev === selected) {
|
|
873
|
-
this.tree.setFocus([]);
|
|
874
|
-
}
|
|
875
|
-
const event = getSelectionKeyboardEvent(undefined, false, false);
|
|
876
|
-
this.tree.setFocus([prev], event);
|
|
877
|
-
this.tree.setSelection([prev], event);
|
|
878
|
-
this.tree.reveal(prev);
|
|
879
|
-
const ariaLabel = this.treeAccessibilityProvider.getAriaLabel(prev);
|
|
880
|
-
if (ariaLabel) {
|
|
881
|
-
aria.status(ariaLabel);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
moveFocusToResults() {
|
|
886
|
-
this.tree.domFocus();
|
|
887
|
-
}
|
|
888
|
-
focus() {
|
|
889
|
-
super.focus();
|
|
890
|
-
if (this.lastFocusState === 'input' || !this.hasSearchResults()) {
|
|
891
|
-
const updatedText = this.searchConfig.seedOnFocus ? this.updateTextFromSelection({ allowSearchOnType: false }) : false;
|
|
892
|
-
this.searchWidget.focus(undefined, undefined, updatedText);
|
|
893
|
-
}
|
|
894
|
-
else {
|
|
895
|
-
this.tree.domFocus();
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
updateTextFromFindWidgetOrSelection({ allowUnselectedWord = true, allowSearchOnType = true }) {
|
|
899
|
-
let activeEditor = this.editorService.activeTextEditorControl;
|
|
900
|
-
if (isCodeEditor(activeEditor) && !activeEditor?.hasTextFocus()) {
|
|
901
|
-
const controller = CommonFindController.get(activeEditor);
|
|
902
|
-
if (controller && controller.isFindInputFocused()) {
|
|
903
|
-
return this.updateTextFromFindWidget(controller, { allowSearchOnType });
|
|
904
|
-
}
|
|
905
|
-
const editors = this.codeEditorService.listCodeEditors();
|
|
906
|
-
activeEditor = editors.find(editor => editor instanceof EmbeddedCodeEditorWidget && editor.getParentEditor() === activeEditor && editor.hasTextFocus())
|
|
907
|
-
?? activeEditor;
|
|
908
|
-
}
|
|
909
|
-
return this.updateTextFromSelection({ allowUnselectedWord, allowSearchOnType }, activeEditor);
|
|
910
|
-
}
|
|
911
|
-
updateTextFromFindWidget(controller, { allowSearchOnType = true }) {
|
|
912
|
-
if (!this.searchConfig.seedWithNearestWord && (window.getSelection()?.toString() ?? '') === '') {
|
|
913
|
-
return false;
|
|
914
|
-
}
|
|
915
|
-
const searchString = controller.getState().searchString;
|
|
916
|
-
if (searchString === '') {
|
|
917
|
-
return false;
|
|
918
|
-
}
|
|
919
|
-
this.searchWidget.searchInput?.setCaseSensitive(controller.getState().matchCase);
|
|
920
|
-
this.searchWidget.searchInput?.setWholeWords(controller.getState().wholeWord);
|
|
921
|
-
this.searchWidget.searchInput?.setRegex(controller.getState().isRegex);
|
|
922
|
-
this.updateText(searchString, allowSearchOnType);
|
|
923
|
-
return true;
|
|
924
|
-
}
|
|
925
|
-
updateTextFromSelection({ allowUnselectedWord = true, allowSearchOnType = true }, editor) {
|
|
926
|
-
const seedSearchStringFromSelection = this.configurationService.getValue('editor').find.seedSearchStringFromSelection;
|
|
927
|
-
if (!seedSearchStringFromSelection) {
|
|
928
|
-
return false;
|
|
929
|
-
}
|
|
930
|
-
let selectedText = this.getSearchTextFromEditor(allowUnselectedWord, editor);
|
|
931
|
-
if (selectedText === null) {
|
|
932
|
-
return false;
|
|
933
|
-
}
|
|
934
|
-
if (this.searchWidget.searchInput?.getRegex()) {
|
|
935
|
-
selectedText = strings.escapeRegExpCharacters(selectedText);
|
|
936
|
-
}
|
|
937
|
-
this.updateText(selectedText, allowSearchOnType);
|
|
938
|
-
return true;
|
|
939
|
-
}
|
|
940
|
-
updateText(text, allowSearchOnType = true) {
|
|
941
|
-
if (allowSearchOnType && !this.viewModel.searchResult.isDirty) {
|
|
942
|
-
this.searchWidget.setValue(text);
|
|
943
|
-
}
|
|
944
|
-
else {
|
|
945
|
-
this.pauseSearching = true;
|
|
946
|
-
this.searchWidget.setValue(text);
|
|
947
|
-
this.pauseSearching = false;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
focusNextInputBox() {
|
|
951
|
-
if (this.searchWidget.searchInputHasFocus()) {
|
|
952
|
-
if (this.searchWidget.isReplaceShown()) {
|
|
953
|
-
this.searchWidget.focus(true, true);
|
|
954
|
-
}
|
|
955
|
-
else {
|
|
956
|
-
this.moveFocusFromSearchOrReplace();
|
|
957
|
-
}
|
|
958
|
-
return;
|
|
959
|
-
}
|
|
960
|
-
if (this.searchWidget.replaceInputHasFocus()) {
|
|
961
|
-
this.moveFocusFromSearchOrReplace();
|
|
962
|
-
return;
|
|
963
|
-
}
|
|
964
|
-
if (this.inputPatternIncludes.inputHasFocus()) {
|
|
965
|
-
this.inputPatternExcludes.focus();
|
|
966
|
-
this.inputPatternExcludes.select();
|
|
967
|
-
return;
|
|
968
|
-
}
|
|
969
|
-
if (this.inputPatternExcludes.inputHasFocus()) {
|
|
970
|
-
this.selectTreeIfNotSelected();
|
|
971
|
-
return;
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
moveFocusFromSearchOrReplace() {
|
|
975
|
-
if (this.showsFileTypes()) {
|
|
976
|
-
this.toggleQueryDetails(true, this.showsFileTypes());
|
|
977
|
-
}
|
|
978
|
-
else {
|
|
979
|
-
this.selectTreeIfNotSelected();
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
focusPreviousInputBox() {
|
|
983
|
-
if (this.searchWidget.searchInputHasFocus()) {
|
|
984
|
-
return;
|
|
985
|
-
}
|
|
986
|
-
if (this.searchWidget.replaceInputHasFocus()) {
|
|
987
|
-
this.searchWidget.focus(true);
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
if (this.inputPatternIncludes.inputHasFocus()) {
|
|
991
|
-
this.searchWidget.focus(true, true);
|
|
992
|
-
return;
|
|
993
|
-
}
|
|
994
|
-
if (this.inputPatternExcludes.inputHasFocus()) {
|
|
995
|
-
this.inputPatternIncludes.focus();
|
|
996
|
-
this.inputPatternIncludes.select();
|
|
997
|
-
return;
|
|
998
|
-
}
|
|
999
|
-
if (this.tree.isDOMFocused()) {
|
|
1000
|
-
this.moveFocusFromResults();
|
|
1001
|
-
return;
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
moveFocusFromResults() {
|
|
1005
|
-
if (this.showsFileTypes()) {
|
|
1006
|
-
this.toggleQueryDetails(true, true, false, true);
|
|
1007
|
-
}
|
|
1008
|
-
else {
|
|
1009
|
-
this.searchWidget.focus(true, true);
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
reLayout() {
|
|
1013
|
-
if (this.isDisposed || !this.size) {
|
|
1014
|
-
return;
|
|
1015
|
-
}
|
|
1016
|
-
const actionsPosition = this.searchConfig.actionsPosition;
|
|
1017
|
-
this.getContainer().classList.toggle(SearchView_1.ACTIONS_RIGHT_CLASS_NAME, actionsPosition === 'right');
|
|
1018
|
-
this.searchWidget.setWidth(this.size.width - 28 );
|
|
1019
|
-
this.inputPatternExcludes.setWidth(this.size.width - 28 );
|
|
1020
|
-
this.inputPatternIncludes.setWidth(this.size.width - 28 );
|
|
1021
|
-
const widgetHeight = dom.getTotalHeight(this.searchWidgetsContainerElement);
|
|
1022
|
-
const messagesHeight = dom.getTotalHeight(this.messagesElement);
|
|
1023
|
-
this.tree.layout(this.size.height - widgetHeight - messagesHeight, this.size.width - 28);
|
|
1024
|
-
}
|
|
1025
|
-
layoutBody(height, width) {
|
|
1026
|
-
super.layoutBody(height, width);
|
|
1027
|
-
this.size = new dom.Dimension(width, height);
|
|
1028
|
-
this.reLayout();
|
|
1029
|
-
}
|
|
1030
|
-
getControl() {
|
|
1031
|
-
return this.tree;
|
|
1032
|
-
}
|
|
1033
|
-
allSearchFieldsClear() {
|
|
1034
|
-
return this.searchWidget.getReplaceValue() === '' &&
|
|
1035
|
-
(!this.searchWidget.searchInput || this.searchWidget.searchInput.getValue() === '');
|
|
1036
|
-
}
|
|
1037
|
-
allFilePatternFieldsClear() {
|
|
1038
|
-
return this.searchExcludePattern.getValue() === '' &&
|
|
1039
|
-
this.searchIncludePattern.getValue() === '';
|
|
1040
|
-
}
|
|
1041
|
-
hasSearchResults() {
|
|
1042
|
-
return !this.viewModel.searchResult.isEmpty();
|
|
1043
|
-
}
|
|
1044
|
-
clearSearchResults(clearInput = true) {
|
|
1045
|
-
this.viewModel.searchResult.clear();
|
|
1046
|
-
this.showEmptyStage(true);
|
|
1047
|
-
if (this.contextService.getWorkbenchState() === 1 ) {
|
|
1048
|
-
this.showSearchWithoutFolderMessage();
|
|
1049
|
-
}
|
|
1050
|
-
if (clearInput) {
|
|
1051
|
-
if (this.allSearchFieldsClear()) {
|
|
1052
|
-
this.clearFilePatternFields();
|
|
1053
|
-
}
|
|
1054
|
-
this.searchWidget.clear();
|
|
1055
|
-
}
|
|
1056
|
-
this.viewModel.cancelSearch();
|
|
1057
|
-
this.tree.ariaLabel = ( nls.localize('emptySearch', "Empty Search"));
|
|
1058
|
-
aria.status(( nls.localize('ariaSearchResultsClearStatus', "The search results have been cleared")));
|
|
1059
|
-
this.reLayout();
|
|
1060
|
-
}
|
|
1061
|
-
clearFilePatternFields() {
|
|
1062
|
-
this.searchExcludePattern.clear();
|
|
1063
|
-
this.searchIncludePattern.clear();
|
|
1064
|
-
}
|
|
1065
|
-
cancelSearch(focus = true) {
|
|
1066
|
-
if (this.viewModel.cancelSearch()) {
|
|
1067
|
-
if (focus) {
|
|
1068
|
-
this.searchWidget.focus();
|
|
1069
|
-
}
|
|
1070
|
-
return true;
|
|
1071
|
-
}
|
|
1072
|
-
return false;
|
|
1073
|
-
}
|
|
1074
|
-
selectTreeIfNotSelected() {
|
|
1075
|
-
if (this.tree.getNode(null)) {
|
|
1076
|
-
this.tree.domFocus();
|
|
1077
|
-
const selection = this.tree.getSelection();
|
|
1078
|
-
if (selection.length === 0) {
|
|
1079
|
-
const event = getSelectionKeyboardEvent();
|
|
1080
|
-
this.tree.focusNext(undefined, undefined, event);
|
|
1081
|
-
this.tree.setSelection(this.tree.getFocus(), event);
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
getSearchTextFromEditor(allowUnselectedWord, editor) {
|
|
1086
|
-
if (dom.isAncestor(document.activeElement, this.getContainer())) {
|
|
1087
|
-
return null;
|
|
1088
|
-
}
|
|
1089
|
-
editor = editor ?? this.editorService.activeTextEditorControl;
|
|
1090
|
-
if (isDiffEditor(editor)) {
|
|
1091
|
-
if (editor.getOriginalEditor().hasTextFocus()) {
|
|
1092
|
-
editor = editor.getOriginalEditor();
|
|
1093
|
-
}
|
|
1094
|
-
else {
|
|
1095
|
-
editor = editor.getModifiedEditor();
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
if (!isCodeEditor(editor) || !editor.hasModel()) {
|
|
1099
|
-
return null;
|
|
1100
|
-
}
|
|
1101
|
-
const range = editor.getSelection();
|
|
1102
|
-
if (!range) {
|
|
1103
|
-
return null;
|
|
1104
|
-
}
|
|
1105
|
-
if (range.isEmpty() && this.searchConfig.seedWithNearestWord && allowUnselectedWord) {
|
|
1106
|
-
const wordAtPosition = editor.getModel().getWordAtPosition(range.getStartPosition());
|
|
1107
|
-
if (wordAtPosition) {
|
|
1108
|
-
return wordAtPosition.word;
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
if (!range.isEmpty()) {
|
|
1112
|
-
let searchText = '';
|
|
1113
|
-
for (let i = range.startLineNumber; i <= range.endLineNumber; i++) {
|
|
1114
|
-
let lineText = editor.getModel().getLineContent(i);
|
|
1115
|
-
if (i === range.endLineNumber) {
|
|
1116
|
-
lineText = lineText.substring(0, range.endColumn - 1);
|
|
1117
|
-
}
|
|
1118
|
-
if (i === range.startLineNumber) {
|
|
1119
|
-
lineText = lineText.substring(range.startColumn - 1);
|
|
1120
|
-
}
|
|
1121
|
-
if (i !== range.startLineNumber) {
|
|
1122
|
-
lineText = '\n' + lineText;
|
|
1123
|
-
}
|
|
1124
|
-
searchText += lineText;
|
|
1125
|
-
}
|
|
1126
|
-
return searchText;
|
|
1127
|
-
}
|
|
1128
|
-
return null;
|
|
1129
|
-
}
|
|
1130
|
-
showsFileTypes() {
|
|
1131
|
-
return this.queryDetails.classList.contains('more');
|
|
1132
|
-
}
|
|
1133
|
-
toggleCaseSensitive() {
|
|
1134
|
-
this.searchWidget.searchInput?.setCaseSensitive(!this.searchWidget.searchInput.getCaseSensitive());
|
|
1135
|
-
this.triggerQueryChange();
|
|
1136
|
-
}
|
|
1137
|
-
toggleWholeWords() {
|
|
1138
|
-
this.searchWidget.searchInput?.setWholeWords(!this.searchWidget.searchInput.getWholeWords());
|
|
1139
|
-
this.triggerQueryChange();
|
|
1140
|
-
}
|
|
1141
|
-
toggleRegex() {
|
|
1142
|
-
this.searchWidget.searchInput?.setRegex(!this.searchWidget.searchInput.getRegex());
|
|
1143
|
-
this.triggerQueryChange();
|
|
1144
|
-
}
|
|
1145
|
-
togglePreserveCase() {
|
|
1146
|
-
this.searchWidget.replaceInput?.setPreserveCase(!this.searchWidget.replaceInput.getPreserveCase());
|
|
1147
|
-
this.triggerQueryChange();
|
|
1148
|
-
}
|
|
1149
|
-
setSearchParameters(args = {}) {
|
|
1150
|
-
if (typeof args.isCaseSensitive === 'boolean') {
|
|
1151
|
-
this.searchWidget.searchInput?.setCaseSensitive(args.isCaseSensitive);
|
|
1152
|
-
}
|
|
1153
|
-
if (typeof args.matchWholeWord === 'boolean') {
|
|
1154
|
-
this.searchWidget.searchInput?.setWholeWords(args.matchWholeWord);
|
|
1155
|
-
}
|
|
1156
|
-
if (typeof args.isRegex === 'boolean') {
|
|
1157
|
-
this.searchWidget.searchInput?.setRegex(args.isRegex);
|
|
1158
|
-
}
|
|
1159
|
-
if (typeof args.filesToInclude === 'string') {
|
|
1160
|
-
this.searchIncludePattern.setValue(String(args.filesToInclude));
|
|
1161
|
-
}
|
|
1162
|
-
if (typeof args.filesToExclude === 'string') {
|
|
1163
|
-
this.searchExcludePattern.setValue(String(args.filesToExclude));
|
|
1164
|
-
}
|
|
1165
|
-
if (typeof args.query === 'string') {
|
|
1166
|
-
this.searchWidget.searchInput?.setValue(args.query);
|
|
1167
|
-
}
|
|
1168
|
-
if (typeof args.replace === 'string') {
|
|
1169
|
-
this.searchWidget.replaceInput?.setValue(args.replace);
|
|
1170
|
-
}
|
|
1171
|
-
else {
|
|
1172
|
-
if (this.searchWidget.replaceInput && this.searchWidget.replaceInput.getValue() !== '') {
|
|
1173
|
-
this.searchWidget.replaceInput.setValue('');
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
if (typeof args.triggerSearch === 'boolean' && args.triggerSearch) {
|
|
1177
|
-
this.triggerQueryChange();
|
|
1178
|
-
}
|
|
1179
|
-
if (typeof args.preserveCase === 'boolean') {
|
|
1180
|
-
this.searchWidget.replaceInput?.setPreserveCase(args.preserveCase);
|
|
1181
|
-
}
|
|
1182
|
-
if (typeof args.useExcludeSettingsAndIgnoreFiles === 'boolean') {
|
|
1183
|
-
this.inputPatternExcludes.setUseExcludesAndIgnoreFiles(args.useExcludeSettingsAndIgnoreFiles);
|
|
1184
|
-
}
|
|
1185
|
-
if (typeof args.onlyOpenEditors === 'boolean') {
|
|
1186
|
-
this.searchIncludePattern.setOnlySearchInOpenEditors(args.onlyOpenEditors);
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
toggleQueryDetails(moveFocus = true, show, skipLayout, reverse) {
|
|
1190
|
-
const cls = 'more';
|
|
1191
|
-
show = typeof show === 'undefined' ? !this.queryDetails.classList.contains(cls) : Boolean(show);
|
|
1192
|
-
this.viewletState['query.queryDetailsExpanded'] = show;
|
|
1193
|
-
skipLayout = Boolean(skipLayout);
|
|
1194
|
-
if (show) {
|
|
1195
|
-
this.toggleQueryDetailsButton.setAttribute('aria-expanded', 'true');
|
|
1196
|
-
this.queryDetails.classList.add(cls);
|
|
1197
|
-
if (moveFocus) {
|
|
1198
|
-
if (reverse) {
|
|
1199
|
-
this.inputPatternExcludes.focus();
|
|
1200
|
-
this.inputPatternExcludes.select();
|
|
1201
|
-
}
|
|
1202
|
-
else {
|
|
1203
|
-
this.inputPatternIncludes.focus();
|
|
1204
|
-
this.inputPatternIncludes.select();
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
else {
|
|
1209
|
-
this.toggleQueryDetailsButton.setAttribute('aria-expanded', 'false');
|
|
1210
|
-
this.queryDetails.classList.remove(cls);
|
|
1211
|
-
if (moveFocus) {
|
|
1212
|
-
this.searchWidget.focus();
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
if (!skipLayout && this.size) {
|
|
1216
|
-
this.reLayout();
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
searchInFolders(folderPaths = []) {
|
|
1220
|
-
this._searchWithIncludeOrExclude(true, folderPaths);
|
|
1221
|
-
}
|
|
1222
|
-
searchOutsideOfFolders(folderPaths = []) {
|
|
1223
|
-
this._searchWithIncludeOrExclude(false, folderPaths);
|
|
1224
|
-
}
|
|
1225
|
-
_searchWithIncludeOrExclude(include, folderPaths) {
|
|
1226
|
-
if (!folderPaths.length || ( folderPaths.some(folderPath => folderPath === '.'))) {
|
|
1227
|
-
this.inputPatternIncludes.setValue('');
|
|
1228
|
-
this.searchWidget.focus();
|
|
1229
|
-
return;
|
|
1230
|
-
}
|
|
1231
|
-
if (!this.showsFileTypes()) {
|
|
1232
|
-
this.toggleQueryDetails(true, true);
|
|
1233
|
-
}
|
|
1234
|
-
(include ? this.inputPatternIncludes : this.inputPatternExcludes).setValue(folderPaths.join(', '));
|
|
1235
|
-
this.searchWidget.focus(false);
|
|
1236
|
-
}
|
|
1237
|
-
triggerQueryChange(_options) {
|
|
1238
|
-
const options = { preserveFocus: true, triggeredOnType: false, delay: 0, ..._options };
|
|
1239
|
-
if (options.triggeredOnType && !this.searchConfig.searchOnType) {
|
|
1240
|
-
return;
|
|
1241
|
-
}
|
|
1242
|
-
if (!this.pauseSearching) {
|
|
1243
|
-
const delay = options.triggeredOnType ? options.delay : 0;
|
|
1244
|
-
this.triggerQueryDelayer.trigger(() => {
|
|
1245
|
-
this._onQueryChanged(options.preserveFocus, options.triggeredOnType);
|
|
1246
|
-
}, delay);
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
_onQueryChanged(preserveFocus, triggeredOnType = false) {
|
|
1250
|
-
if (!(this.searchWidget.searchInput?.inputBox.isInputValid())) {
|
|
1251
|
-
return;
|
|
1252
|
-
}
|
|
1253
|
-
const isRegex = this.searchWidget.searchInput.getRegex();
|
|
1254
|
-
const isInNotebookMarkdownInput = this.searchWidget.getNotebookFilters().markupInput;
|
|
1255
|
-
const isInNotebookMarkdownPreview = this.searchWidget.getNotebookFilters().markupPreview;
|
|
1256
|
-
const isInNotebookCellInput = this.searchWidget.getNotebookFilters().codeInput;
|
|
1257
|
-
const isInNotebookCellOutput = this.searchWidget.getNotebookFilters().codeOutput;
|
|
1258
|
-
const isWholeWords = this.searchWidget.searchInput.getWholeWords();
|
|
1259
|
-
const isCaseSensitive = this.searchWidget.searchInput.getCaseSensitive();
|
|
1260
|
-
const contentPattern = this.searchWidget.searchInput.getValue();
|
|
1261
|
-
const excludePatternText = this.inputPatternExcludes.getValue().trim();
|
|
1262
|
-
const includePatternText = this.inputPatternIncludes.getValue().trim();
|
|
1263
|
-
const useExcludesAndIgnoreFiles = this.inputPatternExcludes.useExcludesAndIgnoreFiles();
|
|
1264
|
-
const onlySearchInOpenEditors = this.inputPatternIncludes.onlySearchInOpenEditors();
|
|
1265
|
-
if (contentPattern.length === 0) {
|
|
1266
|
-
this.clearSearchResults(false);
|
|
1267
|
-
this.clearMessage();
|
|
1268
|
-
return;
|
|
1269
|
-
}
|
|
1270
|
-
const content = {
|
|
1271
|
-
pattern: contentPattern,
|
|
1272
|
-
isRegExp: isRegex,
|
|
1273
|
-
isCaseSensitive: isCaseSensitive,
|
|
1274
|
-
isWordMatch: isWholeWords,
|
|
1275
|
-
notebookInfo: {
|
|
1276
|
-
isInNotebookMarkdownInput,
|
|
1277
|
-
isInNotebookMarkdownPreview,
|
|
1278
|
-
isInNotebookCellInput,
|
|
1279
|
-
isInNotebookCellOutput
|
|
1280
|
-
}
|
|
1281
|
-
};
|
|
1282
|
-
const excludePattern = this.inputPatternExcludes.getValue();
|
|
1283
|
-
const includePattern = this.inputPatternIncludes.getValue();
|
|
1284
|
-
const charsPerLine = content.isRegExp ? 10000 : 1000;
|
|
1285
|
-
const options = {
|
|
1286
|
-
_reason: 'searchView',
|
|
1287
|
-
extraFileResources: this.instantiationService.invokeFunction(getOutOfWorkspaceEditorResources),
|
|
1288
|
-
maxResults: this.searchConfig.maxResults ?? undefined,
|
|
1289
|
-
disregardIgnoreFiles: !useExcludesAndIgnoreFiles || undefined,
|
|
1290
|
-
disregardExcludeSettings: !useExcludesAndIgnoreFiles || undefined,
|
|
1291
|
-
onlyOpenEditors: onlySearchInOpenEditors,
|
|
1292
|
-
excludePattern,
|
|
1293
|
-
includePattern,
|
|
1294
|
-
previewOptions: {
|
|
1295
|
-
matchLines: 1,
|
|
1296
|
-
charsPerLine
|
|
1297
|
-
},
|
|
1298
|
-
isSmartCase: this.searchConfig.smartCase,
|
|
1299
|
-
expandPatterns: true
|
|
1300
|
-
};
|
|
1301
|
-
const folderResources = this.contextService.getWorkspace().folders;
|
|
1302
|
-
const onQueryValidationError = (err) => {
|
|
1303
|
-
this.searchWidget.searchInput?.showMessage({ content: err.message, type: 3 });
|
|
1304
|
-
this.viewModel.searchResult.clear();
|
|
1305
|
-
};
|
|
1306
|
-
let query;
|
|
1307
|
-
try {
|
|
1308
|
-
query = this.queryBuilder.text(content, ( folderResources.map(folder => folder.uri)), options);
|
|
1309
|
-
}
|
|
1310
|
-
catch (err) {
|
|
1311
|
-
onQueryValidationError(err);
|
|
1312
|
-
return;
|
|
1313
|
-
}
|
|
1314
|
-
this.validateQuery(query).then(() => {
|
|
1315
|
-
this.onQueryTriggered(query, options, excludePatternText, includePatternText, triggeredOnType);
|
|
1316
|
-
if (!preserveFocus) {
|
|
1317
|
-
this.searchWidget.focus(false, undefined, true);
|
|
1318
|
-
}
|
|
1319
|
-
}, onQueryValidationError);
|
|
1320
|
-
}
|
|
1321
|
-
validateQuery(query) {
|
|
1322
|
-
const folderQueriesExistP = ( query.folderQueries.map(fq => {
|
|
1323
|
-
return this.fileService.exists(fq.folder).catch(() => false);
|
|
1324
|
-
}));
|
|
1325
|
-
return Promise.all(folderQueriesExistP).then(existResults => {
|
|
1326
|
-
const existingFolderQueries = query.folderQueries.filter((folderQuery, i) => existResults[i]);
|
|
1327
|
-
if (!query.folderQueries.length || existingFolderQueries.length) {
|
|
1328
|
-
query.folderQueries = existingFolderQueries;
|
|
1329
|
-
}
|
|
1330
|
-
else {
|
|
1331
|
-
const nonExistantPath = query.folderQueries[0].folder.fsPath;
|
|
1332
|
-
const searchPathNotFoundError = ( nls.localize('searchPathNotFoundError', "Search path not found: {0}", nonExistantPath));
|
|
1333
|
-
return Promise.reject(( new Error(searchPathNotFoundError)));
|
|
1334
|
-
}
|
|
1335
|
-
return undefined;
|
|
1336
|
-
});
|
|
1337
|
-
}
|
|
1338
|
-
onQueryTriggered(query, options, excludePatternText, includePatternText, triggeredOnType) {
|
|
1339
|
-
this.addToSearchHistoryDelayer.trigger(() => {
|
|
1340
|
-
this.searchWidget.searchInput?.onSearchSubmit();
|
|
1341
|
-
this.inputPatternExcludes.onSearchSubmit();
|
|
1342
|
-
this.inputPatternIncludes.onSearchSubmit();
|
|
1343
|
-
});
|
|
1344
|
-
this.viewModel.cancelSearch(true);
|
|
1345
|
-
this.currentSearchQ = this.currentSearchQ
|
|
1346
|
-
.then(() => this.doSearch(query, excludePatternText, includePatternText, triggeredOnType))
|
|
1347
|
-
.then(() => undefined, () => undefined);
|
|
1348
|
-
}
|
|
1349
|
-
_updateResults() {
|
|
1350
|
-
if (this.state === SearchUIState.Idle) {
|
|
1351
|
-
return;
|
|
1352
|
-
}
|
|
1353
|
-
try {
|
|
1354
|
-
const fileCount = this.viewModel.searchResult.fileCount();
|
|
1355
|
-
if (this._visibleMatches !== fileCount) {
|
|
1356
|
-
this._visibleMatches = fileCount;
|
|
1357
|
-
this.refreshAndUpdateCount();
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
finally {
|
|
1361
|
-
this._refreshResultsScheduler.schedule();
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
doSearch(query, excludePatternText, includePatternText, triggeredOnType) {
|
|
1365
|
-
let progressComplete;
|
|
1366
|
-
this.progressService.withProgress({ location: this.getProgressLocation(), delay: triggeredOnType ? 300 : 0 }, _progress => {
|
|
1367
|
-
return ( new Promise(resolve => progressComplete = resolve));
|
|
1368
|
-
});
|
|
1369
|
-
this.searchWidget.searchInput?.clearMessage();
|
|
1370
|
-
this.state = SearchUIState.Searching;
|
|
1371
|
-
this.showEmptyStage();
|
|
1372
|
-
const slowTimer = setTimeout(() => {
|
|
1373
|
-
this.state = SearchUIState.SlowSearch;
|
|
1374
|
-
}, 2000);
|
|
1375
|
-
const onComplete = (completed) => {
|
|
1376
|
-
clearTimeout(slowTimer);
|
|
1377
|
-
this.state = SearchUIState.Idle;
|
|
1378
|
-
progressComplete();
|
|
1379
|
-
this.onSearchResultsChanged();
|
|
1380
|
-
const collapseResults = this.searchConfig.collapseResults;
|
|
1381
|
-
if (collapseResults !== 'alwaysCollapse' && this.viewModel.searchResult.matches().length === 1) {
|
|
1382
|
-
const onlyMatch = this.viewModel.searchResult.matches()[0];
|
|
1383
|
-
if (onlyMatch.count() < 50) {
|
|
1384
|
-
this.tree.expand(onlyMatch);
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
this.viewModel.replaceString = this.searchWidget.getReplaceValue();
|
|
1388
|
-
const hasResults = !this.viewModel.searchResult.isEmpty();
|
|
1389
|
-
if (completed?.exit === 1 ) {
|
|
1390
|
-
return;
|
|
1391
|
-
}
|
|
1392
|
-
if (!hasResults) {
|
|
1393
|
-
const hasExcludes = !!excludePatternText;
|
|
1394
|
-
const hasIncludes = !!includePatternText;
|
|
1395
|
-
let message;
|
|
1396
|
-
if (!completed) {
|
|
1397
|
-
message = SEARCH_CANCELLED_MESSAGE;
|
|
1398
|
-
}
|
|
1399
|
-
else if (this.inputPatternIncludes.onlySearchInOpenEditors()) {
|
|
1400
|
-
if (hasIncludes && hasExcludes) {
|
|
1401
|
-
message = ( nls.localize(
|
|
1402
|
-
'noOpenEditorResultsIncludesExcludes',
|
|
1403
|
-
"No results found in open editors matching '{0}' excluding '{1}' - ",
|
|
1404
|
-
includePatternText,
|
|
1405
|
-
excludePatternText
|
|
1406
|
-
));
|
|
1407
|
-
}
|
|
1408
|
-
else if (hasIncludes) {
|
|
1409
|
-
message = ( nls.localize(
|
|
1410
|
-
'noOpenEditorResultsIncludes',
|
|
1411
|
-
"No results found in open editors matching '{0}' - ",
|
|
1412
|
-
includePatternText
|
|
1413
|
-
));
|
|
1414
|
-
}
|
|
1415
|
-
else if (hasExcludes) {
|
|
1416
|
-
message = ( nls.localize(
|
|
1417
|
-
'noOpenEditorResultsExcludes',
|
|
1418
|
-
"No results found in open editors excluding '{0}' - ",
|
|
1419
|
-
excludePatternText
|
|
1420
|
-
));
|
|
1421
|
-
}
|
|
1422
|
-
else {
|
|
1423
|
-
message = ( nls.localize(
|
|
1424
|
-
'noOpenEditorResultsFound',
|
|
1425
|
-
"No results found in open editors. Review your settings for configured exclusions and check your gitignore files - "
|
|
1426
|
-
));
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
else {
|
|
1430
|
-
if (hasIncludes && hasExcludes) {
|
|
1431
|
-
message = ( nls.localize(
|
|
1432
|
-
'noResultsIncludesExcludes',
|
|
1433
|
-
"No results found in '{0}' excluding '{1}' - ",
|
|
1434
|
-
includePatternText,
|
|
1435
|
-
excludePatternText
|
|
1436
|
-
));
|
|
1437
|
-
}
|
|
1438
|
-
else if (hasIncludes) {
|
|
1439
|
-
message = ( nls.localize('noResultsIncludes', "No results found in '{0}' - ", includePatternText));
|
|
1440
|
-
}
|
|
1441
|
-
else if (hasExcludes) {
|
|
1442
|
-
message = ( nls.localize(
|
|
1443
|
-
'noResultsExcludes',
|
|
1444
|
-
"No results found excluding '{0}' - ",
|
|
1445
|
-
excludePatternText
|
|
1446
|
-
));
|
|
1447
|
-
}
|
|
1448
|
-
else {
|
|
1449
|
-
message = ( nls.localize(
|
|
1450
|
-
'noResultsFound',
|
|
1451
|
-
"No results found. Review your settings for configured exclusions and check your gitignore files - "
|
|
1452
|
-
));
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
aria.status(message);
|
|
1456
|
-
const messageEl = this.clearMessage();
|
|
1457
|
-
dom.append(messageEl, message);
|
|
1458
|
-
if (!completed) {
|
|
1459
|
-
const searchAgainButton = this.messageDisposables.add(( new SearchLinkButton(( nls.localize('rerunSearch.message', "Search again")), () => this.triggerQueryChange({ preserveFocus: false }))));
|
|
1460
|
-
dom.append(messageEl, searchAgainButton.element);
|
|
1461
|
-
}
|
|
1462
|
-
else if (hasIncludes || hasExcludes) {
|
|
1463
|
-
const searchAgainButton = this.messageDisposables.add(( new SearchLinkButton(( nls.localize('rerunSearchInAll.message', "Search again in all files")), this.onSearchAgain.bind(this))));
|
|
1464
|
-
dom.append(messageEl, searchAgainButton.element);
|
|
1465
|
-
}
|
|
1466
|
-
else {
|
|
1467
|
-
const openSettingsButton = this.messageDisposables.add(( new SearchLinkButton(( nls.localize('openSettings.message', "Open Settings")), this.onOpenSettings.bind(this))));
|
|
1468
|
-
dom.append(messageEl, openSettingsButton.element);
|
|
1469
|
-
}
|
|
1470
|
-
if (completed) {
|
|
1471
|
-
dom.append(messageEl, $('span', undefined, ' - '));
|
|
1472
|
-
const learnMoreButton = this.messageDisposables.add(( new SearchLinkButton(( nls.localize('openSettings.learnMore', "Learn More")), this.onLearnMore.bind(this))));
|
|
1473
|
-
dom.append(messageEl, learnMoreButton.element);
|
|
1474
|
-
}
|
|
1475
|
-
if (this.contextService.getWorkbenchState() === 1 ) {
|
|
1476
|
-
this.showSearchWithoutFolderMessage();
|
|
1477
|
-
}
|
|
1478
|
-
this.reLayout();
|
|
1479
|
-
}
|
|
1480
|
-
else {
|
|
1481
|
-
this.viewModel.searchResult.toggleHighlights(this.isVisible());
|
|
1482
|
-
aria.status(( nls.localize(
|
|
1483
|
-
'ariaSearchResultsStatus',
|
|
1484
|
-
"Search returned {0} results in {1} files",
|
|
1485
|
-
this.viewModel.searchResult.count(),
|
|
1486
|
-
this.viewModel.searchResult.fileCount()
|
|
1487
|
-
)));
|
|
1488
|
-
}
|
|
1489
|
-
if (completed && completed.limitHit) {
|
|
1490
|
-
completed.messages.push({ type: TextSearchCompleteMessageType.Warning, text: ( nls.localize(
|
|
1491
|
-
'searchMaxResultsWarning',
|
|
1492
|
-
"The result set only contains a subset of all matches. Be more specific in your search to narrow down the results."
|
|
1493
|
-
)) });
|
|
1494
|
-
}
|
|
1495
|
-
if (completed && completed.messages) {
|
|
1496
|
-
for (const message of completed.messages) {
|
|
1497
|
-
this.addMessage(message);
|
|
1498
|
-
}
|
|
1499
|
-
}
|
|
1500
|
-
this.reLayout();
|
|
1501
|
-
};
|
|
1502
|
-
const onError = (e) => {
|
|
1503
|
-
clearTimeout(slowTimer);
|
|
1504
|
-
this.state = SearchUIState.Idle;
|
|
1505
|
-
if (errors.isCancellationError(e)) {
|
|
1506
|
-
return onComplete(undefined);
|
|
1507
|
-
}
|
|
1508
|
-
else {
|
|
1509
|
-
progressComplete();
|
|
1510
|
-
this.searchWidget.searchInput?.showMessage({ content: e.message, type: 3 });
|
|
1511
|
-
this.viewModel.searchResult.clear();
|
|
1512
|
-
return Promise.resolve();
|
|
1513
|
-
}
|
|
1514
|
-
};
|
|
1515
|
-
this._visibleMatches = 0;
|
|
1516
|
-
this._refreshResultsScheduler.schedule();
|
|
1517
|
-
this.searchWidget.setReplaceAllActionState(false);
|
|
1518
|
-
this.tree.setSelection([]);
|
|
1519
|
-
this.tree.setFocus([]);
|
|
1520
|
-
const result = this.viewModel.search(query);
|
|
1521
|
-
return result.asyncResults.then(onComplete, onError);
|
|
1522
|
-
}
|
|
1523
|
-
onOpenSettings(e) {
|
|
1524
|
-
dom.EventHelper.stop(e, false);
|
|
1525
|
-
this.openSettings('@id:files.exclude,search.exclude,search.useParentIgnoreFiles,search.useGlobalIgnoreFiles,search.useIgnoreFiles');
|
|
1526
|
-
}
|
|
1527
|
-
openSettings(query) {
|
|
1528
|
-
const options = { query };
|
|
1529
|
-
return this.contextService.getWorkbenchState() !== 1 ?
|
|
1530
|
-
this.preferencesService.openWorkspaceSettings(options) :
|
|
1531
|
-
this.preferencesService.openUserSettings(options);
|
|
1532
|
-
}
|
|
1533
|
-
onLearnMore() {
|
|
1534
|
-
this.openerService.open(( URI.parse('https://go.microsoft.com/fwlink/?linkid=853977')));
|
|
1535
|
-
}
|
|
1536
|
-
onSearchAgain() {
|
|
1537
|
-
this.inputPatternExcludes.setValue('');
|
|
1538
|
-
this.inputPatternIncludes.setValue('');
|
|
1539
|
-
this.inputPatternIncludes.setOnlySearchInOpenEditors(false);
|
|
1540
|
-
this.triggerQueryChange({ preserveFocus: false });
|
|
1541
|
-
}
|
|
1542
|
-
onEnableExcludes() {
|
|
1543
|
-
this.toggleQueryDetails(false, true);
|
|
1544
|
-
this.searchExcludePattern.setUseExcludesAndIgnoreFiles(true);
|
|
1545
|
-
}
|
|
1546
|
-
onDisableSearchInOpenEditors() {
|
|
1547
|
-
this.toggleQueryDetails(false, true);
|
|
1548
|
-
this.inputPatternIncludes.setOnlySearchInOpenEditors(false);
|
|
1549
|
-
}
|
|
1550
|
-
updateSearchResultCount(disregardExcludesAndIgnores, onlyOpenEditors, clear = false) {
|
|
1551
|
-
const fileCount = this.viewModel.searchResult.fileCount();
|
|
1552
|
-
this.hasSearchResultsKey.set(fileCount > 0);
|
|
1553
|
-
const msgWasHidden = this.messagesElement.style.display === 'none';
|
|
1554
|
-
const messageEl = this.clearMessage();
|
|
1555
|
-
const resultMsg = clear ? '' : this.buildResultCountMessage(this.viewModel.searchResult.count(), fileCount);
|
|
1556
|
-
this.tree.ariaLabel = resultMsg + ( nls.localize(
|
|
1557
|
-
'forTerm',
|
|
1558
|
-
" - Search: {0}",
|
|
1559
|
-
this.searchResult.query?.contentPattern.pattern ?? ''
|
|
1560
|
-
));
|
|
1561
|
-
dom.append(messageEl, resultMsg);
|
|
1562
|
-
if (fileCount > 0) {
|
|
1563
|
-
if (disregardExcludesAndIgnores) {
|
|
1564
|
-
const excludesDisabledMessage = ' - ' + ( nls.localize(
|
|
1565
|
-
'useIgnoresAndExcludesDisabled',
|
|
1566
|
-
"exclude settings and ignore files are disabled"
|
|
1567
|
-
)) + ' ';
|
|
1568
|
-
const enableExcludesButton = this.messageDisposables.add(( new SearchLinkButton(( nls.localize('excludes.enable', "enable")), this.onEnableExcludes.bind(this), ( nls.localize(
|
|
1569
|
-
'useExcludesAndIgnoreFilesDescription',
|
|
1570
|
-
"Use Exclude Settings and Ignore Files"
|
|
1571
|
-
)))));
|
|
1572
|
-
dom.append(messageEl, $('span', undefined, excludesDisabledMessage, '(', enableExcludesButton.element, ')'));
|
|
1573
|
-
}
|
|
1574
|
-
if (onlyOpenEditors) {
|
|
1575
|
-
const searchingInOpenMessage = ' - ' + ( nls.localize('onlyOpenEditors', "searching only in open files")) + ' ';
|
|
1576
|
-
const disableOpenEditorsButton = this.messageDisposables.add(( new SearchLinkButton(( nls.localize('openEditors.disable', "disable")), this.onDisableSearchInOpenEditors.bind(this), ( nls.localize('disableOpenEditors', "Search in entire workspace")))));
|
|
1577
|
-
dom.append(messageEl, $('span', undefined, searchingInOpenMessage, '(', disableOpenEditorsButton.element, ')'));
|
|
1578
|
-
}
|
|
1579
|
-
dom.append(messageEl, ' - ');
|
|
1580
|
-
const openInEditorTooltip = appendKeyBindingLabel(( nls.localize('openInEditor.tooltip', "Copy current search results to an editor")), this.keybindingService.lookupKeybinding(OpenInEditorCommandId));
|
|
1581
|
-
const openInEditorButton = this.messageDisposables.add(( new SearchLinkButton(( nls.localize('openInEditor.message', "Open in editor")), () => this.instantiationService.invokeFunction(createEditorFromSearchResult, this.searchResult, this.searchIncludePattern.getValue(), this.searchExcludePattern.getValue(), this.searchIncludePattern.onlySearchInOpenEditors()), openInEditorTooltip)));
|
|
1582
|
-
dom.append(messageEl, openInEditorButton.element);
|
|
1583
|
-
this.reLayout();
|
|
1584
|
-
}
|
|
1585
|
-
else if (!msgWasHidden) {
|
|
1586
|
-
dom.hide(this.messagesElement);
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
addMessage(message) {
|
|
1590
|
-
const messageBox = this.messagesElement.firstChild;
|
|
1591
|
-
if (!messageBox) {
|
|
1592
|
-
return;
|
|
1593
|
-
}
|
|
1594
|
-
dom.append(messageBox, renderSearchMessage(message, this.instantiationService, this.notificationService, this.openerService, this.commandService, this.messageDisposables, () => this.triggerQueryChange()));
|
|
1595
|
-
}
|
|
1596
|
-
buildResultCountMessage(resultCount, fileCount) {
|
|
1597
|
-
if (resultCount === 1 && fileCount === 1) {
|
|
1598
|
-
return ( nls.localize('search.file.result', "{0} result in {1} file", resultCount, fileCount));
|
|
1599
|
-
}
|
|
1600
|
-
else if (resultCount === 1) {
|
|
1601
|
-
return ( nls.localize('search.files.result', "{0} result in {1} files", resultCount, fileCount));
|
|
1602
|
-
}
|
|
1603
|
-
else if (fileCount === 1) {
|
|
1604
|
-
return ( nls.localize('search.file.results', "{0} results in {1} file", resultCount, fileCount));
|
|
1605
|
-
}
|
|
1606
|
-
else {
|
|
1607
|
-
return ( nls.localize('search.files.results', "{0} results in {1} files", resultCount, fileCount));
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
showSearchWithoutFolderMessage() {
|
|
1611
|
-
this.searchWithoutFolderMessageElement = this.clearMessage();
|
|
1612
|
-
const textEl = dom.append(this.searchWithoutFolderMessageElement, $('p', undefined, ( nls.localize(
|
|
1613
|
-
'searchWithoutFolder',
|
|
1614
|
-
"You have not opened or specified a folder. Only open files are currently searched - "
|
|
1615
|
-
))));
|
|
1616
|
-
const openFolderButton = this.messageDisposables.add(( new SearchLinkButton(( nls.localize('openFolder', "Open Folder")), () => {
|
|
1617
|
-
this.commandService.executeCommand(platform.isMacintosh && platform.isNative ? OpenFileFolderAction.ID : OpenFolderAction.ID).catch(err => errors.onUnexpectedError(err));
|
|
1618
|
-
})));
|
|
1619
|
-
dom.append(textEl, openFolderButton.element);
|
|
1620
|
-
}
|
|
1621
|
-
showEmptyStage(forceHideMessages = false) {
|
|
1622
|
-
const showingCancelled = (this.messagesElement.firstChild?.textContent?.indexOf(SEARCH_CANCELLED_MESSAGE) ?? -1) > -1;
|
|
1623
|
-
if (showingCancelled || forceHideMessages || !this.configurationService.getValue().search.searchOnType) {
|
|
1624
|
-
dom.hide(this.messagesElement);
|
|
1625
|
-
}
|
|
1626
|
-
dom.show(this.resultsElement);
|
|
1627
|
-
this.currentSelectedFileMatch = undefined;
|
|
1628
|
-
}
|
|
1629
|
-
shouldOpenInNotebookEditor(match, uri) {
|
|
1630
|
-
return match instanceof MatchInNotebook || (uri.scheme !== network.Schemas.untitled && this.notebookService.getContributedNotebookTypes(uri).length > 0);
|
|
1631
|
-
}
|
|
1632
|
-
onFocus(lineMatch, preserveFocus, sideBySide, pinned) {
|
|
1633
|
-
const useReplacePreview = this.configurationService.getValue().search.useReplacePreview;
|
|
1634
|
-
const resource = lineMatch instanceof Match ? lineMatch.parent().resource : lineMatch.resource;
|
|
1635
|
-
return (useReplacePreview && this.viewModel.isReplaceActive() && !!this.viewModel.replaceString && !(this.shouldOpenInNotebookEditor(lineMatch, resource))) ?
|
|
1636
|
-
this.replaceService.openReplacePreview(lineMatch, preserveFocus, sideBySide, pinned) :
|
|
1637
|
-
this.open(lineMatch, preserveFocus, sideBySide, pinned, resource);
|
|
1638
|
-
}
|
|
1639
|
-
async open(element, preserveFocus, sideBySide, pinned, resourceInput) {
|
|
1640
|
-
const selection = getEditorSelectionFromMatch(element, this.viewModel);
|
|
1641
|
-
const oldParentMatches = element instanceof Match ? element.parent().matches() : [];
|
|
1642
|
-
const resource = resourceInput ?? (element instanceof Match ? element.parent().resource : element.resource);
|
|
1643
|
-
let editor;
|
|
1644
|
-
const options = {
|
|
1645
|
-
preserveFocus,
|
|
1646
|
-
pinned,
|
|
1647
|
-
selection,
|
|
1648
|
-
revealIfVisible: true,
|
|
1649
|
-
};
|
|
1650
|
-
try {
|
|
1651
|
-
editor = await this.editorService.openEditor({
|
|
1652
|
-
resource: resource,
|
|
1653
|
-
options,
|
|
1654
|
-
}, sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
|
|
1655
|
-
const editorControl = editor?.getControl();
|
|
1656
|
-
if (element instanceof Match && preserveFocus && isCodeEditor(editorControl)) {
|
|
1657
|
-
this.viewModel.searchResult.rangeHighlightDecorations.highlightRange(editorControl.getModel(), element.range());
|
|
1658
|
-
}
|
|
1659
|
-
else {
|
|
1660
|
-
this.viewModel.searchResult.rangeHighlightDecorations.removeHighlightRange();
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
catch (err) {
|
|
1664
|
-
errors.onUnexpectedError(err);
|
|
1665
|
-
return;
|
|
1666
|
-
}
|
|
1667
|
-
if (editor instanceof NotebookEditor) {
|
|
1668
|
-
const elemParent = element.parent();
|
|
1669
|
-
if (element instanceof Match) {
|
|
1670
|
-
if (element instanceof MatchInNotebook) {
|
|
1671
|
-
element.parent().showMatch(element);
|
|
1672
|
-
}
|
|
1673
|
-
else {
|
|
1674
|
-
const editorWidget = editor.getControl();
|
|
1675
|
-
if (editorWidget) {
|
|
1676
|
-
elemParent.bindNotebookEditorWidget(editorWidget);
|
|
1677
|
-
await elemParent.updateMatchesForEditorWidget();
|
|
1678
|
-
const matchIndex = oldParentMatches.findIndex(e => e.id() === element.id());
|
|
1679
|
-
const matches = elemParent.matches();
|
|
1680
|
-
const match = matchIndex >= matches.length ? matches[matches.length - 1] : matches[matchIndex];
|
|
1681
|
-
if (match instanceof MatchInNotebook) {
|
|
1682
|
-
elemParent.showMatch(match);
|
|
1683
|
-
if (!this.tree.getFocus().includes(match) || !this.tree.getSelection().includes(match)) {
|
|
1684
|
-
this.tree.setSelection([match], getSelectionKeyboardEvent());
|
|
1685
|
-
this.tree.setFocus([match]);
|
|
1686
|
-
}
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
openEditorWithMultiCursor(element) {
|
|
1694
|
-
const resource = element instanceof Match ? element.parent().resource : element.resource;
|
|
1695
|
-
return this.editorService.openEditor({
|
|
1696
|
-
resource: resource,
|
|
1697
|
-
options: {
|
|
1698
|
-
preserveFocus: false,
|
|
1699
|
-
pinned: true,
|
|
1700
|
-
revealIfVisible: true
|
|
1701
|
-
}
|
|
1702
|
-
}).then(editor => {
|
|
1703
|
-
if (editor) {
|
|
1704
|
-
let fileMatch = null;
|
|
1705
|
-
if (element instanceof FileMatch) {
|
|
1706
|
-
fileMatch = element;
|
|
1707
|
-
}
|
|
1708
|
-
else if (element instanceof Match) {
|
|
1709
|
-
fileMatch = element.parent();
|
|
1710
|
-
}
|
|
1711
|
-
if (fileMatch) {
|
|
1712
|
-
const selections = ( fileMatch.matches().map(m => ( new Selection(
|
|
1713
|
-
m.range().startLineNumber,
|
|
1714
|
-
m.range().startColumn,
|
|
1715
|
-
m.range().endLineNumber,
|
|
1716
|
-
m.range().endColumn
|
|
1717
|
-
))));
|
|
1718
|
-
const codeEditor = getCodeEditor(editor.getControl());
|
|
1719
|
-
if (codeEditor) {
|
|
1720
|
-
const multiCursorController = MultiCursorSelectionController.get(codeEditor);
|
|
1721
|
-
multiCursorController?.selectAllUsingSelections(selections);
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
}
|
|
1725
|
-
this.viewModel.searchResult.rangeHighlightDecorations.removeHighlightRange();
|
|
1726
|
-
}, errors.onUnexpectedError);
|
|
1727
|
-
}
|
|
1728
|
-
onUntitledDidDispose(resource) {
|
|
1729
|
-
if (!this.viewModel) {
|
|
1730
|
-
return;
|
|
1731
|
-
}
|
|
1732
|
-
const matches = this.viewModel.searchResult.matches();
|
|
1733
|
-
for (let i = 0, len = matches.length; i < len; i++) {
|
|
1734
|
-
if (( resource.toString()) === ( matches[i].resource.toString())) {
|
|
1735
|
-
this.viewModel.searchResult.remove(matches[i]);
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
onFilesChanged(e) {
|
|
1740
|
-
if (!this.viewModel || (this.searchConfig.sortOrder !== "modified" && !e.gotDeleted())) {
|
|
1741
|
-
return;
|
|
1742
|
-
}
|
|
1743
|
-
const matches = this.viewModel.searchResult.matches();
|
|
1744
|
-
if (e.gotDeleted()) {
|
|
1745
|
-
const deletedMatches = matches.filter(m => e.contains(m.resource, 2 ));
|
|
1746
|
-
this.viewModel.searchResult.remove(deletedMatches);
|
|
1747
|
-
}
|
|
1748
|
-
else {
|
|
1749
|
-
const changedMatches = matches.filter(m => e.contains(m.resource));
|
|
1750
|
-
if (changedMatches.length && this.searchConfig.sortOrder === "modified" ) {
|
|
1751
|
-
this.updateFileStats(changedMatches).then(() => this.refreshTree());
|
|
1752
|
-
}
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
get searchConfig() {
|
|
1756
|
-
return this.configurationService.getValue('search');
|
|
1757
|
-
}
|
|
1758
|
-
clearHistory() {
|
|
1759
|
-
this.searchWidget.clearHistory();
|
|
1760
|
-
this.inputPatternExcludes.clearHistory();
|
|
1761
|
-
this.inputPatternIncludes.clearHistory();
|
|
1762
|
-
}
|
|
1763
|
-
saveState() {
|
|
1764
|
-
if (!this.searchWidget) {
|
|
1765
|
-
return;
|
|
1766
|
-
}
|
|
1767
|
-
const patternExcludes = this.inputPatternExcludes?.getValue().trim() ?? '';
|
|
1768
|
-
const patternIncludes = this.inputPatternIncludes?.getValue().trim() ?? '';
|
|
1769
|
-
const onlyOpenEditors = this.inputPatternIncludes?.onlySearchInOpenEditors() ?? false;
|
|
1770
|
-
const useExcludesAndIgnoreFiles = this.inputPatternExcludes?.useExcludesAndIgnoreFiles() ?? true;
|
|
1771
|
-
const preserveCase = this.viewModel.preserveCase;
|
|
1772
|
-
if (this.searchWidget.searchInput) {
|
|
1773
|
-
const isRegex = this.searchWidget.searchInput.getRegex();
|
|
1774
|
-
const isWholeWords = this.searchWidget.searchInput.getWholeWords();
|
|
1775
|
-
const isCaseSensitive = this.searchWidget.searchInput.getCaseSensitive();
|
|
1776
|
-
const contentPattern = this.searchWidget.searchInput.getValue();
|
|
1777
|
-
const isInNotebookCellInput = this.searchWidget.getNotebookFilters().codeInput;
|
|
1778
|
-
const isInNotebookCellOutput = this.searchWidget.getNotebookFilters().codeOutput;
|
|
1779
|
-
const isInNotebookMarkdownInput = this.searchWidget.getNotebookFilters().markupInput;
|
|
1780
|
-
const isInNotebookMarkdownPreview = this.searchWidget.getNotebookFilters().markupPreview;
|
|
1781
|
-
this.viewletState['query.contentPattern'] = contentPattern;
|
|
1782
|
-
this.viewletState['query.regex'] = isRegex;
|
|
1783
|
-
this.viewletState['query.wholeWords'] = isWholeWords;
|
|
1784
|
-
this.viewletState['query.caseSensitive'] = isCaseSensitive;
|
|
1785
|
-
this.viewletState['query.isInNotebookMarkdownInput'] = isInNotebookMarkdownInput;
|
|
1786
|
-
this.viewletState['query.isInNotebookMarkdownPreview'] = isInNotebookMarkdownPreview;
|
|
1787
|
-
this.viewletState['query.isInNotebookCellInput'] = isInNotebookCellInput;
|
|
1788
|
-
this.viewletState['query.isInNotebookCellOutput'] = isInNotebookCellOutput;
|
|
1789
|
-
}
|
|
1790
|
-
this.viewletState['query.folderExclusions'] = patternExcludes;
|
|
1791
|
-
this.viewletState['query.folderIncludes'] = patternIncludes;
|
|
1792
|
-
this.viewletState['query.useExcludesAndIgnoreFiles'] = useExcludesAndIgnoreFiles;
|
|
1793
|
-
this.viewletState['query.preserveCase'] = preserveCase;
|
|
1794
|
-
this.viewletState['query.onlyOpenEditors'] = onlyOpenEditors;
|
|
1795
|
-
const isReplaceShown = this.searchAndReplaceWidget.isReplaceShown();
|
|
1796
|
-
this.viewletState['view.showReplace'] = isReplaceShown;
|
|
1797
|
-
this.viewletState['view.treeLayout'] = this.isTreeLayoutViewVisible;
|
|
1798
|
-
this.viewletState['query.replaceText'] = isReplaceShown && this.searchWidget.getReplaceValue();
|
|
1799
|
-
this._saveSearchHistoryService();
|
|
1800
|
-
this.memento.saveMemento();
|
|
1801
|
-
super.saveState();
|
|
1802
|
-
}
|
|
1803
|
-
_saveSearchHistoryService() {
|
|
1804
|
-
const history = Object.create(null);
|
|
1805
|
-
const searchHistory = this.searchWidget.getSearchHistory();
|
|
1806
|
-
if (searchHistory && searchHistory.length) {
|
|
1807
|
-
history.search = searchHistory;
|
|
1808
|
-
}
|
|
1809
|
-
const replaceHistory = this.searchWidget.getReplaceHistory();
|
|
1810
|
-
if (replaceHistory && replaceHistory.length) {
|
|
1811
|
-
history.replace = replaceHistory;
|
|
1812
|
-
}
|
|
1813
|
-
const patternExcludesHistory = this.inputPatternExcludes.getHistory();
|
|
1814
|
-
if (patternExcludesHistory && patternExcludesHistory.length) {
|
|
1815
|
-
history.exclude = patternExcludesHistory;
|
|
1816
|
-
}
|
|
1817
|
-
const patternIncludesHistory = this.inputPatternIncludes.getHistory();
|
|
1818
|
-
if (patternIncludesHistory && patternIncludesHistory.length) {
|
|
1819
|
-
history.include = patternIncludesHistory;
|
|
1820
|
-
}
|
|
1821
|
-
this.searchHistoryService.save(history);
|
|
1822
|
-
}
|
|
1823
|
-
async retrieveFileStats() {
|
|
1824
|
-
const files = ( this.searchResult.matches().filter(f => !f.fileStat).map(f => f.resolveFileStat(this.fileService)));
|
|
1825
|
-
await Promise.all(files);
|
|
1826
|
-
}
|
|
1827
|
-
async updateFileStats(elements) {
|
|
1828
|
-
const files = ( elements.map(f => f.resolveFileStat(this.fileService)));
|
|
1829
|
-
await Promise.all(files);
|
|
1830
|
-
}
|
|
1831
|
-
removeFileStats() {
|
|
1832
|
-
for (const fileMatch of this.searchResult.matches()) {
|
|
1833
|
-
fileMatch.fileStat = undefined;
|
|
1834
|
-
}
|
|
1835
|
-
}
|
|
1836
|
-
dispose() {
|
|
1837
|
-
this.isDisposed = true;
|
|
1838
|
-
this.saveState();
|
|
1839
|
-
super.dispose();
|
|
1840
|
-
}
|
|
1841
|
-
};
|
|
1842
|
-
SearchView = SearchView_1 = ( __decorate([
|
|
1843
|
-
( __param(1, IFileService)),
|
|
1844
|
-
( __param(2, IEditorService)),
|
|
1845
|
-
( __param(3, ICodeEditorService)),
|
|
1846
|
-
( __param(4, IProgressService)),
|
|
1847
|
-
( __param(5, INotificationService)),
|
|
1848
|
-
( __param(6, IDialogService)),
|
|
1849
|
-
( __param(7, ICommandService)),
|
|
1850
|
-
( __param(8, IContextViewService)),
|
|
1851
|
-
( __param(9, IInstantiationService)),
|
|
1852
|
-
( __param(10, IViewDescriptorService)),
|
|
1853
|
-
( __param(11, IConfigurationService)),
|
|
1854
|
-
( __param(12, IWorkspaceContextService)),
|
|
1855
|
-
( __param(13, ISearchViewModelWorkbenchService)),
|
|
1856
|
-
( __param(14, IContextKeyService)),
|
|
1857
|
-
( __param(15, IReplaceService)),
|
|
1858
|
-
( __param(16, ITextFileService)),
|
|
1859
|
-
( __param(17, IPreferencesService)),
|
|
1860
|
-
( __param(18, IThemeService)),
|
|
1861
|
-
( __param(19, ISearchHistoryService)),
|
|
1862
|
-
( __param(20, IContextMenuService)),
|
|
1863
|
-
( __param(21, IAccessibilityService)),
|
|
1864
|
-
( __param(22, IKeybindingService)),
|
|
1865
|
-
( __param(23, IStorageService)),
|
|
1866
|
-
( __param(24, IOpenerService)),
|
|
1867
|
-
( __param(25, ITelemetryService)),
|
|
1868
|
-
( __param(26, INotebookService)),
|
|
1869
|
-
( __param(27, ILogService))
|
|
1870
|
-
], SearchView));
|
|
1871
|
-
class SearchLinkButton extends Disposable {
|
|
1872
|
-
constructor(label, handler, tooltip) {
|
|
1873
|
-
super();
|
|
1874
|
-
this.element = $('a.pointer', { tabindex: 0, title: tooltip }, label);
|
|
1875
|
-
this.addEventHandlers(handler);
|
|
1876
|
-
}
|
|
1877
|
-
addEventHandlers(handler) {
|
|
1878
|
-
const wrappedHandler = (e) => {
|
|
1879
|
-
dom.EventHelper.stop(e, false);
|
|
1880
|
-
handler(e);
|
|
1881
|
-
};
|
|
1882
|
-
this._register(dom.addDisposableListener(this.element, dom.EventType.CLICK, wrappedHandler));
|
|
1883
|
-
this._register(dom.addDisposableListener(this.element, dom.EventType.KEY_DOWN, e => {
|
|
1884
|
-
const event = ( new StandardKeyboardEvent(e));
|
|
1885
|
-
if (event.equals(10 ) || event.equals(3 )) {
|
|
1886
|
-
wrappedHandler(e);
|
|
1887
|
-
event.preventDefault();
|
|
1888
|
-
event.stopPropagation();
|
|
1889
|
-
}
|
|
1890
|
-
}));
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
function getEditorSelectionFromMatch(element, viewModel) {
|
|
1894
|
-
let match = null;
|
|
1895
|
-
if (element instanceof Match) {
|
|
1896
|
-
match = element;
|
|
1897
|
-
}
|
|
1898
|
-
if (element instanceof FileMatch && element.count() > 0) {
|
|
1899
|
-
match = element.matches()[element.matches().length - 1];
|
|
1900
|
-
}
|
|
1901
|
-
if (match) {
|
|
1902
|
-
const range = match.range();
|
|
1903
|
-
if (viewModel.isReplaceActive() && !!viewModel.replaceString) {
|
|
1904
|
-
const replaceString = match.replaceString;
|
|
1905
|
-
return {
|
|
1906
|
-
startLineNumber: range.startLineNumber,
|
|
1907
|
-
startColumn: range.startColumn,
|
|
1908
|
-
endLineNumber: range.startLineNumber,
|
|
1909
|
-
endColumn: range.startColumn + replaceString.length
|
|
1910
|
-
};
|
|
1911
|
-
}
|
|
1912
|
-
return range;
|
|
1913
|
-
}
|
|
1914
|
-
return undefined;
|
|
1915
|
-
}
|
|
1916
|
-
export { SearchView, getEditorSelectionFromMatch };
|