@codingame/monaco-vscode-search-service-override 1.83.16 → 1.85.0-next.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-search-service-override",
3
- "version": "1.83.16",
3
+ "version": "1.85.0-next.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.83.16",
22
- "monaco-editor": "0.44.0"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.85.0-next.0",
22
+ "monaco-editor": "0.45.0"
23
23
  }
24
24
  }
@@ -1,6 +1,6 @@
1
1
  import n from '../../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
2
 
3
- var css = ".monaco-workbench .simple-fr-find-part-wrapper{background-color:var(--vscode-editorWidget-background)!important;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);max-width:calc(100% - 64px);overflow:hidden;padding:0 var(--notebook-find-horizontal-padding);position:absolute;right:18px;top:-45px;transition:top .2s linear;visibility:hidden;width:var(--notebook-find-width);z-index:10}.monaco-workbench.reduce-motion .simple-fr-find-part-wrapper{transition:top 0ms linear}.monaco-workbench .notebookOverlay .simple-fr-find-part-wrapper.visible{z-index:100}.monaco-workbench .simple-fr-find-part,.monaco-workbench .simple-fr-replace-part{align-items:center;display:flex;margin:0 0 0 17px;padding:4px;pointer-events:all;position:relative;top:0;z-index:10}.monaco-workbench .simple-fr-find-part-wrapper .find-replace-progress{height:2px;position:absolute;width:100%}.monaco-workbench .simple-fr-find-part-wrapper .find-replace-progress .monaco-progress-container{height:2px;top:0!important;z-index:100!important}.monaco-workbench .simple-fr-find-part-wrapper .find-replace-progress .monaco-progress-container .progress-bit{height:2px}.monaco-workbench .simple-fr-find-part-wrapper .monaco-findInput{width:224px}.monaco-workbench .simple-fr-find-part-wrapper .button{align-items:center;background-position:50%;background-repeat:no-repeat;cursor:pointer;display:flex;flex:initial;height:20px;justify-content:center;margin-left:3px;width:20px}.monaco-workbench .simple-fr-find-part-wrapper.visible .simple-fr-find-part{visibility:visible}.monaco-workbench .simple-fr-find-part-wrapper .toggle{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:center;margin-left:0;pointer-events:all;position:absolute;top:0;width:18px}.monaco-workbench .simple-fr-find-part-wrapper.visible{visibility:visible}.monaco-workbench .simple-fr-find-part-wrapper.visible-transition{top:0}.monaco-workbench .simple-fr-find-part .monaco-findInput{flex:1}.monaco-workbench .simple-fr-find-part .button{background-position:50%;background-repeat:no-repeat;cursor:pointer;display:flex;flex:initial;height:20px;margin-left:3px;min-width:20px;width:20px}.monaco-workbench .simple-fr-find-part-wrapper .button.disabled{cursor:default;opacity:.3}.monaco-workbench .simple-fr-find-part-wrapper .monaco-custom-toggle.disabled{background-color:inherit!important;cursor:default;opacity:.3;pointer-events:none;user-select:none;-webkit-user-select:none}.monaco-workbench .simple-fr-find-part-wrapper .find-filter-button{box-sizing:border-box;color:inherit;cursor:pointer;float:left;margin-left:2px;user-select:none;-webkit-user-select:none}.find-filter-button .monaco-action-bar .action-label{padding:0}.monaco-workbench .simple-fr-find-part .monaco-inputbox>.ibwrapper>.input,.monaco-workbench .simple-fr-replace-part .monaco-inputbox>.ibwrapper>.input{height:24px}.monaco-workbench .simple-fr-find-part-wrapper .monaco-sash{background-color:var(--vscode-editorWidget-resizeBorder,var(--vscode-editorWidget-border));left:0!important}";
3
+ var css = ".monaco-workbench .simple-fr-find-part-wrapper{background-color:var(--vscode-editorWidget-background)!important;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);max-width:calc(100% - 64px);overflow:hidden;padding:0 var(--notebook-find-horizontal-padding);position:absolute;right:18px;top:-45px;transition:top .2s linear;visibility:hidden;width:var(--notebook-find-width);z-index:10}.monaco-workbench.reduce-motion .simple-fr-find-part-wrapper{transition:top 0ms linear}.monaco-workbench .notebookOverlay .simple-fr-find-part-wrapper.visible{z-index:100}.monaco-workbench .simple-fr-find-part,.monaco-workbench .simple-fr-replace-part{align-items:center;display:flex;margin:0 0 0 17px;padding:4px;pointer-events:all;position:relative;top:0;z-index:10}.monaco-workbench .simple-fr-find-part-wrapper .find-replace-progress{height:2px;position:absolute;width:100%}.monaco-workbench .simple-fr-find-part-wrapper .find-replace-progress .monaco-progress-container{top:0!important;z-index:100!important}.monaco-workbench .simple-fr-find-part-wrapper .monaco-findInput{width:224px}.monaco-workbench .simple-fr-find-part-wrapper .button{align-items:center;background-position:50%;background-repeat:no-repeat;cursor:pointer;display:flex;flex:initial;height:20px;justify-content:center;margin-left:3px;width:20px}.monaco-workbench .simple-fr-find-part-wrapper.visible .simple-fr-find-part{visibility:visible}.monaco-workbench .simple-fr-find-part-wrapper .toggle{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:center;margin-left:0;pointer-events:all;position:absolute;top:0;width:18px}.monaco-workbench .simple-fr-find-part-wrapper.visible{visibility:visible}.monaco-workbench .simple-fr-find-part-wrapper.visible-transition{top:0}.monaco-workbench .simple-fr-find-part .monaco-findInput{flex:1}.monaco-workbench .simple-fr-find-part .button{background-position:50%;background-repeat:no-repeat;cursor:pointer;display:flex;flex:initial;height:20px;margin-left:3px;min-width:20px;width:20px}.monaco-workbench .simple-fr-find-part-wrapper .button.disabled{cursor:default;opacity:.3}.monaco-workbench .simple-fr-find-part-wrapper .monaco-custom-toggle.disabled{background-color:inherit!important;cursor:default;opacity:.3;pointer-events:none;user-select:none;-webkit-user-select:none}.monaco-workbench .simple-fr-find-part-wrapper .find-filter-button{box-sizing:border-box;color:inherit;cursor:pointer;float:left;margin-left:2px;user-select:none;-webkit-user-select:none}.find-filter-button .monaco-action-bar .action-label{padding:0}.monaco-workbench .simple-fr-find-part .monaco-inputbox>.ibwrapper>.input,.monaco-workbench .simple-fr-replace-part .monaco-inputbox>.ibwrapper>.input{height:24px}.monaco-workbench .simple-fr-find-part-wrapper .monaco-sash{background-color:var(--vscode-editorWidget-resizeBorder,var(--vscode-editorWidget-border));left:0!important}";
4
4
  n(css,{});
5
5
 
6
6
  export { css, css as default };
@@ -1,4 +1,4 @@
1
- import { ReplacePreviewContentProvider } from './replaceService.js';
1
+ import { ReplacePreviewContentProvider } from '../replaceService.js';
2
2
  import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
3
3
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
4
4
 
@@ -13,14 +13,14 @@ import { DefaultQuickAccessFilterValue } from 'monaco-editor/esm/vs/platform/qui
13
13
  import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
14
14
  import { IViewsService } from 'vscode/vscode/vs/workbench/common/views';
15
15
  import { searchDetailsIcon, searchOpenInFileIcon } from '../searchIcons.js';
16
- import { SearchModel, searchComparer, MatchInNotebook } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
16
+ import { SearchModel, searchComparer } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
17
17
  import { getEditorSelectionFromMatch } from '../searchView.js';
18
18
  import { getOutOfWorkspaceEditorResources } from 'vscode/vscode/vs/workbench/contrib/search/common/search';
19
19
  import { SIDE_GROUP, ACTIVE_GROUP, IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
20
20
  import { QueryBuilder } from 'vscode/vscode/vs/workbench/services/search/common/queryBuilder';
21
21
  import { VIEW_ID } from 'vscode/vscode/vs/workbench/services/search/common/search';
22
22
 
23
- const TEXT_SEARCH_QUICK_ACCESS_PREFIX = '% ';
23
+ const TEXT_SEARCH_QUICK_ACCESS_PREFIX = '%';
24
24
  const DEFAULT_TEXT_QUERY_BUILDER_OPTIONS = {
25
25
  _reason: 'quickAccessSearch',
26
26
  disregardIgnoreFiles: false,
@@ -62,6 +62,9 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
62
62
  }
63
63
  provide(picker, token, runOptions) {
64
64
  const disposables = ( new DisposableStore());
65
+ if (TEXT_SEARCH_QUICK_ACCESS_PREFIX.length < picker.value.length) {
66
+ picker.valueSelection = [TEXT_SEARCH_QUICK_ACCESS_PREFIX.length, picker.value.length];
67
+ }
65
68
  disposables.add(super.provide(picker, token, runOptions));
66
69
  disposables.add(picker.onDidHide(() => this.searchModel.searchResult.toggleHighlights(false)));
67
70
  disposables.add(picker.onDidAccept(() => this.searchModel.searchResult.toggleHighlights(false)));
@@ -185,8 +188,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
185
188
  keyMods,
186
189
  selection: getEditorSelectionFromMatch(element, this.searchModel),
187
190
  preserveFocus: event.inBackground,
188
- forcePinned: event.inBackground,
189
- indexedCellOptions: element instanceof MatchInNotebook ? { index: element.cellIndex, selection: element.range() } : undefined
191
+ forcePinned: event.inBackground
190
192
  });
191
193
  }
192
194
  });
@@ -226,7 +228,13 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
226
228
  return {
227
229
  picks: syncResult,
228
230
  additionalPicks: allMatches.asyncResults
229
- .then(asyncResults => this._getPicksFromMatches(asyncResults, MAX_FILES_SHOWN - matches.length))
231
+ .then(asyncResults => (asyncResults.length + syncResult.length === 0) ? [{
232
+ label: ( localizeWithPath(
233
+ 'vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess',
234
+ 'noAnythingResults',
235
+ "No matching results"
236
+ ))
237
+ }] : this._getPicksFromMatches(asyncResults, MAX_FILES_SHOWN - matches.length))
230
238
  .then(picks => {
231
239
  if (picks.length > 0) {
232
240
  this.searchModel.searchResult.toggleHighlights(true);
@@ -186,9 +186,9 @@ let ReplaceService = class ReplaceService {
186
186
  const edits = [];
187
187
  if (arg instanceof Match) {
188
188
  if (arg instanceof MatchInNotebook) {
189
- if (!arg.isWebviewMatch()) {
189
+ if (!arg.isReadonly()) {
190
190
  const match = arg;
191
- edits.push(this.createEdit(match, match.replaceString, match.cell.uri));
191
+ edits.push(this.createEdit(match, match.replaceString, match.cell?.uri));
192
192
  }
193
193
  }
194
194
  else {
@@ -15,7 +15,7 @@ import { Extensions, IViewDescriptorService } from 'vscode/vscode/vs/workbench/c
15
15
  import { GotoSymbolQuickAccessProvider } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess';
16
16
  import { AnythingQuickAccessProvider } from './anythingQuickAccess.js';
17
17
  import { registerContributions } from './replaceContributions.js';
18
- import { registerContributions as registerContributions$1 } from './notebookSearchContributions.js';
18
+ import { registerContributions as registerContributions$1 } from './notebookSearch/notebookSearchContributions.js';
19
19
  import { searchViewIcon } from './searchIcons.js';
20
20
  import { SearchView } from './searchView.js';
21
21
  import { registerContributions as registerContributions$2 } from './searchWidget.js';
@@ -41,11 +41,11 @@ registerContributions$2();
41
41
  const SEARCH_MODE_CONFIG = 'search.mode';
42
42
  const viewContainer = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
43
43
  id: VIEWLET_ID,
44
- title: { value: ( nls.localizeWithPath(
44
+ title: ( nls.localize2WithPath(
45
45
  'vs/workbench/contrib/search/browser/search.contribution',
46
- 'name',
46
+ 'search',
47
47
  "Search"
48
- )), original: 'Search' },
48
+ )),
49
49
  ctorDescriptor: ( new SyncDescriptor(
50
50
  ViewPaneContainer,
51
51
  [VIEWLET_ID, { mergeViewWithContainerWhenSingleView: true }]
@@ -57,7 +57,7 @@ const viewContainer = ( Registry.as(Extensions.ViewContainersRegistry)).register
57
57
  const viewDescriptor = {
58
58
  id: VIEW_ID,
59
59
  containerIcon: searchViewIcon,
60
- name: ( nls.localizeWithPath(
60
+ name: ( nls.localize2WithPath(
61
61
  'vs/workbench/contrib/search/browser/search.contribution',
62
62
  'search',
63
63
  "Search"
@@ -84,7 +84,7 @@ let RegisterSearchViewContribution = class RegisterSearchViewContribution {
84
84
  constructor(configurationService, viewDescriptorService) {
85
85
  const data = configurationService.inspect('search.location');
86
86
  if (data.value === 'panel') {
87
- viewDescriptorService.moveViewToLocation(viewDescriptor, 1 );
87
+ viewDescriptorService.moveViewToLocation(viewDescriptor, 1 , 'search.location');
88
88
  }
89
89
  ( Registry.as(Extensions$4.ConfigurationMigration))
90
90
  .registerConfigurationMigrations([{ key: 'search.location', migrateFn: (value) => ({ value: undefined }) }]);
@@ -271,7 +271,7 @@ configurationRegistry.registerConfiguration({
271
271
  markdownDescription: ( nls.localizeWithPath(
272
272
  'vs/workbench/contrib/search/browser/search.contribution',
273
273
  'useGlobalIgnoreFiles',
274
- "Controls whether to use your global gitignore file (e.g., from `$HOME/.config/git/ignore`) when searching for files. Requires `#search.useIgnoreFiles#` to be enabled."
274
+ "Controls whether to use your global gitignore file (for example, from `$HOME/.config/git/ignore`) when searching for files. Requires `#search.useIgnoreFiles#` to be enabled."
275
275
  )),
276
276
  default: false,
277
277
  scope: 4
@@ -10,8 +10,7 @@ const category = { value: ( nls.localizeWithPath(
10
10
  )), original: 'Search' };
11
11
  function isSearchViewFocused(viewsService) {
12
12
  const searchView = getSearchView(viewsService);
13
- const activeElement = document.activeElement;
14
- return !!(searchView && activeElement && dom.isAncestor(activeElement, searchView.getContainer()));
13
+ return !!(searchView && dom.isAncestorOfActiveElement(searchView.getContainer()));
15
14
  }
16
15
  function appendKeyBindingLabel(label, inputKeyBinding) {
17
16
  return doAppendKeyBindingLabel(label, inputKeyBinding);
@@ -151,7 +151,7 @@ registerAction2(class FindInFilesAction extends Action2 {
151
151
  )),
152
152
  original: 'Find in Files'
153
153
  },
154
- description: {
154
+ metadata: {
155
155
  description: ( nls.localizeWithPath(
156
156
  'vs/workbench/contrib/search/browser/searchActionsFind',
157
157
  'findInFiles.description',
@@ -13,6 +13,7 @@ import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/
13
13
  import { ToggleCaseSensitiveKeybinding, ToggleWholeWordKeybinding, ToggleRegexKeybinding, TogglePreserveCaseKeybinding } from 'monaco-editor/esm/vs/editor/contrib/find/browser/findModel.js';
14
14
  import { category, getSearchView, openSearchView } from './searchActionsBase.js';
15
15
  import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
16
+ import { getActiveElement } from 'monaco-editor/esm/vs/base/browser/dom.js';
16
17
 
17
18
  registerAction2(class ToggleQueryDetailsAction extends Action2 {
18
19
  constructor() {
@@ -35,7 +36,7 @@ registerAction2(class ToggleQueryDetailsAction extends Action2 {
35
36
  });
36
37
  }
37
38
  run(accessor, ...args) {
38
- const contextService = accessor.get(IContextKeyService).getContext(document.activeElement);
39
+ const contextService = accessor.get(IContextKeyService).getContext(getActiveElement());
39
40
  if (contextService.getValue(InSearchEditor.serialize())) {
40
41
  accessor.get(IEditorService).activeEditorPane.toggleQueryDetails(args[0]?.show);
41
42
  }
@@ -269,12 +269,12 @@ let MatchRenderer = class MatchRenderer extends Disposable {
269
269
  }
270
270
  renderTemplate(container) {
271
271
  container.classList.add('linematch');
272
+ const lineNumber = dom.append(container, dom.$('span.matchLineNum'));
272
273
  const parent = dom.append(container, dom.$('a.plain.match'));
273
274
  const before = dom.append(parent, dom.$('span'));
274
275
  const match = dom.append(parent, dom.$('span.findInFileMatch'));
275
276
  const replace = dom.append(parent, dom.$('span.replaceMatch'));
276
277
  const after = dom.append(parent, dom.$('span'));
277
- const lineNumber = dom.append(container, dom.$('span.matchLineNum'));
278
278
  const actionBarContainer = dom.append(container, dom.$('span.actionBarContainer'));
279
279
  const disposables = ( new DisposableStore());
280
280
  const contextKeyServiceMain = disposables.add(this.contextKeyService.createScoped(container));
@@ -306,18 +306,20 @@ let MatchRenderer = class MatchRenderer extends Disposable {
306
306
  renderElement(node, index, templateData) {
307
307
  const match = node.element;
308
308
  const preview = match.preview();
309
- const replace = this.searchModel.isReplaceActive() && !!this.searchModel.replaceString && !(match instanceof MatchInNotebook && match.isWebviewMatch());
309
+ const replace = this.searchModel.isReplaceActive() &&
310
+ !!this.searchModel.replaceString &&
311
+ !(match instanceof MatchInNotebook && match.isReadonly());
310
312
  templateData.before.textContent = preview.before;
311
313
  templateData.match.textContent = preview.inside;
312
314
  templateData.match.classList.toggle('replace', replace);
313
315
  templateData.replace.textContent = replace ? match.replaceString : '';
314
316
  templateData.after.textContent = preview.after;
315
317
  templateData.parent.title = (preview.before + (replace ? match.replaceString : preview.inside) + preview.after).trim().substr(0, 999);
316
- IsEditableItemKey.bindTo(templateData.contextKeyService).set(!(match instanceof MatchInNotebook && match.isWebviewMatch()));
318
+ IsEditableItemKey.bindTo(templateData.contextKeyService).set(!(match instanceof MatchInNotebook && match.isReadonly()));
317
319
  const numLines = match.range().endLineNumber - match.range().startLineNumber;
318
320
  const extraLinesStr = numLines > 0 ? `+${numLines}` : '';
319
321
  const showLineNumbers = this.configurationService.getValue('search').showLineNumbers;
320
- const lineNumberStr = showLineNumbers ? `:${match.range().startLineNumber}` : '';
322
+ const lineNumberStr = showLineNumbers ? `${match.range().startLineNumber}:` : '';
321
323
  templateData.lineNumber.classList.toggle('show', (numLines > 0) || showLineNumbers);
322
324
  templateData.lineNumber.textContent = lineNumberStr + extraLinesStr;
323
325
  templateData.lineNumber.setAttribute('title', this.getMatchTitle(match, showLineNumbers));
@@ -13,14 +13,14 @@ import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
13
13
  import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
14
14
  import * as network from 'monaco-editor/esm/vs/base/common/network.js';
15
15
  import './media/searchview.css.js';
16
- import { isCodeEditor, isDiffEditor, getCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
16
+ import { isCodeEditor, getCodeEditor, isDiffEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
17
17
  import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
18
18
  import { EmbeddedCodeEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js';
19
19
  import { Selection } from 'monaco-editor/esm/vs/editor/common/core/selection.js';
20
20
  import { CommonFindController } from 'monaco-editor/esm/vs/editor/contrib/find/browser/findController.js';
21
21
  import { MultiCursorSelectionController } from 'monaco-editor/esm/vs/editor/contrib/multicursor/browser/multicursor.js';
22
22
  import * as nls from 'monaco-editor/esm/vs/nls.js';
23
- import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
23
+ import { IAccessibilityService, IAccessibleNotificationService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
24
24
  import { MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
25
25
  import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
26
26
  import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
@@ -81,7 +81,7 @@ const DEBOUNCE_DELAY = 75;
81
81
  let SearchView = class SearchView extends ViewPane {
82
82
  static { SearchView_1 = this; }
83
83
  static { this.ACTIONS_RIGHT_CLASS_NAME = 'actions-right'; }
84
- constructor(options, fileService, editorService, codeEditorService, progressService, notificationService, dialogService, commandService, contextViewService, instantiationService, viewDescriptorService, configurationService, contextService, searchViewModelWorkbenchService, contextKeyService, replaceService, textFileService, preferencesService, themeService, searchHistoryService, contextMenuService, accessibilityService, keybindingService, storageService, openerService, telemetryService, notebookService, logService) {
84
+ constructor(options, fileService, editorService, codeEditorService, progressService, notificationService, dialogService, commandService, contextViewService, instantiationService, viewDescriptorService, configurationService, contextService, searchViewModelWorkbenchService, contextKeyService, replaceService, textFileService, preferencesService, themeService, searchHistoryService, contextMenuService, accessibilityService, keybindingService, storageService, openerService, telemetryService, notebookService, logService, accessibleNotificationService) {
85
85
  super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
86
86
  this.fileService = fileService;
87
87
  this.editorService = editorService;
@@ -101,6 +101,7 @@ let SearchView = class SearchView extends ViewPane {
101
101
  this.storageService = storageService;
102
102
  this.notebookService = notebookService;
103
103
  this.logService = logService;
104
+ this.accessibleNotificationService = accessibleNotificationService;
104
105
  this.isDisposed = false;
105
106
  this.lastFocusState = 'input';
106
107
  this.messageDisposables = ( new DisposableStore());
@@ -812,7 +813,7 @@ let SearchView = class SearchView extends ViewPane {
812
813
  }
813
814
  let editable = false;
814
815
  if (focus instanceof Match) {
815
- editable = (focus instanceof MatchInNotebook) ? !focus.isWebviewMatch() : true;
816
+ editable = (focus instanceof MatchInNotebook) ? !focus.isReadonly() : true;
816
817
  }
817
818
  else if (focus instanceof FileMatch) {
818
819
  editable = !focus.hasOnlyReadOnlyMatches();
@@ -952,7 +953,7 @@ let SearchView = class SearchView extends ViewPane {
952
953
  return this.updateTextFromSelection({ allowUnselectedWord, allowSearchOnType }, activeEditor);
953
954
  }
954
955
  updateTextFromFindWidget(controller, { allowSearchOnType = true }) {
955
- if (!this.searchConfig.seedWithNearestWord && (window.getSelection()?.toString() ?? '') === '') {
956
+ if (!this.searchConfig.seedWithNearestWord && (dom.getActiveWindow().getSelection()?.toString() ?? '') === '') {
956
957
  return false;
957
958
  }
958
959
  const searchString = controller.getState().searchString;
@@ -1102,11 +1103,7 @@ let SearchView = class SearchView extends ViewPane {
1102
1103
  'emptySearch',
1103
1104
  "Empty Search"
1104
1105
  ));
1105
- aria.status(( nls.localizeWithPath(
1106
- 'vs/workbench/contrib/search/browser/searchView',
1107
- 'ariaSearchResultsClearStatus',
1108
- "The search results have been cleared"
1109
- )));
1106
+ this.accessibleNotificationService.notify("clear" );
1110
1107
  this.reLayout();
1111
1108
  }
1112
1109
  clearFilePatternFields() {
@@ -1134,18 +1131,10 @@ let SearchView = class SearchView extends ViewPane {
1134
1131
  }
1135
1132
  }
1136
1133
  getSearchTextFromEditor(allowUnselectedWord, editor) {
1137
- if (dom.isAncestor(document.activeElement, this.getContainer())) {
1134
+ if (dom.isAncestorOfActiveElement(this.getContainer())) {
1138
1135
  return null;
1139
1136
  }
1140
1137
  editor = editor ?? this.editorService.activeTextEditorControl;
1141
- if (isDiffEditor(editor)) {
1142
- if (editor.getOriginalEditor().hasTextFocus()) {
1143
- editor = editor.getOriginalEditor();
1144
- }
1145
- else {
1146
- editor = editor.getModifiedEditor();
1147
- }
1148
- }
1149
1138
  if (!editor) {
1150
1139
  return null;
1151
1140
  }
@@ -1985,7 +1974,8 @@ SearchView = SearchView_1 = ( __decorate([
1985
1974
  ( __param(24, IOpenerService)),
1986
1975
  ( __param(25, ITelemetryService)),
1987
1976
  ( __param(26, INotebookService)),
1988
- ( __param(27, ILogService))
1977
+ ( __param(27, ILogService)),
1978
+ ( __param(28, IAccessibleNotificationService))
1989
1979
  ], SearchView));
1990
1980
  class SearchLinkButton extends Disposable {
1991
1981
  constructor(label, handler, tooltip) {
@@ -2032,7 +2022,16 @@ function getEditorSelectionFromMatch(element, viewModel) {
2032
2022
  }
2033
2023
  return undefined;
2034
2024
  }
2035
- function getSelectionTextFromEditor(allowUnselectedWord, editor) {
2025
+ function getSelectionTextFromEditor(allowUnselectedWord, activeEditor) {
2026
+ let editor = activeEditor;
2027
+ if (isDiffEditor(editor)) {
2028
+ if (editor.getOriginalEditor().hasTextFocus()) {
2029
+ editor = editor.getOriginalEditor();
2030
+ }
2031
+ else {
2032
+ editor = editor.getModifiedEditor();
2033
+ }
2034
+ }
2036
2035
  if (!isCodeEditor(editor) || !editor.hasModel()) {
2037
2036
  return null;
2038
2037
  }
@@ -139,7 +139,7 @@ let SearchWidget = class SearchWidget extends Widget {
139
139
  this._register(this.editorService.onDidEditorsChange((e) => {
140
140
  if (this.searchInput instanceof SearchFindInput &&
141
141
  e.event.editor instanceof NotebookEditorInput &&
142
- ((e.event.kind === 3 || e.event.kind === 4) )) {
142
+ ((e.event.kind === 4 || e.event.kind === 5) )) {
143
143
  this.searchInput.filterVisible = this._hasNotebookOpen();
144
144
  }
145
145
  }));
@@ -26,6 +26,7 @@ import { VIEW_ID } from 'vscode/vscode/vs/workbench/services/search/common/searc
26
26
  import { RegisteredEditorPriority, IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
27
27
  import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService';
28
28
  import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
29
+ import { getActiveElement } from 'monaco-editor/esm/vs/base/browser/dom.js';
29
30
 
30
31
  const OpenInEditorCommandId = 'search.action.openInEditor';
31
32
  const OpenNewEditorToSideCommandId = 'search.action.openNewEditorToSide';
@@ -140,7 +141,7 @@ const translateLegacyConfig = (legacyConfig = {}) => {
140
141
  });
141
142
  return config;
142
143
  };
143
- const openArgDescription = {
144
+ const openArgMetadata = {
144
145
  description: 'Open a new search editor. Arguments passed can include variables like ${relativeFileDirname}.',
145
146
  args: [{
146
147
  name: 'Open new Search Editor args',
@@ -181,7 +182,7 @@ registerAction2(class extends Action2 {
181
182
  });
182
183
  }
183
184
  async run(accessor) {
184
- const contextService = accessor.get(IContextKeyService).getContext(document.activeElement);
185
+ const contextService = accessor.get(IContextKeyService).getContext(getActiveElement());
185
186
  if (contextService.getValue(InSearchEditor.serialize())) {
186
187
  accessor.get(IEditorService).activeEditorPane.deleteResultBlock();
187
188
  }
@@ -198,7 +199,7 @@ registerAction2(class extends Action2 {
198
199
  )), original: 'New Search Editor' },
199
200
  category,
200
201
  f1: true,
201
- description: openArgDescription
202
+ metadata: openArgMetadata
202
203
  });
203
204
  }
204
205
  async run(accessor, args) {
@@ -216,7 +217,7 @@ registerAction2(class extends Action2 {
216
217
  )), original: 'Open Search Editor' },
217
218
  category,
218
219
  f1: true,
219
- description: openArgDescription
220
+ metadata: openArgMetadata
220
221
  });
221
222
  }
222
223
  async run(accessor, args) {
@@ -234,7 +235,7 @@ registerAction2(class extends Action2 {
234
235
  )), original: 'Open new Search Editor to the Side' },
235
236
  category,
236
237
  f1: true,
237
- description: openArgDescription
238
+ metadata: openArgMetadata
238
239
  });
239
240
  }
240
241
  async run(accessor, args) {
@@ -224,6 +224,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
224
224
  return this.searchResultEditor;
225
225
  }
226
226
  focus() {
227
+ super.focus();
227
228
  const viewState = this.loadEditorViewState(this.getInput());
228
229
  if (viewState && viewState.focused === 'editor') {
229
230
  this.searchResultEditor.focus();
@@ -618,7 +619,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
618
619
  }
619
620
  this.searchResultEditor.setModel(resultsModel);
620
621
  this.pauseSearching = true;
621
- this.toggleRunAgainMessage(!newInput.ongoingSearchOperation && resultsModel.getLineCount() === 1 && resultsModel.getValue() === '' && configurationModel.config.query !== '');
622
+ this.toggleRunAgainMessage(!newInput.ongoingSearchOperation && resultsModel.getLineCount() === 1 && resultsModel.getValueLength() === 0 && configurationModel.config.query !== '');
622
623
  this.setSearchConfig(configurationModel.config);
623
624
  this._register(configurationModel.onConfigDidUpdate(newConfig => {
624
625
  if (newConfig !== this.priorConfig) {
@@ -91,7 +91,7 @@ function matchesToSearchResultFormat(resource, sortedMatches, matchContext, labe
91
91
  return { text, matchRanges };
92
92
  }
93
93
  function cellMatchToSearchResultFormat(cellMatch, labelFormatter, shouldUseHeader) {
94
- return matchesToSearchResultFormat(cellMatch.cell.uri, cellMatch.contentMatches.sort(searchMatchComparer), cellMatch.context, labelFormatter, shouldUseHeader);
94
+ return matchesToSearchResultFormat(cellMatch.cell?.uri ?? cellMatch.parent.resource, cellMatch.contentMatches.sort(searchMatchComparer), cellMatch.context, labelFormatter, shouldUseHeader);
95
95
  }
96
96
  const contentPatternToSearchConfiguration = (pattern, includes, excludes, contextLines) => {
97
97
  return {
@@ -16,7 +16,7 @@ import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workb
16
16
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
17
17
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
18
18
  import { deserializeSearchError, SearchErrorCode, SEARCH_RESULT_LANGUAGE_ID, FileMatch, pathIncludedInQuery, isFileMatch, isProgressMessage } from 'vscode/vscode/vs/workbench/services/search/common/search';
19
- import { editorMatchesToTextSearchResults, addContextToEditorMatches } from 'vscode/vscode/vs/workbench/services/search/common/searchHelpers';
19
+ import { editorMatchesToTextSearchResults, getTextSearchMatchWithModelContext } from 'vscode/vscode/vs/workbench/services/search/common/searchHelpers';
20
20
 
21
21
  let SearchService = class SearchService extends Disposable {
22
22
  constructor(modelService, editorService, telemetryService, logService, extensionService, fileService, uriIdentityService) {
@@ -338,7 +338,7 @@ let SearchService = class SearchService extends Disposable {
338
338
  const fileMatch = ( new FileMatch(originalResource));
339
339
  openEditorResults.set(originalResource, fileMatch);
340
340
  const textSearchResults = editorMatchesToTextSearchResults(matches, model, query.previewOptions);
341
- fileMatch.results = addContextToEditorMatches(textSearchResults, model, query);
341
+ fileMatch.results = getTextSearchMatchWithModelContext(textSearchResults, model, query);
342
342
  }
343
343
  else {
344
344
  openEditorResults.set(originalResource, null);