@codingame/monaco-vscode-search-service-override 3.2.3 → 4.1.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 (35) hide show
  1. package/package.json +2 -2
  2. package/search.js +4 -4
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  6. package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +0 -776
  7. package/vscode/src/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +0 -6
  8. package/vscode/src/vs/workbench/contrib/search/browser/media/searchview.css.js +0 -6
  9. package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +0 -231
  10. package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +0 -342
  11. package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +0 -8
  12. package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +0 -232
  13. package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +0 -621
  14. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +0 -209
  15. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +0 -511
  16. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +0 -374
  17. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +0 -43
  18. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +0 -44
  19. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +0 -323
  20. package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +0 -47
  21. package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +0 -96
  22. package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +0 -66
  23. package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +0 -434
  24. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +0 -2096
  25. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +0 -667
  26. package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +0 -234
  27. package/vscode/src/vs/workbench/contrib/search/common/cacheState.js +0 -87
  28. package/vscode/src/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +0 -6
  29. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +0 -586
  30. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +0 -736
  31. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +0 -189
  32. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +0 -320
  33. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +0 -138
  34. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +0 -293
  35. package/vscode/src/vs/workbench/services/search/common/searchService.js +0 -372
@@ -1,323 +0,0 @@
1
- import { localize2WithPath } from 'vscode/vscode/vs/nls';
2
- import { WorkbenchListFocusContextKey } from 'vscode/vscode/vs/platform/list/browser/listService';
3
- import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
4
- import { searchStopIcon, searchRefreshIcon, searchCollapseAllIcon, searchExpandAllIcon, searchClearIcon, searchShowAsList, searchShowAsTree } from './searchIcons.js';
5
- import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
6
- import { ISearchHistoryService } from 'vscode/vscode/vs/workbench/contrib/search/common/searchHistoryService';
7
- import { FolderMatchWorkspaceRoot, Match, FolderMatch, FolderMatchNoRoot, SearchResult, FileMatch } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
8
- import { VIEW_ID } from 'vscode/vscode/vs/workbench/services/search/common/search';
9
- import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
10
- import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
11
- import { SearchStateKey, SearchUIState } from 'vscode/vscode/vs/workbench/contrib/search/common/search';
12
- import { category, getSearchView } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
13
-
14
- registerAction2(class ClearSearchHistoryCommandAction extends Action2 {
15
- constructor() {
16
- super({
17
- id: "search.action.clearHistory" ,
18
- title: ( localize2WithPath(
19
- 'vs/workbench/contrib/search/browser/searchActionsTopBar',
20
- 'clearSearchHistoryLabel',
21
- "Clear Search History"
22
- )),
23
- category,
24
- f1: true
25
- });
26
- }
27
- async run(accessor) {
28
- clearHistoryCommand(accessor);
29
- }
30
- });
31
- registerAction2(class CancelSearchAction extends Action2 {
32
- constructor() {
33
- super({
34
- id: "search.action.cancel" ,
35
- title: ( localize2WithPath(
36
- 'vs/workbench/contrib/search/browser/searchActionsTopBar',
37
- 'CancelSearchAction.label',
38
- "Cancel Search"
39
- )),
40
- icon: searchStopIcon,
41
- category,
42
- f1: true,
43
- precondition: ( ( SearchStateKey.isEqualTo(SearchUIState.Idle)).negate()),
44
- keybinding: {
45
- weight: 200 ,
46
- when: ( ContextKeyExpr.and(SearchContext.SearchViewVisibleKey, WorkbenchListFocusContextKey)),
47
- primary: 9 ,
48
- },
49
- menu: [{
50
- id: MenuId.ViewTitle,
51
- group: 'navigation',
52
- order: 0,
53
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), ( SearchStateKey.isEqualTo(SearchUIState.SlowSearch)))),
54
- }]
55
- });
56
- }
57
- run(accessor) {
58
- return cancelSearch(accessor);
59
- }
60
- });
61
- registerAction2(class RefreshAction extends Action2 {
62
- constructor() {
63
- super({
64
- id: "search.action.refreshSearchResults" ,
65
- title: ( localize2WithPath(
66
- 'vs/workbench/contrib/search/browser/searchActionsTopBar',
67
- 'RefreshAction.label',
68
- "Refresh"
69
- )),
70
- icon: searchRefreshIcon,
71
- precondition: SearchContext.ViewHasSearchPatternKey,
72
- category,
73
- f1: true,
74
- menu: [{
75
- id: MenuId.ViewTitle,
76
- group: 'navigation',
77
- order: 0,
78
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), ( ( SearchStateKey.isEqualTo(SearchUIState.SlowSearch)).negate()))),
79
- }]
80
- });
81
- }
82
- run(accessor, ...args) {
83
- return refreshSearch(accessor);
84
- }
85
- });
86
- registerAction2(class CollapseDeepestExpandedLevelAction extends Action2 {
87
- constructor() {
88
- super({
89
- id: "search.action.collapseSearchResults" ,
90
- title: ( localize2WithPath(
91
- 'vs/workbench/contrib/search/browser/searchActionsTopBar',
92
- 'CollapseDeepestExpandedLevelAction.label',
93
- "Collapse All"
94
- )),
95
- category,
96
- icon: searchCollapseAllIcon,
97
- f1: true,
98
- precondition: ( ContextKeyExpr.and(
99
- SearchContext.HasSearchResults,
100
- SearchContext.ViewHasSomeCollapsibleKey
101
- )),
102
- menu: [{
103
- id: MenuId.ViewTitle,
104
- group: 'navigation',
105
- order: 3,
106
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), ( ContextKeyExpr.or(( SearchContext.HasSearchResults.negate()), SearchContext.ViewHasSomeCollapsibleKey)))),
107
- }]
108
- });
109
- }
110
- run(accessor, ...args) {
111
- return collapseDeepestExpandedLevel(accessor);
112
- }
113
- });
114
- registerAction2(class ExpandAllAction extends Action2 {
115
- constructor() {
116
- super({
117
- id: "search.action.expandSearchResults" ,
118
- title: ( localize2WithPath(
119
- 'vs/workbench/contrib/search/browser/searchActionsTopBar',
120
- 'ExpandAllAction.label',
121
- "Expand All"
122
- )),
123
- category,
124
- icon: searchExpandAllIcon,
125
- f1: true,
126
- precondition: ( ContextKeyExpr.and(SearchContext.HasSearchResults, ( SearchContext.ViewHasSomeCollapsibleKey.toNegated()))),
127
- menu: [{
128
- id: MenuId.ViewTitle,
129
- group: 'navigation',
130
- order: 3,
131
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), SearchContext.HasSearchResults, ( SearchContext.ViewHasSomeCollapsibleKey.toNegated()))),
132
- }]
133
- });
134
- }
135
- run(accessor, ...args) {
136
- return expandAll(accessor);
137
- }
138
- });
139
- registerAction2(class ClearSearchResultsAction extends Action2 {
140
- constructor() {
141
- super({
142
- id: "search.action.clearSearchResults" ,
143
- title: ( localize2WithPath(
144
- 'vs/workbench/contrib/search/browser/searchActionsTopBar',
145
- 'ClearSearchResultsAction.label',
146
- "Clear Search Results"
147
- )),
148
- category,
149
- icon: searchClearIcon,
150
- f1: true,
151
- precondition: ( ContextKeyExpr.or(
152
- SearchContext.HasSearchResults,
153
- SearchContext.ViewHasSearchPatternKey,
154
- SearchContext.ViewHasReplacePatternKey,
155
- SearchContext.ViewHasFilePatternKey
156
- )),
157
- menu: [{
158
- id: MenuId.ViewTitle,
159
- group: 'navigation',
160
- order: 1,
161
- when: ( ContextKeyExpr.equals('view', VIEW_ID)),
162
- }]
163
- });
164
- }
165
- run(accessor, ...args) {
166
- return clearSearchResults(accessor);
167
- }
168
- });
169
- registerAction2(class ViewAsTreeAction extends Action2 {
170
- constructor() {
171
- super({
172
- id: "search.action.viewAsTree" ,
173
- title: ( localize2WithPath(
174
- 'vs/workbench/contrib/search/browser/searchActionsTopBar',
175
- 'ViewAsTreeAction.label',
176
- "View as Tree"
177
- )),
178
- category,
179
- icon: searchShowAsList,
180
- f1: true,
181
- precondition: ( ContextKeyExpr.and(SearchContext.HasSearchResults, ( SearchContext.InTreeViewKey.toNegated()))),
182
- menu: [{
183
- id: MenuId.ViewTitle,
184
- group: 'navigation',
185
- order: 2,
186
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), ( SearchContext.InTreeViewKey.toNegated()))),
187
- }]
188
- });
189
- }
190
- run(accessor, ...args) {
191
- const searchView = getSearchView(accessor.get(IViewsService));
192
- if (searchView) {
193
- searchView.setTreeView(true);
194
- }
195
- }
196
- });
197
- registerAction2(class ViewAsListAction extends Action2 {
198
- constructor() {
199
- super({
200
- id: "search.action.viewAsList" ,
201
- title: ( localize2WithPath(
202
- 'vs/workbench/contrib/search/browser/searchActionsTopBar',
203
- 'ViewAsListAction.label',
204
- "View as List"
205
- )),
206
- category,
207
- icon: searchShowAsTree,
208
- f1: true,
209
- precondition: ( ContextKeyExpr.and(
210
- SearchContext.HasSearchResults,
211
- SearchContext.InTreeViewKey
212
- )),
213
- menu: [{
214
- id: MenuId.ViewTitle,
215
- group: 'navigation',
216
- order: 2,
217
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), SearchContext.InTreeViewKey)),
218
- }]
219
- });
220
- }
221
- run(accessor, ...args) {
222
- const searchView = getSearchView(accessor.get(IViewsService));
223
- if (searchView) {
224
- searchView.setTreeView(false);
225
- }
226
- }
227
- });
228
- const clearHistoryCommand = accessor => {
229
- const searchHistoryService = accessor.get(ISearchHistoryService);
230
- searchHistoryService.clearHistory();
231
- };
232
- function expandAll(accessor) {
233
- const viewsService = accessor.get(IViewsService);
234
- const searchView = getSearchView(viewsService);
235
- if (searchView) {
236
- const viewer = searchView.getControl();
237
- viewer.expandAll();
238
- }
239
- }
240
- function clearSearchResults(accessor) {
241
- const viewsService = accessor.get(IViewsService);
242
- const searchView = getSearchView(viewsService);
243
- searchView?.clearSearchResults();
244
- }
245
- function cancelSearch(accessor) {
246
- const viewsService = accessor.get(IViewsService);
247
- const searchView = getSearchView(viewsService);
248
- searchView?.cancelSearch();
249
- }
250
- function refreshSearch(accessor) {
251
- const viewsService = accessor.get(IViewsService);
252
- const searchView = getSearchView(viewsService);
253
- searchView?.triggerQueryChange({ preserveFocus: false });
254
- }
255
- function collapseDeepestExpandedLevel(accessor) {
256
- const viewsService = accessor.get(IViewsService);
257
- const searchView = getSearchView(viewsService);
258
- if (searchView) {
259
- const viewer = searchView.getControl();
260
- const navigator = viewer.navigate();
261
- let node = navigator.first();
262
- let canCollapseFileMatchLevel = false;
263
- let canCollapseFirstLevel = false;
264
- if (node instanceof FolderMatchWorkspaceRoot || searchView.isTreeLayoutViewVisible) {
265
- while (node = navigator.next()) {
266
- if (node instanceof Match) {
267
- canCollapseFileMatchLevel = true;
268
- break;
269
- }
270
- if (searchView.isTreeLayoutViewVisible && !canCollapseFirstLevel) {
271
- let nodeToTest = node;
272
- if (node instanceof FolderMatch) {
273
- const compressionStartNode = viewer.getCompressedTreeNode(node).element?.elements[0];
274
- nodeToTest = (compressionStartNode && !(compressionStartNode instanceof Match)) ? compressionStartNode : node;
275
- }
276
- const immediateParent = nodeToTest.parent();
277
- if (!(immediateParent instanceof FolderMatchWorkspaceRoot || immediateParent instanceof FolderMatchNoRoot || immediateParent instanceof SearchResult)) {
278
- canCollapseFirstLevel = true;
279
- }
280
- }
281
- }
282
- }
283
- if (canCollapseFileMatchLevel) {
284
- node = navigator.first();
285
- do {
286
- if (node instanceof FileMatch) {
287
- viewer.collapse(node);
288
- }
289
- } while (node = navigator.next());
290
- }
291
- else if (canCollapseFirstLevel) {
292
- node = navigator.first();
293
- if (node) {
294
- do {
295
- let nodeToTest = node;
296
- if (node instanceof FolderMatch) {
297
- const compressionStartNode = viewer.getCompressedTreeNode(node).element?.elements[0];
298
- nodeToTest = (compressionStartNode && !(compressionStartNode instanceof Match)) ? compressionStartNode : node;
299
- }
300
- const immediateParent = nodeToTest.parent();
301
- if (immediateParent instanceof FolderMatchWorkspaceRoot || immediateParent instanceof FolderMatchNoRoot) {
302
- if (viewer.hasElement(node)) {
303
- viewer.collapse(node, true);
304
- }
305
- else {
306
- viewer.collapseAll();
307
- }
308
- }
309
- } while (node = navigator.next());
310
- }
311
- }
312
- else {
313
- viewer.collapseAll();
314
- }
315
- const firstFocusParent = viewer.getFocus()[0]?.parent();
316
- if (firstFocusParent && (firstFocusParent instanceof FolderMatch || firstFocusParent instanceof FileMatch) &&
317
- viewer.hasElement(firstFocusParent) && viewer.isCollapsed(firstFocusParent)) {
318
- viewer.domFocus();
319
- viewer.focusFirst();
320
- viewer.setSelection(viewer.getFocus());
321
- }
322
- }
323
- }
@@ -1,47 +0,0 @@
1
- import { ContextScopedFindInput } from 'vscode/vscode/vs/platform/history/browser/contextScopedHistoryWidget';
2
- import { NotebookFindInputFilterButton } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget';
3
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
4
-
5
- class SearchFindInput extends ContextScopedFindInput {
6
- constructor(container, contextViewProvider, options, contextKeyService, contextMenuService, instantiationService, filters, filterStartVisiblitity) {
7
- super(container, contextViewProvider, options, contextKeyService);
8
- this.contextMenuService = contextMenuService;
9
- this.instantiationService = instantiationService;
10
- this.filters = filters;
11
- this._filterChecked = false;
12
- this._visible = false;
13
- this._findFilter = this._register(( new NotebookFindInputFilterButton(filters, contextMenuService, instantiationService, options, ( localizeWithPath(
14
- 'vs/workbench/contrib/search/browser/searchFindInput',
15
- 'searchFindInputNotebookFilter.label',
16
- "Notebook Find Filters"
17
- )))));
18
- this.inputBox.paddingRight = (this.caseSensitive?.width() ?? 0) + (this.wholeWords?.width() ?? 0) + (this.regex?.width() ?? 0) + this._findFilter.width;
19
- this.controls.appendChild(this._findFilter.container);
20
- this._findFilter.container.classList.add('monaco-custom-toggle');
21
- this.filterVisible = filterStartVisiblitity;
22
- }
23
- set filterVisible(show) {
24
- this._findFilter.container.style.display = show ? '' : 'none';
25
- this._visible = show;
26
- this.updateStyles();
27
- }
28
- setEnabled(enabled) {
29
- super.setEnabled(enabled);
30
- if (enabled && (!this._filterChecked || !this._visible)) {
31
- this.regex?.enable();
32
- }
33
- else {
34
- this.regex?.disable();
35
- }
36
- }
37
- updateStyles() {
38
- this._filterChecked =
39
- !this.filters.markupInput ||
40
- !this.filters.markupPreview ||
41
- !this.filters.codeInput ||
42
- !this.filters.codeOutput;
43
- this._findFilter.applyStyles(this._filterChecked);
44
- }
45
- }
46
-
47
- export { SearchFindInput };
@@ -1,96 +0,0 @@
1
- import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
4
-
5
- const searchDetailsIcon = registerIcon('search-details', Codicon.ellipsis, ( localizeWithPath(
6
- 'vs/workbench/contrib/search/browser/searchIcons',
7
- 'searchDetailsIcon',
8
- 'Icon to make search details visible.'
9
- )));
10
- const searchActivityBarIcon = registerIcon('search-see-more', Codicon.linkExternal, ( localizeWithPath(
11
- 'vs/workbench/contrib/search/browser/searchIcons',
12
- 'searchSeeMoreIcon',
13
- 'Icon to view more context in the search view.'
14
- )));
15
- const searchShowContextIcon = registerIcon('search-show-context', Codicon.listSelection, ( localizeWithPath(
16
- 'vs/workbench/contrib/search/browser/searchIcons',
17
- 'searchShowContextIcon',
18
- 'Icon for toggle the context in the search editor.'
19
- )));
20
- const searchHideReplaceIcon = registerIcon('search-hide-replace', Codicon.chevronRight, ( localizeWithPath(
21
- 'vs/workbench/contrib/search/browser/searchIcons',
22
- 'searchHideReplaceIcon',
23
- 'Icon to collapse the replace section in the search view.'
24
- )));
25
- const searchShowReplaceIcon = registerIcon('search-show-replace', Codicon.chevronDown, ( localizeWithPath(
26
- 'vs/workbench/contrib/search/browser/searchIcons',
27
- 'searchShowReplaceIcon',
28
- 'Icon to expand the replace section in the search view.'
29
- )));
30
- const searchReplaceAllIcon = registerIcon('search-replace-all', Codicon.replaceAll, ( localizeWithPath(
31
- 'vs/workbench/contrib/search/browser/searchIcons',
32
- 'searchReplaceAllIcon',
33
- 'Icon for replace all in the search view.'
34
- )));
35
- const searchReplaceIcon = registerIcon('search-replace', Codicon.replace, ( localizeWithPath(
36
- 'vs/workbench/contrib/search/browser/searchIcons',
37
- 'searchReplaceIcon',
38
- 'Icon for replace in the search view.'
39
- )));
40
- const searchRemoveIcon = registerIcon('search-remove', Codicon.close, ( localizeWithPath(
41
- 'vs/workbench/contrib/search/browser/searchIcons',
42
- 'searchRemoveIcon',
43
- 'Icon to remove a search result.'
44
- )));
45
- const searchRefreshIcon = registerIcon('search-refresh', Codicon.refresh, ( localizeWithPath(
46
- 'vs/workbench/contrib/search/browser/searchIcons',
47
- 'searchRefreshIcon',
48
- 'Icon for refresh in the search view.'
49
- )));
50
- const searchCollapseAllIcon = registerIcon('search-collapse-results', Codicon.collapseAll, ( localizeWithPath(
51
- 'vs/workbench/contrib/search/browser/searchIcons',
52
- 'searchCollapseAllIcon',
53
- 'Icon for collapse results in the search view.'
54
- )));
55
- const searchExpandAllIcon = registerIcon('search-expand-results', Codicon.expandAll, ( localizeWithPath(
56
- 'vs/workbench/contrib/search/browser/searchIcons',
57
- 'searchExpandAllIcon',
58
- 'Icon for expand results in the search view.'
59
- )));
60
- const searchShowAsTree = registerIcon('search-tree', Codicon.listTree, ( localizeWithPath(
61
- 'vs/workbench/contrib/search/browser/searchIcons',
62
- 'searchShowAsTree',
63
- 'Icon for viewing results as a tree in the search view.'
64
- )));
65
- const searchShowAsList = registerIcon('search-list', Codicon.listFlat, ( localizeWithPath(
66
- 'vs/workbench/contrib/search/browser/searchIcons',
67
- 'searchShowAsList',
68
- 'Icon for viewing results as a list in the search view.'
69
- )));
70
- const searchClearIcon = registerIcon('search-clear-results', Codicon.clearAll, ( localizeWithPath(
71
- 'vs/workbench/contrib/search/browser/searchIcons',
72
- 'searchClearIcon',
73
- 'Icon for clear results in the search view.'
74
- )));
75
- const searchStopIcon = registerIcon('search-stop', Codicon.searchStop, ( localizeWithPath(
76
- 'vs/workbench/contrib/search/browser/searchIcons',
77
- 'searchStopIcon',
78
- 'Icon for stop in the search view.'
79
- )));
80
- const searchViewIcon = registerIcon('search-view-icon', Codicon.search, ( localizeWithPath(
81
- 'vs/workbench/contrib/search/browser/searchIcons',
82
- 'searchViewIcon',
83
- 'View icon of the search view.'
84
- )));
85
- const searchNewEditorIcon = registerIcon('search-new-editor', Codicon.newFile, ( localizeWithPath(
86
- 'vs/workbench/contrib/search/browser/searchIcons',
87
- 'searchNewEditorIcon',
88
- 'Icon for the action to open a new search editor.'
89
- )));
90
- const searchOpenInFileIcon = registerIcon('search-open-in-file', Codicon.goToFile, ( localizeWithPath(
91
- 'vs/workbench/contrib/search/browser/searchIcons',
92
- 'searchOpenInFile',
93
- 'Icon for the action to go to the file of the current search result.'
94
- )));
95
-
96
- export { searchActivityBarIcon, searchClearIcon, searchCollapseAllIcon, searchDetailsIcon, searchExpandAllIcon, searchHideReplaceIcon, searchNewEditorIcon, searchOpenInFileIcon, searchRefreshIcon, searchRemoveIcon, searchReplaceAllIcon, searchReplaceIcon, searchShowAsList, searchShowAsTree, searchShowContextIcon, searchShowReplaceIcon, searchStopIcon, searchViewIcon };
@@ -1,66 +0,0 @@
1
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
2
- import { $, append } from 'vscode/vscode/vs/base/browser/dom';
3
- import { parseLinkedText } from 'vscode/vscode/vs/base/common/linkedText';
4
- import Severity from 'vscode/vscode/vs/base/common/severity';
5
- import { SeverityIcon } from 'vscode/vscode/vs/platform/severityIcon/browser/severityIcon';
6
- import { TextSearchCompleteMessageType } from 'vscode/vscode/vs/workbench/services/search/common/searchExtTypes';
7
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
8
- import { Link } from 'vscode/vscode/vs/platform/opener/browser/link';
9
- import { URI } from 'vscode/vscode/vs/base/common/uri';
10
-
11
- const renderSearchMessage = (message, instantiationService, notificationService, openerService, commandService, disposableStore, triggerSearch) => {
12
- const div = $('div.providerMessage');
13
- const linkedText = parseLinkedText(message.text);
14
- append(div, $('.' +
15
- SeverityIcon.className(message.type === TextSearchCompleteMessageType.Information
16
- ? Severity.Info
17
- : Severity.Warning)
18
- .split(' ')
19
- .join('.')));
20
- for (const node of linkedText.nodes) {
21
- if (typeof node === 'string') {
22
- append(div, document.createTextNode(node));
23
- }
24
- else {
25
- const link = instantiationService.createInstance(Link, div, node, {
26
- opener: async (href) => {
27
- if (!message.trusted) {
28
- return;
29
- }
30
- const parsed = ( URI.parse(href, true));
31
- if (parsed.scheme === Schemas.command && message.trusted) {
32
- const result = await commandService.executeCommand(parsed.path);
33
- if (result?.triggerSearch) {
34
- triggerSearch();
35
- }
36
- }
37
- else if (parsed.scheme === Schemas.https) {
38
- openerService.open(parsed);
39
- }
40
- else {
41
- if (parsed.scheme === Schemas.command && !message.trusted) {
42
- notificationService.error(( localizeWithPath(
43
- 'vs/workbench/contrib/search/browser/searchMessage',
44
- 'unable to open trust',
45
- "Unable to open command link from untrusted source: {0}",
46
- href
47
- )));
48
- }
49
- else {
50
- notificationService.error(( localizeWithPath(
51
- 'vs/workbench/contrib/search/browser/searchMessage',
52
- 'unable to open',
53
- "Unable to open unknown link: {0}",
54
- href
55
- )));
56
- }
57
- }
58
- }
59
- });
60
- disposableStore.add(link);
61
- }
62
- }
63
- return div;
64
- };
65
-
66
- export { renderSearchMessage };