@codingame/monaco-vscode-search-service-override 9.0.3 → 10.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/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +5 -6
  3. package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +17 -17
  4. package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +2 -3
  5. package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +10 -11
  6. package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +87 -90
  7. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +12 -14
  8. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +66 -72
  9. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +57 -37
  10. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +6 -9
  11. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +2 -3
  12. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +43 -35
  13. package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +3 -59
  14. package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +20 -20
  15. package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +2 -2
  16. package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +60 -21
  17. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +321 -276
  18. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +39 -43
  19. package/vscode/src/vs/workbench/contrib/search/common/searchHistoryService.js +4 -5
  20. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +44 -46
  21. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +13 -16
  22. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +1 -2
  23. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +12 -15
  24. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +5 -5
  25. package/vscode/src/vs/workbench/services/search/browser/searchService.js +5 -3
  26. package/vscode/src/vs/workbench/services/search/common/searchService.js +20 -16
  27. package/vscode/src/vs/workbench/services/search/worker/localFileSearch.js +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-search-service-override",
3
- "version": "9.0.3",
3
+ "version": "10.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -29,6 +29,6 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "vscode": "npm:@codingame/monaco-vscode-api@9.0.3"
32
+ "vscode": "npm:@codingame/monaco-vscode-api@10.0.0"
33
33
  }
34
34
  }
@@ -4,7 +4,6 @@ import { Toggle } from 'vscode/vscode/vs/base/browser/ui/toggle/toggle';
4
4
  import { Widget } from 'vscode/vscode/vs/base/browser/ui/widget';
5
5
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
6
6
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
7
- import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
8
7
  import { localize } from 'vscode/vscode/vs/nls';
9
8
  import { ContextScopedHistoryInputBox } from 'vscode/vscode/vs/platform/history/browser/contextScopedHistoryWidget';
10
9
  import { showHistoryKeybindingHint } from 'vscode/vscode/vs/platform/history/browser/historyWidgetKeybindingHint';
@@ -28,7 +27,7 @@ let PatternInputWidget = class PatternInputWidget extends Widget {
28
27
  this.onCancel = this._onCancel.event;
29
28
  options = {
30
29
  ...{
31
- ariaLabel: ( localize(10827, "input"))
30
+ ariaLabel: ( localize(10916, "input"))
32
31
  },
33
32
  ...options,
34
33
  };
@@ -117,11 +116,11 @@ let PatternInputWidget = class PatternInputWidget extends Widget {
117
116
  }
118
117
  onInputKeyUp(keyboardEvent) {
119
118
  switch (keyboardEvent.keyCode) {
120
- case KeyCode.Enter:
119
+ case 3 :
121
120
  this.onSearchSubmit();
122
121
  this._onSubmit.fire(false);
123
122
  return;
124
- case KeyCode.Escape:
123
+ case 9 :
125
124
  this._onCancel.fire();
126
125
  return;
127
126
  }
@@ -155,7 +154,7 @@ let IncludePatternInputWidget = class IncludePatternInputWidget extends PatternI
155
154
  renderSubcontrols(controlsDiv) {
156
155
  this.useSearchInEditorsBox = this._register(( (new Toggle({
157
156
  icon: Codicon.book,
158
- title: ( localize(10828, "Search only in Open Editors")),
157
+ title: ( localize(10917, "Search only in Open Editors")),
159
158
  isChecked: false,
160
159
  hoverDelegate: getDefaultHoverDelegate('element'),
161
160
  ...defaultToggleStyles
@@ -199,7 +198,7 @@ let ExcludePatternInputWidget = class ExcludePatternInputWidget extends PatternI
199
198
  this.useExcludesAndIgnoreFilesBox = this._register(( (new Toggle({
200
199
  icon: Codicon.exclude,
201
200
  actionClassName: 'useExcludesAndIgnoreFiles',
202
- title: ( localize(10829, "Use Exclude Settings and Ignore Files")),
201
+ title: ( localize(10918, "Use Exclude Settings and Ignore Files")),
203
202
  isChecked: true,
204
203
  hoverDelegate: getDefaultHoverDelegate('element'),
205
204
  ...defaultToggleStyles
@@ -83,12 +83,12 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
83
83
  picker.buttons = [{
84
84
  location: QuickInputButtonLocation.Inline,
85
85
  iconClass: ThemeIcon.asClassName(Codicon.goToSearch),
86
- tooltip: ( localize(8468, "See in Search Panel"))
86
+ tooltip: ( localize(8544, "See in Search Panel"))
87
87
  }];
88
88
  this.editorViewState.reset();
89
- disposables.add(picker.onDidTriggerButton(() => {
89
+ disposables.add(picker.onDidTriggerButton(async () => {
90
90
  if (this.searchModel.searchResult.count() > 0) {
91
- this.moveToSearchViewlet(undefined);
91
+ await this.moveToSearchViewlet(undefined);
92
92
  }
93
93
  else {
94
94
  this._viewsService.openView(VIEW_ID, true);
@@ -154,17 +154,17 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
154
154
  this.currentAsyncSearch = result.asyncResults;
155
155
  await result.asyncResults;
156
156
  const syncResultURIs = ( (new ResourceSet( (result.syncResults.map(e => e.resource)))));
157
- return this.searchModel.searchResult.matches().filter(e => !( (syncResultURIs.has(e.resource))));
157
+ return this.searchModel.searchResult.matches(false).filter(e => !( (syncResultURIs.has(e.resource))));
158
158
  };
159
159
  return {
160
- syncResults: this.searchModel.searchResult.matches(),
160
+ syncResults: this.searchModel.searchResult.matches(false),
161
161
  asyncResults: getAsyncResults()
162
162
  };
163
163
  }
164
- moveToSearchViewlet(currentElem) {
164
+ async moveToSearchViewlet(currentElem) {
165
165
  this._viewsService.openView(VIEW_ID, false);
166
166
  const viewlet = this._viewsService.getActiveViewWithId(VIEW_ID);
167
- viewlet.replaceSearchModel(this.searchModel, this.currentAsyncSearch);
167
+ await viewlet.replaceSearchModel(this.searchModel, this.currentAsyncSearch);
168
168
  this.searchModel = this._instantiationService.createInstance(SearchModel);
169
169
  this.searchModel.location = SearchModelLocation.QUICK_ACCESS;
170
170
  const viewer = viewlet?.getControl();
@@ -197,10 +197,10 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
197
197
  type: 'separator',
198
198
  });
199
199
  picks.push({
200
- label: ( localize(8469, "See More Files")),
200
+ label: ( localize(8545, "See More Files")),
201
201
  iconClass: ThemeIcon.asClassName(searchDetailsIcon),
202
202
  accept: async () => {
203
- this.moveToSearchViewlet(matches[limit]);
203
+ await this.moveToSearchViewlet(matches[limit]);
204
204
  }
205
205
  });
206
206
  break;
@@ -214,7 +214,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
214
214
  description,
215
215
  buttons: [{
216
216
  iconClass: ThemeIcon.asClassName(searchOpenInFileIcon),
217
- tooltip: ( localize(8470, "Open File"))
217
+ tooltip: ( localize(8546, "Open File"))
218
218
  }],
219
219
  trigger: async () => {
220
220
  await this.handleAccept(fileMatch, {});
@@ -226,10 +226,10 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
226
226
  const element = results[matchIndex];
227
227
  if (matchIndex === MAX_RESULTS_PER_FILE) {
228
228
  picks.push({
229
- label: ( localize(8471, "More")),
229
+ label: ( localize(8547, "More")),
230
230
  iconClass: ThemeIcon.asClassName(searchDetailsIcon),
231
231
  accept: async () => {
232
- this.moveToSearchViewlet(element);
232
+ await this.moveToSearchViewlet(element);
233
233
  }
234
234
  });
235
235
  break;
@@ -247,7 +247,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
247
247
  },
248
248
  buttons: [{
249
249
  iconClass: ThemeIcon.asClassName(searchActivityBarIcon),
250
- tooltip: ( localize(8472, "See in Search Panel")),
250
+ tooltip: ( localize(8548, "See in Search Panel")),
251
251
  }],
252
252
  ariaLabel: `Match at location ${element.range().startLineNumber}:${element.range().startColumn} - ${previewText}`,
253
253
  accept: async (keyMods, event) => {
@@ -258,8 +258,8 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
258
258
  forcePinned: event.inBackground
259
259
  });
260
260
  },
261
- trigger: () => {
262
- this.moveToSearchViewlet(element);
261
+ trigger: async () => {
262
+ await this.moveToSearchViewlet(element);
263
263
  return TriggerAction.CLOSE_PICKER;
264
264
  },
265
265
  match: element
@@ -285,7 +285,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
285
285
  if (contentPattern === '') {
286
286
  this.searchModel.searchResult.clear();
287
287
  return [{
288
- label: ( localize(8473, "Enter a term to search for across your files."))
288
+ label: ( localize(8549, "Enter a term to search for across your files."))
289
289
  }];
290
290
  }
291
291
  const conditionalTokenCts = disposables.add(( (new CancellationTokenSource())));
@@ -310,7 +310,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
310
310
  picks: syncResult,
311
311
  additionalPicks: allMatches.asyncResults
312
312
  .then(asyncResults => (asyncResults.length + syncResult.length === 0) ? [{
313
- label: ( localize(8474, "No matching results"))
313
+ label: ( localize(8550, "No matching results"))
314
314
  }] : this._getPicksFromMatches(asyncResults, MAX_FILES_SHOWN - matches.length))
315
315
  .then(picks => {
316
316
  if (picks.length > 0) {
@@ -1,10 +1,9 @@
1
- import 'vscode/vscode/vs/platform/instantiation/common/extensions';
2
1
  import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
3
2
  import { ReplacePreviewContentProvider } from './replaceService.js';
4
- import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
3
+ import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
5
4
 
6
5
  function registerContributions() {
7
- registerWorkbenchContribution2(ReplacePreviewContentProvider.ID, ReplacePreviewContentProvider, WorkbenchPhase.BlockStartup );
6
+ registerWorkbenchContribution2(ReplacePreviewContentProvider.ID, ReplacePreviewContentProvider, 1 );
8
7
  }
9
8
 
10
9
  export { registerContributions };
@@ -9,7 +9,6 @@ import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/langu
9
9
  import { Match, MatchInNotebook, FileMatch } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
10
10
  import { ISearchViewModelWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel.service';
11
11
  import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
12
- import { ScrollType } from 'vscode/vscode/vs/editor/common/editorCommon';
13
12
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
14
13
  import { createTextBufferFactoryFromSnapshot } from 'vscode/vscode/vs/editor/common/model/textModel';
15
14
  import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
@@ -60,7 +59,7 @@ let ReplacePreviewModel = class ReplacePreviewModel extends Disposable {
60
59
  }
61
60
  async resolve(replacePreviewUri) {
62
61
  const fileResource = toFileResource(replacePreviewUri);
63
- const fileMatch = this.searchWorkbenchService.searchModel.searchResult.matches().filter(match => ( (match.resource.toString())) === ( (fileResource.toString())))[0];
62
+ const fileMatch = this.searchWorkbenchService.searchModel.searchResult.matches(false).filter(match => ( (match.resource.toString())) === ( (fileResource.toString())))[0];
64
63
  const ref = this._register(await this.textModelResolverService.createModelReference(fileResource));
65
64
  const sourceModel = ref.object.textEditorModel;
66
65
  const sourceModelLanguageId = sourceModel.getLanguageId();
@@ -87,7 +86,7 @@ ReplacePreviewModel = ( (__decorate([
87
86
  ], ReplacePreviewModel)));
88
87
  let ReplaceService = class ReplaceService {
89
88
  static { ReplaceService_1 = this; }
90
- static { this.REPLACE_SAVE_SOURCE = SaveSourceRegistry.registerSource('searchReplace.source', ( localize(3364, "Search and Replace"))); }
89
+ static { this.REPLACE_SAVE_SOURCE = SaveSourceRegistry.registerSource('searchReplace.source', ( localize(3400, "Search and Replace"))); }
91
90
  constructor(textFileService, editorService, textModelResolverService, bulkEditorService, labelService, notebookEditorModelResolverService) {
92
91
  this.textFileService = textFileService;
93
92
  this.editorService = editorService;
@@ -125,7 +124,7 @@ let ReplaceService = class ReplaceService {
125
124
  const editor = await this.editorService.openEditor({
126
125
  original: { resource: fileMatch.resource },
127
126
  modified: { resource: toReplaceResource(fileMatch.resource) },
128
- label: ( localize(3365, "{0} ↔ {1} (Replace Preview)", fileMatch.name(), fileMatch.name())),
127
+ label: ( localize(3401, "{0} ↔ {1} (Replace Preview)", fileMatch.name(), fileMatch.name())),
129
128
  description: this.labelService.getUriLabel(dirname(fileMatch.resource), { relative: true }),
130
129
  options: {
131
130
  preserveFocus,
@@ -142,7 +141,7 @@ let ReplaceService = class ReplaceService {
142
141
  if (editor) {
143
142
  const editorControl = editor.getControl();
144
143
  if (element instanceof Match && editorControl) {
145
- editorControl.revealLineInCenter(element.range().startLineNumber, ScrollType.Immediate);
144
+ editorControl.revealLineInCenter(element.range().startLineNumber, 1 );
146
145
  }
147
146
  }
148
147
  }
@@ -178,15 +177,15 @@ let ReplaceService = class ReplaceService {
178
177
  createEdits(arg, resource = null) {
179
178
  const edits = [];
180
179
  if (arg instanceof Match) {
181
- if (arg instanceof MatchInNotebook) {
182
- if (!arg.isReadonly()) {
180
+ if (!arg.isReadonly()) {
181
+ if (arg instanceof MatchInNotebook) {
183
182
  const match = arg;
184
183
  edits.push(this.createEdit(match, match.replaceString, match.cell?.uri));
185
184
  }
186
- }
187
- else {
188
- const match = arg;
189
- edits.push(this.createEdit(match, match.replaceString, resource));
185
+ else {
186
+ const match = arg;
187
+ edits.push(this.createEdit(match, match.replaceString, resource));
188
+ }
190
189
  }
191
190
  }
192
191
  if (arg instanceof FileMatch) {