@codingame/monaco-vscode-search-service-override 36.2.7 → 37.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.
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { registerCss } from '@codingame/monaco-vscode-api/css';
3
3
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
- import { $, append, addDisposableListener, EventType, EventHelper, clearNode, getTotalHeight } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { $, append, addDisposableListener, EventType, EventHelper, clearNode, getWindow, getTotalHeight } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
5
5
  import { StandardKeyboardEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
6
6
  import { alert } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
7
7
  import { Delayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
@@ -70,6 +70,7 @@ var SearchEditor_1;
70
70
  registerCss(searchEditor);
71
71
  const RESULT_LINE_REGEX = /^(\s+)(\d+)(: | )(\s*)(.*)$/;
72
72
  const FILE_LINE_REGEX = /^(\S.*):$/;
73
+ const DEFAULT_QUERY_EDITOR_LAYOUT_OFFSET = 28;
73
74
  let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
74
75
  static {
75
76
  SearchEditor_1 = this;
@@ -186,7 +187,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
186
187
  resetCursor: false
187
188
  })));
188
189
  this.includesExcludesContainer = append(container, $(".includes-excludes"));
189
- const toggleQueryDetailsLabel = ( localize(14178, "Toggle Search Details"));
190
+ const toggleQueryDetailsLabel = ( localize(15937, "Toggle Search Details"));
190
191
  this.toggleQueryDetailsButton = append(
191
192
  this.includesExcludesContainer,
192
193
  $(".expand" + ThemeIcon.asCSSSelector(searchDetailsIcon), {
@@ -229,11 +230,11 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
229
230
  })
230
231
  );
231
232
  const folderIncludesList = append(this.includesExcludesContainer, $(".file-types.includes"));
232
- const filesToIncludeTitle = ( localize(14179, "files to include"));
233
+ const filesToIncludeTitle = ( localize(15938, "files to include"));
233
234
  append(folderIncludesList, $("h4", undefined, filesToIncludeTitle));
234
235
  this.inputPatternIncludes = this._register(
235
236
  scopedInstantiationService.createInstance(IncludePatternInputWidget, folderIncludesList, this.contextViewService, {
236
- ariaLabel: ( localize(14180, "Search Include Patterns")),
237
+ ariaLabel: ( localize(15939, "Search Include Patterns")),
237
238
  inputBoxStyles: searchEditorInputboxStyles
238
239
  })
239
240
  );
@@ -245,11 +246,11 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
245
246
  this.inputPatternIncludes.onChangeSearchInEditorsBox(() => this.triggerSearch())
246
247
  );
247
248
  const excludesList = append(this.includesExcludesContainer, $(".file-types.excludes"));
248
- const excludesTitle = ( localize(14181, "files to exclude"));
249
+ const excludesTitle = ( localize(15940, "files to exclude"));
249
250
  append(excludesList, $("h4", undefined, excludesTitle));
250
251
  this.inputPatternExcludes = this._register(
251
252
  scopedInstantiationService.createInstance(ExcludePatternInputWidget, excludesList, this.contextViewService, {
252
- ariaLabel: ( localize(14182, "Search Exclude Patterns")),
253
+ ariaLabel: ( localize(15941, "Search Exclude Patterns")),
253
254
  inputBoxStyles: searchEditorInputboxStyles
254
255
  })
255
256
  );
@@ -278,7 +279,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
278
279
  clearNode(this.messageBox);
279
280
  this.messageDisposables.clear();
280
281
  if (show) {
281
- const runAgainLink = append(this.messageBox, $("a.pointer.prominent.message", {}, ( localize(14183, "Run Search"))));
282
+ const runAgainLink = append(this.messageBox, $("a.pointer.prominent.message", {}, ( localize(15942, "Run Search"))));
282
283
  this.messageDisposables.add(addDisposableListener(runAgainLink, EventType.CLICK, async () => {
283
284
  await this.triggerSearch();
284
285
  this.searchResultEditor.focus();
@@ -497,7 +498,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
497
498
  }
498
499
  }
499
500
  alert(( localize(
500
- 14184,
501
+ 15943,
501
502
  "Matched {0} at {1} in file {2}",
502
503
  matchText,
503
504
  matchLineText,
@@ -716,13 +717,17 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
716
717
  }
717
718
  reLayout() {
718
719
  if (this.dimension) {
719
- this.queryEditorWidget.setWidth(this.dimension.width - 28 );
720
+ const configuredOffset = Number.parseFloat(
721
+ getWindow(this.queryEditorContainer).getComputedStyle(this.queryEditorContainer).getPropertyValue("--search-editor-query-layout-offset")
722
+ );
723
+ const queryEditorWidth = this.dimension.width - (Number.isFinite(configuredOffset) ? configuredOffset : DEFAULT_QUERY_EDITOR_LAYOUT_OFFSET);
724
+ this.queryEditorWidget.setWidth(queryEditorWidth);
720
725
  this.searchResultEditor.layout({
721
726
  height: this.dimension.height - getTotalHeight(this.queryEditorContainer),
722
727
  width: this.dimension.width
723
728
  });
724
- this.inputPatternExcludes.setWidth(this.dimension.width - 28 );
725
- this.inputPatternIncludes.setWidth(this.dimension.width - 28 );
729
+ this.inputPatternExcludes.setWidth(queryEditorWidth);
730
+ this.inputPatternIncludes.setWidth(queryEditorWidth);
726
731
  }
727
732
  }
728
733
  getInput() {
@@ -841,11 +846,11 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
841
846
  }
842
847
  }
843
848
  getAriaLabel() {
844
- return this.getInput()?.getName() ?? ( localize(14185, "Search"));
849
+ return this.getInput()?.getName() ?? ( localize(15944, "Search"));
845
850
  }
846
851
  };
847
852
  SearchEditor = SearchEditor_1 = ( __decorate([( __param(1, ITelemetryService)), ( __param(2, IThemeService)), ( __param(3, IStorageService)), ( __param(4, IModelService)), ( __param(5, IWorkspaceContextService)), ( __param(6, ILabelService)), ( __param(7, IInstantiationService)), ( __param(8, IContextViewService)), ( __param(9, ICommandService)), ( __param(10, IOpenerService)), ( __param(11, INotificationService)), ( __param(12, IEditorProgressService)), ( __param(13, ITextResourceConfigurationService)), ( __param(14, IEditorGroupsService)), ( __param(15, IEditorService)), ( __param(16, IConfigurationService)), ( __param(17, IFileService)), ( __param(18, ILogService)), ( __param(19, IHoverService))], SearchEditor));
848
- const searchEditorTextInputBorder = registerColor("searchEditor.textInputBorder", inputBorder, ( localize(14186, "Search editor text input box border.")));
853
+ const searchEditorTextInputBorder = registerColor("searchEditor.textInputBorder", inputBorder, ( localize(15945, "Search editor text input box border.")));
849
854
  function findNextRange(matchRanges, currentPosition) {
850
855
  for (const matchRange of matchRanges) {
851
856
  if (Position.isBefore(currentPosition, matchRange.getStartPosition())) {
@@ -93,7 +93,7 @@ let LocalFileSearchWorkerClient = class LocalFileSearchWorkerClient extends Disp
93
93
  return {
94
94
  results: [],
95
95
  messages: [{
96
- text: ( localize(17913, "Unable to search with Web Worker text searcher")),
96
+ text: ( localize(19682, "Unable to search with Web Worker text searcher")),
97
97
  type: TextSearchCompleteMessageType.Warning
98
98
  }]
99
99
  };
@@ -138,7 +138,7 @@ let LocalFileSearchWorkerClient = class LocalFileSearchWorkerClient extends Disp
138
138
  return {
139
139
  results: [],
140
140
  messages: [{
141
- text: ( localize(17914, "Unable to search with Web Worker file searcher")),
141
+ text: ( localize(19683, "Unable to search with Web Worker file searcher")),
142
142
  type: TextSearchCompleteMessageType.Warning
143
143
  }]
144
144
  };