@codingame/monaco-vscode-search-service-override 5.2.0 → 6.0.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.
Files changed (27) hide show
  1. package/package.json +2 -2
  2. package/search.js +37 -3
  3. package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +3 -2
  4. package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +3 -2
  5. package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +2 -1
  6. package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +20 -17
  7. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +11 -9
  8. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +49 -47
  9. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +18 -16
  10. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +6 -3
  11. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +2 -1
  12. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +13 -11
  13. package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +4 -4
  14. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +33 -28
  15. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +36 -32
  16. package/vscode/src/vs/workbench/contrib/search/common/searchHistoryService.js +5 -4
  17. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +26 -24
  18. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +7 -4
  19. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +2 -1
  20. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +11 -8
  21. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +3 -3
  22. package/vscode/src/vs/workbench/services/search/browser/searchService.js +4 -27
  23. package/vscode/src/vs/workbench/services/search/common/searchService.js +19 -19
  24. package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +0 -764
  25. package/vscode/src/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +0 -6
  26. package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +0 -224
  27. package/vscode/src/vs/workbench/contrib/search/common/cacheState.js +0 -87
@@ -3,13 +3,15 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
3
3
  import { getSelectionKeyboardEvent } from 'vscode/vscode/vs/platform/list/browser/listService';
4
4
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
5
5
  import { searchRemoveIcon, searchReplaceIcon } from './searchIcons.js';
6
- import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
6
+ import { SearchCommandIds, SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
7
7
  import { IReplaceService } from 'vscode/vscode/vs/workbench/contrib/search/browser/replace.service';
8
8
  import { SearchResult, arrayContainsElementOrParent, Match, MatchInNotebook, FileMatch, FolderMatch } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
9
9
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
10
10
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
11
11
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
12
12
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
13
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
14
+ import { KeyCode, KeyMod } from 'vscode/vscode/vs/base/common/keyCodes';
13
15
  import { category, getSearchView, getElementsToOperateOn, shouldRefocus } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
14
16
  import { equals } from 'vscode/vscode/vs/base/common/arrays';
15
17
 
@@ -17,16 +19,16 @@ const _moduleId = "vs/workbench/contrib/search/browser/searchActionsRemoveReplac
17
19
  registerAction2(class RemoveAction extends Action2 {
18
20
  constructor() {
19
21
  super({
20
- id: "search.action.remove" ,
22
+ id: SearchCommandIds.RemoveActionId,
21
23
  title: ( localize2WithPath(_moduleId, 0, "Dismiss")),
22
24
  category,
23
25
  icon: searchRemoveIcon,
24
26
  keybinding: {
25
- weight: 200 ,
27
+ weight: KeybindingWeight.WorkbenchContrib,
26
28
  when: ( (ContextKeyExpr.and(SearchContext.SearchViewVisibleKey, SearchContext.FileMatchOrMatchFocusKey))),
27
- primary: 20 ,
29
+ primary: KeyCode.Delete,
28
30
  mac: {
29
- primary: 2048 | 1 ,
31
+ primary: KeyMod.CtrlCmd | KeyCode.Backspace,
30
32
  },
31
33
  },
32
34
  menu: [
@@ -95,18 +97,18 @@ registerAction2(class RemoveAction extends Action2 {
95
97
  registerAction2(class ReplaceAction extends Action2 {
96
98
  constructor() {
97
99
  super({
98
- id: "search.action.replace" ,
100
+ id: SearchCommandIds.ReplaceActionId,
99
101
  title: ( localize2WithPath(_moduleId, 1, "Replace")),
100
102
  category,
101
103
  keybinding: {
102
- weight: 200 ,
104
+ weight: KeybindingWeight.WorkbenchContrib,
103
105
  when: ( (ContextKeyExpr.and(
104
106
  SearchContext.SearchViewVisibleKey,
105
107
  SearchContext.ReplaceActiveKey,
106
108
  SearchContext.MatchFocusKey,
107
109
  SearchContext.IsEditableItemKey
108
110
  ))),
109
- primary: 1024 | 2048 | 22 ,
111
+ primary: KeyMod.Shift | KeyMod.CtrlCmd | KeyCode.Digit1,
110
112
  },
111
113
  icon: searchReplaceIcon,
112
114
  menu: [
@@ -140,19 +142,19 @@ registerAction2(class ReplaceAction extends Action2 {
140
142
  registerAction2(class ReplaceAllAction extends Action2 {
141
143
  constructor() {
142
144
  super({
143
- id: "search.action.replaceAllInFile" ,
145
+ id: SearchCommandIds.ReplaceAllInFileActionId,
144
146
  title: ( localize2WithPath(_moduleId, 2, "Replace All")),
145
147
  category,
146
148
  keybinding: {
147
- weight: 200 ,
149
+ weight: KeybindingWeight.WorkbenchContrib,
148
150
  when: ( (ContextKeyExpr.and(
149
151
  SearchContext.SearchViewVisibleKey,
150
152
  SearchContext.ReplaceActiveKey,
151
153
  SearchContext.FileFocusKey,
152
154
  SearchContext.IsEditableItemKey
153
155
  ))),
154
- primary: 1024 | 2048 | 22 ,
155
- secondary: [2048 | 1024 | 3 ],
156
+ primary: KeyMod.Shift | KeyMod.CtrlCmd | KeyCode.Digit1,
157
+ secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter],
156
158
  },
157
159
  icon: searchReplaceIcon,
158
160
  menu: [
@@ -186,19 +188,19 @@ registerAction2(class ReplaceAllAction extends Action2 {
186
188
  registerAction2(class ReplaceAllInFolderAction extends Action2 {
187
189
  constructor() {
188
190
  super({
189
- id: "search.action.replaceAllInFolder" ,
191
+ id: SearchCommandIds.ReplaceAllInFolderActionId,
190
192
  title: ( localize2WithPath(_moduleId, 2, "Replace All")),
191
193
  category,
192
194
  keybinding: {
193
- weight: 200 ,
195
+ weight: KeybindingWeight.WorkbenchContrib,
194
196
  when: ( (ContextKeyExpr.and(
195
197
  SearchContext.SearchViewVisibleKey,
196
198
  SearchContext.ReplaceActiveKey,
197
199
  SearchContext.FolderFocusKey,
198
200
  SearchContext.IsEditableItemKey
199
201
  ))),
200
- primary: 1024 | 2048 | 22 ,
201
- secondary: [2048 | 1024 | 3 ],
202
+ primary: KeyMod.Shift | KeyMod.CtrlCmd | KeyCode.Digit1,
203
+ secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter],
202
204
  },
203
205
  icon: searchReplaceIcon,
204
206
  menu: [
@@ -1,5 +1,8 @@
1
1
  import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
2
+ import { SearchCommandIds } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
2
3
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
4
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
5
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
3
6
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
4
7
 
5
8
  const _moduleId = "vs/workbench/contrib/search/browser/searchActionsSymbol";
@@ -9,15 +12,15 @@ registerAction2(class ShowAllSymbolsAction extends Action2 {
9
12
  static { this.ALL_SYMBOLS_PREFIX = '#'; }
10
13
  constructor() {
11
14
  super({
12
- id: "workbench.action.showAllSymbols" ,
15
+ id: SearchCommandIds.ShowAllSymbolsActionId,
13
16
  title: {
14
17
  ...( localize2WithPath(_moduleId, 0, "Go to Symbol in Workspace...")),
15
18
  mnemonicTitle: ( localizeWithPath(_moduleId, 1, "Go to Symbol in &&Workspace...")),
16
19
  },
17
20
  f1: true,
18
21
  keybinding: {
19
- weight: 200 ,
20
- primary: 2048 | 50
22
+ weight: KeybindingWeight.WorkbenchContrib,
23
+ primary: KeyMod.CtrlCmd | KeyCode.KeyT
21
24
  },
22
25
  menu: {
23
26
  id: MenuId.MenubarGoMenu,
@@ -1,4 +1,5 @@
1
1
  import { localize2WithPath } from 'vscode/vscode/vs/nls';
2
+ import { SearchCommandIds } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
2
3
  import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
3
4
  import { category } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
4
5
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
@@ -11,7 +12,7 @@ const _moduleId = "vs/workbench/contrib/search/browser/searchActionsTextQuickAcc
11
12
  registerAction2(class TextSearchQuickAccessAction extends Action2 {
12
13
  constructor() {
13
14
  super({
14
- id: "workbench.action.quickTextSearch" ,
15
+ id: SearchCommandIds.QuickTextSearchActionId,
15
16
  title: ( localize2WithPath(_moduleId, 0, "Quick Search")),
16
17
  category,
17
18
  f1: true
@@ -2,12 +2,14 @@ import { localize2WithPath } from 'vscode/vscode/vs/nls';
2
2
  import { WorkbenchListFocusContextKey } from 'vscode/vscode/vs/platform/list/browser/listService';
3
3
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
4
4
  import { searchStopIcon, searchRefreshIcon, searchCollapseAllIcon, searchExpandAllIcon, searchClearIcon, searchShowAsList, searchShowAsTree } from './searchIcons.js';
5
- import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
5
+ import { SearchCommandIds, SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
6
6
  import { ISearchHistoryService } from 'vscode/vscode/vs/workbench/contrib/search/common/searchHistoryService.service';
7
7
  import { FolderMatchWorkspaceRoot, Match, FolderMatch, FolderMatchNoRoot, SearchResult, FileMatch } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
8
8
  import { VIEW_ID } from 'vscode/vscode/vs/workbench/services/search/common/search';
9
9
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
10
10
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
11
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
12
+ import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
11
13
  import { SearchStateKey, SearchUIState } from 'vscode/vscode/vs/workbench/contrib/search/common/search';
12
14
  import { category, getSearchView } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
13
15
 
@@ -15,7 +17,7 @@ const _moduleId = "vs/workbench/contrib/search/browser/searchActionsTopBar";
15
17
  registerAction2(class ClearSearchHistoryCommandAction extends Action2 {
16
18
  constructor() {
17
19
  super({
18
- id: "search.action.clearHistory" ,
20
+ id: SearchCommandIds.ClearSearchHistoryCommandId,
19
21
  title: ( localize2WithPath(_moduleId, 0, "Clear Search History")),
20
22
  category,
21
23
  f1: true
@@ -28,16 +30,16 @@ registerAction2(class ClearSearchHistoryCommandAction extends Action2 {
28
30
  registerAction2(class CancelSearchAction extends Action2 {
29
31
  constructor() {
30
32
  super({
31
- id: "search.action.cancel" ,
33
+ id: SearchCommandIds.CancelSearchActionId,
32
34
  title: ( localize2WithPath(_moduleId, 1, "Cancel Search")),
33
35
  icon: searchStopIcon,
34
36
  category,
35
37
  f1: true,
36
38
  precondition: ( (( (SearchStateKey.isEqualTo(SearchUIState.Idle))).negate())),
37
39
  keybinding: {
38
- weight: 200 ,
40
+ weight: KeybindingWeight.WorkbenchContrib,
39
41
  when: ( (ContextKeyExpr.and(SearchContext.SearchViewVisibleKey, WorkbenchListFocusContextKey))),
40
- primary: 9 ,
42
+ primary: KeyCode.Escape,
41
43
  },
42
44
  menu: [{
43
45
  id: MenuId.ViewTitle,
@@ -57,7 +59,7 @@ registerAction2(class CancelSearchAction extends Action2 {
57
59
  registerAction2(class RefreshAction extends Action2 {
58
60
  constructor() {
59
61
  super({
60
- id: "search.action.refreshSearchResults" ,
62
+ id: SearchCommandIds.RefreshSearchResultsActionId,
61
63
  title: ( localize2WithPath(_moduleId, 2, "Refresh")),
62
64
  icon: searchRefreshIcon,
63
65
  precondition: SearchContext.ViewHasSearchPatternKey,
@@ -81,7 +83,7 @@ registerAction2(class RefreshAction extends Action2 {
81
83
  registerAction2(class CollapseDeepestExpandedLevelAction extends Action2 {
82
84
  constructor() {
83
85
  super({
84
- id: "search.action.collapseSearchResults" ,
86
+ id: SearchCommandIds.CollapseSearchResultsActionId,
85
87
  title: ( localize2WithPath(_moduleId, 3, "Collapse All")),
86
88
  category,
87
89
  icon: searchCollapseAllIcon,
@@ -108,7 +110,7 @@ registerAction2(class CollapseDeepestExpandedLevelAction extends Action2 {
108
110
  registerAction2(class ExpandAllAction extends Action2 {
109
111
  constructor() {
110
112
  super({
111
- id: "search.action.expandSearchResults" ,
113
+ id: SearchCommandIds.ExpandSearchResultsActionId,
112
114
  title: ( localize2WithPath(_moduleId, 4, "Expand All")),
113
115
  category,
114
116
  icon: searchExpandAllIcon,
@@ -136,7 +138,7 @@ registerAction2(class ExpandAllAction extends Action2 {
136
138
  registerAction2(class ClearSearchResultsAction extends Action2 {
137
139
  constructor() {
138
140
  super({
139
- id: "search.action.clearSearchResults" ,
141
+ id: SearchCommandIds.ClearSearchResultsActionId,
140
142
  title: ( localize2WithPath(_moduleId, 5, "Clear Search Results")),
141
143
  category,
142
144
  icon: searchClearIcon,
@@ -162,7 +164,7 @@ registerAction2(class ClearSearchResultsAction extends Action2 {
162
164
  registerAction2(class ViewAsTreeAction extends Action2 {
163
165
  constructor() {
164
166
  super({
165
- id: "search.action.viewAsTree" ,
167
+ id: SearchCommandIds.ViewAsTreeActionId,
166
168
  title: ( localize2WithPath(_moduleId, 6, "View as Tree")),
167
169
  category,
168
170
  icon: searchShowAsList,
@@ -192,7 +194,7 @@ registerAction2(class ViewAsTreeAction extends Action2 {
192
194
  registerAction2(class ViewAsListAction extends Action2 {
193
195
  constructor() {
194
196
  super({
195
- id: "search.action.viewAsList" ,
197
+ id: SearchCommandIds.ViewAsListActionId,
196
198
  title: ( localize2WithPath(_moduleId, 7, "View as List")),
197
199
  category,
198
200
  icon: searchShowAsTree,
@@ -12,7 +12,7 @@ import { FolderMatch, FileMatch, Match, FolderMatchWorkspaceRoot, FolderMatchNoR
12
12
  import { isEqual } from 'vscode/vscode/vs/base/common/resources';
13
13
  import { MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
14
14
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
15
- import { MenuWorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
15
+ import { MenuWorkbenchToolBar, HiddenItemStrategy } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
16
16
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
17
17
  import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
18
18
  import { defaultCountBadgeStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
@@ -88,7 +88,7 @@ let FolderMatchRenderer = class FolderMatchRenderer extends Disposable {
88
88
  menuOptions: {
89
89
  shouldForwardArgs: true
90
90
  },
91
- hiddenItemStrategy: 0 ,
91
+ hiddenItemStrategy: HiddenItemStrategy.Ignore,
92
92
  toolbarOptions: {
93
93
  primaryGroup: (g) => /^inline/.test(g),
94
94
  },
@@ -178,7 +178,7 @@ let FileMatchRenderer = class FileMatchRenderer extends Disposable {
178
178
  menuOptions: {
179
179
  shouldForwardArgs: true
180
180
  },
181
- hiddenItemStrategy: 0 ,
181
+ hiddenItemStrategy: HiddenItemStrategy.Ignore,
182
182
  toolbarOptions: {
183
183
  primaryGroup: (g) => /^inline/.test(g),
184
184
  },
@@ -257,7 +257,7 @@ let MatchRenderer = class MatchRenderer extends Disposable {
257
257
  menuOptions: {
258
258
  shouldForwardArgs: true
259
259
  },
260
- hiddenItemStrategy: 0 ,
260
+ hiddenItemStrategy: HiddenItemStrategy.Ignore,
261
261
  toolbarOptions: {
262
262
  primaryGroup: (g) => /^inline/.test(g),
263
263
  },
@@ -2,11 +2,13 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { $ as $$1, hide, append, addDisposableListener, EventType, EventHelper, clearNode, show, getActiveWindow, getTotalHeight, Dimension, isAncestorOfActiveElement } from 'vscode/vscode/vs/base/browser/dom';
3
3
  import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
4
4
  import { status } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
5
+ import { MessageType } from 'vscode/vscode/vs/base/browser/ui/inputbox/inputBox';
5
6
  import { ObjectTreeElementCollapseState } from 'vscode/vscode/vs/base/browser/ui/tree/tree';
6
7
  import { Delayer, RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
7
8
  import { isCancellationError, onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
8
9
  import { Event } from 'vscode/vscode/vs/base/common/event';
9
10
  import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
11
+ import { KeyCode, KeyMod } from 'vscode/vscode/vs/base/common/keyCodes';
10
12
  import { DisposableStore, Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
11
13
  import { isMacintosh, isNative } from 'vscode/vscode/vs/base/common/platform';
12
14
  import { escapeRegExpCharacters } from 'vscode/vscode/vs/base/common/strings';
@@ -27,6 +29,7 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
27
29
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
28
30
  import { IContextViewService, IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
29
31
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
32
+ import { FileChangeType } from 'vscode/vscode/vs/platform/files/common/files';
30
33
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
31
34
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
32
35
  import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
@@ -36,11 +39,13 @@ import { INotificationService } from 'vscode/vscode/vs/platform/notification/com
36
39
  import { withSelection } from 'vscode/vscode/vs/platform/opener/common/opener';
37
40
  import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
38
41
  import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
42
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
39
43
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
40
44
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
41
45
  import { defaultInputBoxStyles, defaultToggleStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
42
46
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
43
47
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
48
+ import { WorkbenchState } from 'vscode/vscode/vs/platform/workspace/common/workspace';
44
49
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
45
50
  import { OpenFileFolderAction, OpenFolderAction } from 'vscode/vscode/vs/workbench/browser/actions/workspaceActions';
46
51
  import { ResourceListDnDHandler } from 'vscode/vscode/vs/workbench/browser/dnd';
@@ -55,7 +60,7 @@ import { searchDetailsIcon } from './searchIcons.js';
55
60
  import { renderSearchMessage } from './searchMessage.js';
56
61
  import { SearchAccessibilityProvider, SearchDelegate, FolderMatchRenderer, FileMatchRenderer, MatchRenderer } from './searchResultsView.js';
57
62
  import { SearchWidget } from './searchWidget.js';
58
- import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
63
+ import { SearchContext, SearchCommandIds } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
59
64
  import { IReplaceService } from 'vscode/vscode/vs/workbench/contrib/search/browser/replace.service';
60
65
  import { SearchStateKey, SearchUIState, getOutOfWorkspaceEditorResources } from 'vscode/vscode/vs/workbench/contrib/search/common/search';
61
66
  import { SearchHistoryService } from '../common/searchHistoryService.js';
@@ -67,7 +72,7 @@ import { SIDE_GROUP, ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/services/ed
67
72
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
68
73
  import { IPreferencesService } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences.service';
69
74
  import { QueryBuilder } from 'vscode/vscode/vs/workbench/services/search/common/queryBuilder';
70
- import 'vscode/vscode/vs/workbench/services/search/common/search';
75
+ import { SearchSortOrder, ViewMode, SearchCompletionExitCode, QueryType } from 'vscode/vscode/vs/workbench/services/search/common/search';
71
76
  import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
72
77
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
73
78
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
@@ -146,7 +151,7 @@ let SearchView = class SearchView extends ViewPane {
146
151
  this.instantiationService = this.instantiationService.createChild(( (new ServiceCollection([IContextKeyService, this.contextKeyService]))));
147
152
  this._register(this.configurationService.onDidChangeConfiguration(e => {
148
153
  if (e.affectsConfiguration('search.sortOrder')) {
149
- if (this.searchConfig.sortOrder === "modified" ) {
154
+ if (this.searchConfig.sortOrder === SearchSortOrder.Modified) {
150
155
  this.removeFileStats();
151
156
  }
152
157
  this.refreshTree();
@@ -158,7 +163,7 @@ let SearchView = class SearchView extends ViewPane {
158
163
  this.viewModel = this._register(this.searchViewModelWorkbenchService.searchModel);
159
164
  this.queryBuilder = this.instantiationService.createInstance(QueryBuilder);
160
165
  this.memento = ( (new Memento(this.id, storageService)));
161
- this.viewletState = this.memento.getMemento(1 , 1 );
166
+ this.viewletState = this.memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE);
162
167
  this._register(this.fileService.onDidFilesChange(e => this.onFilesChanged(e)));
163
168
  this._register(this.textFileService.untitled.onWillDispose(model => this.onUntitledDidDispose(model.resource)));
164
169
  this._register(this.contextService.onDidChangeWorkbenchState(() => this.onDidChangeWorkbenchState()));
@@ -169,12 +174,12 @@ let SearchView = class SearchView extends ViewPane {
169
174
  this.toggleCollapseStateDelayer = this._register(( (new Delayer(100))));
170
175
  this.triggerQueryDelayer = this._register(( (new Delayer(0))));
171
176
  this.treeAccessibilityProvider = this.instantiationService.createInstance(SearchAccessibilityProvider, this);
172
- this.isTreeLayoutViewVisible = this.viewletState['view.treeLayout'] ?? ((this.searchConfig.defaultViewMode === "tree") );
177
+ this.isTreeLayoutViewVisible = this.viewletState['view.treeLayout'] ?? (this.searchConfig.defaultViewMode === ViewMode.Tree);
173
178
  this._refreshResultsScheduler = this._register(( (new RunOnceScheduler(this._updateResults.bind(this), 80))));
174
179
  this._register(this.storageService.onWillSaveState(() => {
175
180
  this._saveSearchHistoryService();
176
181
  }));
177
- this._register(this.storageService.onDidChangeValue(1 , SearchHistoryService.SEARCH_HISTORY_KEY, this._register(( (new DisposableStore()))))(() => {
182
+ this._register(this.storageService.onDidChangeValue(StorageScope.WORKSPACE, SearchHistoryService.SEARCH_HISTORY_KEY, this._register(( (new DisposableStore()))))(() => {
178
183
  const restoredHistory = this.searchHistoryService.load();
179
184
  if (restoredHistory.include) {
180
185
  this.inputPatternIncludes.prependHistory(restoredHistory.include);
@@ -250,7 +255,7 @@ let SearchView = class SearchView extends ViewPane {
250
255
  }
251
256
  }
252
257
  onDidChangeWorkbenchState() {
253
- if (this.contextService.getWorkbenchState() !== 1 && this.searchWithoutFolderMessageElement) {
258
+ if (this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY && this.searchWithoutFolderMessageElement) {
254
259
  hide(this.searchWithoutFolderMessageElement);
255
260
  }
256
261
  }
@@ -325,14 +330,14 @@ let SearchView = class SearchView extends ViewPane {
325
330
  }));
326
331
  this._register(addDisposableListener(this.toggleQueryDetailsButton, EventType.KEY_UP, (e) => {
327
332
  const event = ( (new StandardKeyboardEvent(e)));
328
- if (event.equals(3 ) || event.equals(10 )) {
333
+ if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
329
334
  EventHelper.stop(e);
330
335
  this.toggleQueryDetails(false);
331
336
  }
332
337
  }));
333
338
  this._register(addDisposableListener(this.toggleQueryDetailsButton, EventType.KEY_DOWN, (e) => {
334
339
  const event = ( (new StandardKeyboardEvent(e)));
335
- if (event.equals(1024 | 2 )) {
340
+ if (event.equals(KeyMod.Shift | KeyCode.Tab)) {
336
341
  if (this.searchWidget.isReplaceActive()) {
337
342
  this.searchWidget.focusReplaceAllAction();
338
343
  }
@@ -383,7 +388,7 @@ let SearchView = class SearchView extends ViewPane {
383
388
  this._register(this.inputPatternIncludes.onSubmit(onFilePatternSubmit));
384
389
  this._register(this.inputPatternExcludes.onSubmit(onFilePatternSubmit));
385
390
  this.messagesElement = append(this.container, $('.messages.text-search-provider-messages'));
386
- if (this.contextService.getWorkbenchState() === 1 ) {
391
+ if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
387
392
  this.showSearchWithoutFolderMessage();
388
393
  }
389
394
  this.createSearchResultsView(this.container);
@@ -541,7 +546,7 @@ let SearchView = class SearchView extends ViewPane {
541
546
  refreshTree(event) {
542
547
  const collapseResults = this.searchConfig.collapseResults;
543
548
  if (!event || event.added || event.removed) {
544
- if (this.searchConfig.sortOrder === "modified" ) {
549
+ if (this.searchConfig.sortOrder === SearchSortOrder.Modified) {
545
550
  this.retrieveFileStats()
546
551
  .then(() => this.tree.setChildren(null, this.createResultIterator(collapseResults)));
547
552
  }
@@ -550,8 +555,8 @@ let SearchView = class SearchView extends ViewPane {
550
555
  }
551
556
  }
552
557
  else {
553
- if (this.searchConfig.sortOrder === "countAscending" ||
554
- this.searchConfig.sortOrder === "countDescending" ) {
558
+ if (this.searchConfig.sortOrder === SearchSortOrder.CountAscending ||
559
+ this.searchConfig.sortOrder === SearchSortOrder.CountDescending) {
555
560
  this.tree.setChildren(null, this.createResultIterator(collapseResults));
556
561
  }
557
562
  else {
@@ -570,7 +575,7 @@ let SearchView = class SearchView extends ViewPane {
570
575
  return this.createFolderIterator(folderMatches[0], collapseResults, true);
571
576
  }
572
577
  return (
573
- (Iterable.map(folderMatches, folderMatch => {
578
+ (Iterable.map(folderMatches, (folderMatch) => {
574
579
  const children = this.createFolderIterator(folderMatch, collapseResults, true);
575
580
  return { element: folderMatch, children, incompressible: true };
576
581
  }))
@@ -581,7 +586,7 @@ let SearchView = class SearchView extends ViewPane {
581
586
  const matchArray = this.isTreeLayoutViewVisible ? folderMatch.matches() : folderMatch.allDownstreamFileMatches();
582
587
  const matches = matchArray.sort((a, b) => searchMatchComparer(a, b, sortOrder));
583
588
  return (
584
- (Iterable.map(matches, match => {
589
+ (Iterable.map(matches, (match) => {
585
590
  let children;
586
591
  if (match instanceof FileMatch) {
587
592
  children = this.createFileIterator(match);
@@ -600,7 +605,7 @@ let SearchView = class SearchView extends ViewPane {
600
605
  matches = matches.filter(e => !e.aiContributed);
601
606
  }
602
607
  return (
603
- (Iterable.map(matches, r => ({ element: r, incompressible: true })))
608
+ (Iterable.map(matches, (r) => ({ element: r, incompressible: true })))
604
609
  );
605
610
  }
606
611
  createIterator(match, collapseResults) {
@@ -1152,7 +1157,7 @@ let SearchView = class SearchView extends ViewPane {
1152
1157
  clearSearchResults(clearInput = true) {
1153
1158
  this.viewModel.searchResult.clear();
1154
1159
  this.showEmptyStage(true);
1155
- if (this.contextService.getWorkbenchState() === 1 ) {
1160
+ if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
1156
1161
  this.showSearchWithoutFolderMessage();
1157
1162
  }
1158
1163
  if (clearInput) {
@@ -1374,7 +1379,7 @@ let SearchView = class SearchView extends ViewPane {
1374
1379
  };
1375
1380
  const folderResources = this.contextService.getWorkspace().folders;
1376
1381
  const onQueryValidationError = (err) => {
1377
- this.searchWidget.searchInput?.showMessage({ content: err.message, type: 3 });
1382
+ this.searchWidget.searchInput?.showMessage({ content: err.message, type: MessageType.ERROR });
1378
1383
  this.viewModel.searchResult.clear();
1379
1384
  };
1380
1385
  let query;
@@ -1448,7 +1453,7 @@ let SearchView = class SearchView extends ViewPane {
1448
1453
  }
1449
1454
  }
1450
1455
  const hasResults = !this.viewModel.searchResult.isEmpty(this.aiResultsVisible);
1451
- if (completed?.exit === 1 ) {
1456
+ if (completed?.exit === SearchCompletionExitCode.NewSearchStarted) {
1452
1457
  return;
1453
1458
  }
1454
1459
  if (!hasResults) {
@@ -1536,7 +1541,7 @@ let SearchView = class SearchView extends ViewPane {
1536
1541
  const learnMoreButton = this.messageDisposables.add(( (new SearchLinkButton(( localizeWithPath(_moduleId, 37, "Learn More")), this.onLearnMore.bind(this), this.hoverService))));
1537
1542
  append(messageEl, learnMoreButton.element);
1538
1543
  }
1539
- if (this.contextService.getWorkbenchState() === 1 ) {
1544
+ if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
1540
1545
  this.showSearchWithoutFolderMessage();
1541
1546
  }
1542
1547
  this.reLayout();
@@ -1572,7 +1577,7 @@ let SearchView = class SearchView extends ViewPane {
1572
1577
  }
1573
1578
  else {
1574
1579
  progressComplete();
1575
- this.searchWidget.searchInput?.showMessage({ content: e.message, type: 3 });
1580
+ this.searchWidget.searchInput?.showMessage({ content: e.message, type: MessageType.ERROR });
1576
1581
  this.viewModel.searchResult.clear();
1577
1582
  return Promise.resolve();
1578
1583
  }
@@ -1598,7 +1603,7 @@ let SearchView = class SearchView extends ViewPane {
1598
1603
  this.viewModel.replaceString = this.searchWidget.getReplaceValue();
1599
1604
  const result = this.viewModel.search(query);
1600
1605
  if (this.aiResultsVisible) {
1601
- const aiResult = this.viewModel.aiSearch({ ...query, contentPattern: query.contentPattern.pattern, type: 3 });
1606
+ const aiResult = this.viewModel.aiSearch({ ...query, contentPattern: query.contentPattern.pattern, type: QueryType.aiText });
1602
1607
  return result.asyncResults.then(() => aiResult.then((complete) => {
1603
1608
  clearTimeout(slowTimer);
1604
1609
  this.onSearchComplete(progressComplete, excludePatternText, includePatternText, complete);
@@ -1621,7 +1626,7 @@ let SearchView = class SearchView extends ViewPane {
1621
1626
  }
1622
1627
  openSettings(query) {
1623
1628
  const options = { query };
1624
- return this.contextService.getWorkbenchState() !== 1 ?
1629
+ return this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
1625
1630
  this.preferencesService.openWorkspaceSettings(options) :
1626
1631
  this.preferencesService.openUserSettings(options);
1627
1632
  }
@@ -1668,7 +1673,7 @@ let SearchView = class SearchView extends ViewPane {
1668
1673
  append(messageEl, $('span', undefined, searchingInOpenMessage, '(', disableOpenEditorsButton.element, ')'));
1669
1674
  }
1670
1675
  append(messageEl, ' - ');
1671
- const openInEditorTooltip = appendKeyBindingLabel(( localizeWithPath(_moduleId, 47, "Copy current search results to an editor")), this.keybindingService.lookupKeybinding("search.action.openInEditor" ));
1676
+ const openInEditorTooltip = appendKeyBindingLabel(( localizeWithPath(_moduleId, 47, "Copy current search results to an editor")), this.keybindingService.lookupKeybinding(SearchCommandIds.OpenInEditorCommandId));
1672
1677
  const openInEditorButton = this.messageDisposables.add(( (new SearchLinkButton(( localizeWithPath(_moduleId, 48, "Open in editor")), () => this.instantiationService.invokeFunction(createEditorFromSearchResult, this.searchResult, this.searchIncludePattern.getValue(), this.searchExcludePattern.getValue(), this.searchIncludePattern.onlySearchInOpenEditors()), this.hoverService, openInEditorTooltip))));
1673
1678
  append(messageEl, openInEditorButton.element);
1674
1679
  this.reLayout();
@@ -1835,17 +1840,17 @@ let SearchView = class SearchView extends ViewPane {
1835
1840
  }
1836
1841
  }
1837
1842
  onFilesChanged(e) {
1838
- if (!this.viewModel || (this.searchConfig.sortOrder !== "modified" && !e.gotDeleted())) {
1843
+ if (!this.viewModel || (this.searchConfig.sortOrder !== SearchSortOrder.Modified && !e.gotDeleted())) {
1839
1844
  return;
1840
1845
  }
1841
1846
  const matches = this.viewModel.searchResult.matches();
1842
1847
  if (e.gotDeleted()) {
1843
- const deletedMatches = matches.filter(m => e.contains(m.resource, 2 ));
1848
+ const deletedMatches = matches.filter(m => e.contains(m.resource, FileChangeType.DELETED));
1844
1849
  this.viewModel.searchResult.remove(deletedMatches);
1845
1850
  }
1846
1851
  else {
1847
1852
  const changedMatches = matches.filter(m => e.contains(m.resource));
1848
- if (changedMatches.length && this.searchConfig.sortOrder === "modified" ) {
1853
+ if (changedMatches.length && this.searchConfig.sortOrder === SearchSortOrder.Modified) {
1849
1854
  this.updateFileStats(changedMatches).then(() => this.refreshTree());
1850
1855
  }
1851
1856
  }
@@ -1989,7 +1994,7 @@ class SearchLinkButton extends Disposable {
1989
1994
  this._register(addDisposableListener(this.element, EventType.CLICK, wrappedHandler));
1990
1995
  this._register(addDisposableListener(this.element, EventType.KEY_DOWN, e => {
1991
1996
  const event = ( (new StandardKeyboardEvent(e)));
1992
- if (event.equals(10 ) || event.equals(3 )) {
1997
+ if (event.equals(KeyCode.Space) || event.equals(KeyCode.Enter)) {
1993
1998
  wrappedHandler(e);
1994
1999
  event.preventDefault();
1995
2000
  event.stopPropagation();