@codingame/monaco-vscode-api 1.79.2-next.2 → 1.79.2
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/dist/extensions.d.ts +1 -1
- package/dist/extensions.d2.ts +1 -1
- package/dist/extensionsRegistry.d.ts +1 -1
- package/dist/rollup-extension-directory-plugin.d.ts +2 -10
- package/dist/rollup-extension-directory-plugin.js +2 -2
- package/dist/rollup-vsix-plugin.d.ts +2 -10
- package/dist/rollup-vsix-plugin.js +5 -7
- package/dist/services.d.ts +1 -1
- package/dist/views.d.ts +1 -1
- package/dist/vscode/vs/workbench/contrib/search/browser/search.contribution.js +0 -6
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsBase.js +1 -30
- package/dist/vscode/vs/workbench/contrib/search/browser/searchIcons.js +9 -9
- package/dist/vscode/vs/workbench/contrib/search/browser/searchModel.js +2 -33
- package/dist/vscode/vs/workbench/contrib/search/common/constants.js +1 -35
- package/dist/vscode/vs/workbench/services/search/common/queryBuilder.js +2 -44
- package/monaco-editor-treemending.patch +780 -780
- package/package.json +1 -1
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsCopy.js +0 -204
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsFind.js +0 -355
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsNav.js +0 -461
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +0 -365
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsSymbol.js +0 -37
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsTopBar.js +0 -308
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
-
import { WorkbenchListFocusContextKey } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
|
|
3
|
-
import { IViewsService } from '../../../common/views.js';
|
|
4
|
-
import { searchStopIcon, searchRefreshIcon, searchCollapseAllIcon, searchExpandAllIcon, searchClearIcon, searchShowAsList, searchShowAsTree } from './searchIcons.js';
|
|
5
|
-
import { ClearSearchHistoryCommandId, CancelSearchActionId, SearchViewVisibleKey, RefreshSearchResultsActionId, ViewHasSearchPatternKey, CollapseSearchResultsActionId, HasSearchResults, ViewHasSomeCollapsibleKey, ExpandSearchResultsActionId, ClearSearchResultsActionId, ViewHasReplacePatternKey, ViewHasFilePatternKey, ViewAsTreeActionId, InTreeViewKey, ViewAsListActionId } from '../common/constants.js';
|
|
6
|
-
import { ISearchHistoryService } from '../common/searchHistoryService.js';
|
|
7
|
-
import { FolderMatchWorkspaceRoot, Match, FolderMatch, FolderMatchNoRoot, SearchResult, FileMatch } from './searchModel.js';
|
|
8
|
-
import { VIEW_ID } from '../../../services/search/common/search.js';
|
|
9
|
-
import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
10
|
-
import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
11
|
-
import { SearchStateKey, SearchUIState } from '../common/search.js';
|
|
12
|
-
import { category, getSearchView } from './searchActionsBase.js';
|
|
13
|
-
registerAction2(class ClearSearchHistoryCommandAction extends Action2 {
|
|
14
|
-
constructor() {
|
|
15
|
-
super({
|
|
16
|
-
id: ClearSearchHistoryCommandId,
|
|
17
|
-
title: {
|
|
18
|
-
value: ( nls.localize('clearSearchHistoryLabel', "Clear Search History")),
|
|
19
|
-
original: 'Clear Search History'
|
|
20
|
-
},
|
|
21
|
-
category,
|
|
22
|
-
f1: true
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
async run(accessor) {
|
|
26
|
-
clearHistoryCommand(accessor);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
registerAction2(class CancelSearchAction extends Action2 {
|
|
30
|
-
constructor() {
|
|
31
|
-
super({
|
|
32
|
-
id: CancelSearchActionId,
|
|
33
|
-
title: {
|
|
34
|
-
value: ( nls.localize('CancelSearchAction.label', "Cancel Search")),
|
|
35
|
-
original: 'Cancel Search'
|
|
36
|
-
},
|
|
37
|
-
icon: searchStopIcon,
|
|
38
|
-
category,
|
|
39
|
-
f1: true,
|
|
40
|
-
precondition: ( ( SearchStateKey.isEqualTo(SearchUIState.Idle)).negate()),
|
|
41
|
-
keybinding: {
|
|
42
|
-
weight: 200 ,
|
|
43
|
-
when: ( ContextKeyExpr.and(SearchViewVisibleKey, WorkbenchListFocusContextKey)),
|
|
44
|
-
primary: 9 ,
|
|
45
|
-
},
|
|
46
|
-
menu: [{
|
|
47
|
-
id: MenuId.ViewTitle,
|
|
48
|
-
group: 'navigation',
|
|
49
|
-
order: 0,
|
|
50
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), ( SearchStateKey.isEqualTo(SearchUIState.SlowSearch)))),
|
|
51
|
-
}]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
run(accessor) {
|
|
55
|
-
return cancelSearch(accessor);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
registerAction2(class RefreshAction extends Action2 {
|
|
59
|
-
constructor() {
|
|
60
|
-
super({
|
|
61
|
-
id: RefreshSearchResultsActionId,
|
|
62
|
-
title: {
|
|
63
|
-
value: ( nls.localize('RefreshAction.label', "Refresh")),
|
|
64
|
-
original: 'Refresh'
|
|
65
|
-
},
|
|
66
|
-
icon: searchRefreshIcon,
|
|
67
|
-
precondition: ViewHasSearchPatternKey,
|
|
68
|
-
category,
|
|
69
|
-
f1: true,
|
|
70
|
-
menu: [{
|
|
71
|
-
id: MenuId.ViewTitle,
|
|
72
|
-
group: 'navigation',
|
|
73
|
-
order: 0,
|
|
74
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), ( ( SearchStateKey.isEqualTo(SearchUIState.SlowSearch)).negate()))),
|
|
75
|
-
}]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
run(accessor, ...args) {
|
|
79
|
-
return refreshSearch(accessor);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
registerAction2(class CollapseDeepestExpandedLevelAction extends Action2 {
|
|
83
|
-
constructor() {
|
|
84
|
-
super({
|
|
85
|
-
id: CollapseSearchResultsActionId,
|
|
86
|
-
title: {
|
|
87
|
-
value: ( nls.localize('CollapseDeepestExpandedLevelAction.label', "Collapse All")),
|
|
88
|
-
original: 'Collapse All'
|
|
89
|
-
},
|
|
90
|
-
category,
|
|
91
|
-
icon: searchCollapseAllIcon,
|
|
92
|
-
f1: true,
|
|
93
|
-
precondition: ( ContextKeyExpr.and(HasSearchResults, ViewHasSomeCollapsibleKey)),
|
|
94
|
-
menu: [{
|
|
95
|
-
id: MenuId.ViewTitle,
|
|
96
|
-
group: 'navigation',
|
|
97
|
-
order: 3,
|
|
98
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), ( ContextKeyExpr.or(( HasSearchResults.negate()), ViewHasSomeCollapsibleKey)))),
|
|
99
|
-
}]
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
run(accessor, ...args) {
|
|
103
|
-
return collapseDeepestExpandedLevel(accessor);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
registerAction2(class ExpandAllAction extends Action2 {
|
|
107
|
-
constructor() {
|
|
108
|
-
super({
|
|
109
|
-
id: ExpandSearchResultsActionId,
|
|
110
|
-
title: {
|
|
111
|
-
value: ( nls.localize('ExpandAllAction.label', "Expand All")),
|
|
112
|
-
original: 'Expand All'
|
|
113
|
-
},
|
|
114
|
-
category,
|
|
115
|
-
icon: searchExpandAllIcon,
|
|
116
|
-
f1: true,
|
|
117
|
-
precondition: ( ContextKeyExpr.and(HasSearchResults, ( ViewHasSomeCollapsibleKey.toNegated()))),
|
|
118
|
-
menu: [{
|
|
119
|
-
id: MenuId.ViewTitle,
|
|
120
|
-
group: 'navigation',
|
|
121
|
-
order: 3,
|
|
122
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), HasSearchResults, ( ViewHasSomeCollapsibleKey.toNegated()))),
|
|
123
|
-
}]
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
run(accessor, ...args) {
|
|
127
|
-
return expandAll(accessor);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
registerAction2(class ClearSearchResultsAction extends Action2 {
|
|
131
|
-
constructor() {
|
|
132
|
-
super({
|
|
133
|
-
id: ClearSearchResultsActionId,
|
|
134
|
-
title: {
|
|
135
|
-
value: ( nls.localize('ClearSearchResultsAction.label', "Clear Search Results")),
|
|
136
|
-
original: 'Clear Search Results'
|
|
137
|
-
},
|
|
138
|
-
category,
|
|
139
|
-
icon: searchClearIcon,
|
|
140
|
-
f1: true,
|
|
141
|
-
precondition: ( ContextKeyExpr.or(
|
|
142
|
-
HasSearchResults,
|
|
143
|
-
ViewHasSearchPatternKey,
|
|
144
|
-
ViewHasReplacePatternKey,
|
|
145
|
-
ViewHasFilePatternKey
|
|
146
|
-
)),
|
|
147
|
-
menu: [{
|
|
148
|
-
id: MenuId.ViewTitle,
|
|
149
|
-
group: 'navigation',
|
|
150
|
-
order: 1,
|
|
151
|
-
when: ( ContextKeyExpr.equals('view', VIEW_ID)),
|
|
152
|
-
}]
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
run(accessor, ...args) {
|
|
156
|
-
return clearSearchResults(accessor);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
registerAction2(class ViewAsTreeAction extends Action2 {
|
|
160
|
-
constructor() {
|
|
161
|
-
super({
|
|
162
|
-
id: ViewAsTreeActionId,
|
|
163
|
-
title: {
|
|
164
|
-
value: ( nls.localize('ViewAsTreeAction.label', "View as Tree")),
|
|
165
|
-
original: 'View as Tree'
|
|
166
|
-
},
|
|
167
|
-
category,
|
|
168
|
-
icon: searchShowAsList,
|
|
169
|
-
f1: true,
|
|
170
|
-
precondition: ( ContextKeyExpr.and(HasSearchResults, ( InTreeViewKey.toNegated()))),
|
|
171
|
-
menu: [{
|
|
172
|
-
id: MenuId.ViewTitle,
|
|
173
|
-
group: 'navigation',
|
|
174
|
-
order: 2,
|
|
175
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), ( InTreeViewKey.toNegated()))),
|
|
176
|
-
}]
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
run(accessor, ...args) {
|
|
180
|
-
const searchView = getSearchView(accessor.get(IViewsService));
|
|
181
|
-
if (searchView) {
|
|
182
|
-
searchView.setTreeView(true);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
registerAction2(class ViewAsListAction extends Action2 {
|
|
187
|
-
constructor() {
|
|
188
|
-
super({
|
|
189
|
-
id: ViewAsListActionId,
|
|
190
|
-
title: {
|
|
191
|
-
value: ( nls.localize('ViewAsListAction.label', "View as List")),
|
|
192
|
-
original: 'View as List'
|
|
193
|
-
},
|
|
194
|
-
category,
|
|
195
|
-
icon: searchShowAsTree,
|
|
196
|
-
f1: true,
|
|
197
|
-
precondition: ( ContextKeyExpr.and(HasSearchResults, InTreeViewKey)),
|
|
198
|
-
menu: [{
|
|
199
|
-
id: MenuId.ViewTitle,
|
|
200
|
-
group: 'navigation',
|
|
201
|
-
order: 2,
|
|
202
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', VIEW_ID)), InTreeViewKey)),
|
|
203
|
-
}]
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
run(accessor, ...args) {
|
|
207
|
-
const searchView = getSearchView(accessor.get(IViewsService));
|
|
208
|
-
if (searchView) {
|
|
209
|
-
searchView.setTreeView(false);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
const clearHistoryCommand = accessor => {
|
|
214
|
-
const searchHistoryService = accessor.get(ISearchHistoryService);
|
|
215
|
-
searchHistoryService.clearHistory();
|
|
216
|
-
};
|
|
217
|
-
function expandAll(accessor) {
|
|
218
|
-
const viewsService = accessor.get(IViewsService);
|
|
219
|
-
const searchView = getSearchView(viewsService);
|
|
220
|
-
if (searchView) {
|
|
221
|
-
const viewer = searchView.getControl();
|
|
222
|
-
viewer.expandAll();
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
function clearSearchResults(accessor) {
|
|
226
|
-
const viewsService = accessor.get(IViewsService);
|
|
227
|
-
const searchView = getSearchView(viewsService);
|
|
228
|
-
searchView?.clearSearchResults();
|
|
229
|
-
}
|
|
230
|
-
function cancelSearch(accessor) {
|
|
231
|
-
const viewsService = accessor.get(IViewsService);
|
|
232
|
-
const searchView = getSearchView(viewsService);
|
|
233
|
-
searchView?.cancelSearch();
|
|
234
|
-
}
|
|
235
|
-
function refreshSearch(accessor) {
|
|
236
|
-
const viewsService = accessor.get(IViewsService);
|
|
237
|
-
const searchView = getSearchView(viewsService);
|
|
238
|
-
searchView?.triggerQueryChange({ preserveFocus: false });
|
|
239
|
-
}
|
|
240
|
-
function collapseDeepestExpandedLevel(accessor) {
|
|
241
|
-
const viewsService = accessor.get(IViewsService);
|
|
242
|
-
const searchView = getSearchView(viewsService);
|
|
243
|
-
if (searchView) {
|
|
244
|
-
const viewer = searchView.getControl();
|
|
245
|
-
const navigator = viewer.navigate();
|
|
246
|
-
let node = navigator.first();
|
|
247
|
-
let canCollapseFileMatchLevel = false;
|
|
248
|
-
let canCollapseFirstLevel = false;
|
|
249
|
-
if (node instanceof FolderMatchWorkspaceRoot || searchView.isTreeLayoutViewVisible) {
|
|
250
|
-
while (node = navigator.next()) {
|
|
251
|
-
if (node instanceof Match) {
|
|
252
|
-
canCollapseFileMatchLevel = true;
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
if (searchView.isTreeLayoutViewVisible && !canCollapseFirstLevel) {
|
|
256
|
-
let nodeToTest = node;
|
|
257
|
-
if (node instanceof FolderMatch) {
|
|
258
|
-
const compressionStartNode = viewer.getCompressedTreeNode(node).element?.elements[0];
|
|
259
|
-
nodeToTest = (compressionStartNode && !(compressionStartNode instanceof Match)) ? compressionStartNode : node;
|
|
260
|
-
}
|
|
261
|
-
const immediateParent = nodeToTest.parent();
|
|
262
|
-
if (!(immediateParent instanceof FolderMatchWorkspaceRoot || immediateParent instanceof FolderMatchNoRoot || immediateParent instanceof SearchResult)) {
|
|
263
|
-
canCollapseFirstLevel = true;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
if (canCollapseFileMatchLevel) {
|
|
269
|
-
node = navigator.first();
|
|
270
|
-
do {
|
|
271
|
-
if (node instanceof FileMatch) {
|
|
272
|
-
viewer.collapse(node);
|
|
273
|
-
}
|
|
274
|
-
} while (node = navigator.next());
|
|
275
|
-
}
|
|
276
|
-
else if (canCollapseFirstLevel) {
|
|
277
|
-
node = navigator.first();
|
|
278
|
-
if (node) {
|
|
279
|
-
do {
|
|
280
|
-
let nodeToTest = node;
|
|
281
|
-
if (node instanceof FolderMatch) {
|
|
282
|
-
const compressionStartNode = viewer.getCompressedTreeNode(node).element?.elements[0];
|
|
283
|
-
nodeToTest = (compressionStartNode && !(compressionStartNode instanceof Match)) ? compressionStartNode : node;
|
|
284
|
-
}
|
|
285
|
-
const immediateParent = nodeToTest.parent();
|
|
286
|
-
if (immediateParent instanceof FolderMatchWorkspaceRoot || immediateParent instanceof FolderMatchNoRoot) {
|
|
287
|
-
if (viewer.hasElement(node)) {
|
|
288
|
-
viewer.collapse(node, true);
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
viewer.collapseAll();
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
} while (node = navigator.next());
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
viewer.collapseAll();
|
|
299
|
-
}
|
|
300
|
-
const firstFocusParent = viewer.getFocus()[0]?.parent();
|
|
301
|
-
if (firstFocusParent && (firstFocusParent instanceof FolderMatch || firstFocusParent instanceof FileMatch) &&
|
|
302
|
-
viewer.hasElement(firstFocusParent) && viewer.isCollapsed(firstFocusParent)) {
|
|
303
|
-
viewer.domFocus();
|
|
304
|
-
viewer.focusFirst();
|
|
305
|
-
viewer.setSelection(viewer.getFocus());
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|