Skip to content

search: fix search-on-type not working in agents window search editor#316117

Merged
sandy081 merged 2 commits into
mainfrom
sandy081/search-on-type-agents-window
May 12, 2026
Merged

search: fix search-on-type not working in agents window search editor#316117
sandy081 merged 2 commits into
mainfrom
sandy081/search-on-type-agents-window

Conversation

@sandy081
Copy link
Copy Markdown
Member

Problem

In the agents window, the search editor does not show results as you type — you have to press Enter to trigger a search.

Root cause: search.searchOnType and search.searchOnTypeDebouncePeriod were only registered in search.contribution.ts, which is the full workbench-only search contribution. The agents window does not import this file, so configurationService.getValue('search').searchOnType returned undefined (falsy). The SearchWidget.onSearchInputChanged() guard if (this.searchConfiguration.searchOnType) then never fired, silently disabling search-as-you-type.

Fix

  • Move search.searchOnType and search.searchOnTypeDebouncePeriod into search.common.contribution.ts, which is imported by both the main workbench and the agents window.
  • Introduce searchConfigurationNode in search.ts (common) — a shared constant for the configuration node metadata (id, order, title, type) — and use it with spread syntax in all three registration sites (search.common.contribution.ts, search.contribution.ts, searchEditor.contribution.ts) to avoid duplicating this boilerplate.

Register search.searchOnType and search.searchOnTypeDebouncePeriod settings
in search.common.contribution.ts so they are available in the agents window.
Previously these were only registered in search.contribution.ts (workbench-only),
so the agents window read undefined for searchOnType, disabling search-as-you-type.

Also introduce searchConfigurationNode in search.ts (common) to share the
configuration node metadata (id, order, title, type) across all three
registration sites without duplication.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 20:58
@sandy081 sandy081 enabled auto-merge (squash) May 12, 2026 20:58
@sandy081 sandy081 self-assigned this May 12, 2026
@sandy081 sandy081 added this to the 1.121.0 milestone May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Search Editor “search as you type” in the Agents window by ensuring the relevant search configuration settings are registered in code that’s loaded by both the full workbench and the Agents window.

Changes:

  • Move search.searchOnType and search.searchOnTypeDebouncePeriod setting registrations into search.common.contribution.ts (shared by workbench + Agents window).
  • Introduce a shared searchConfigurationNode constant and reuse it across Search, Search Editor, and common search contributions to avoid duplicated configuration-node boilerplate.
  • Remove the moved settings from the full workbench-only search.contribution.ts registration.
Show a summary per file
File Description
src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts Uses shared searchConfigurationNode when registering Search Editor settings.
src/vs/workbench/contrib/search/common/search.ts Adds exported searchConfigurationNode shared config metadata.
src/vs/workbench/contrib/search/browser/search.contribution.ts Reuses shared searchConfigurationNode and removes workbench-only registration of search-on-type settings.
src/vs/workbench/contrib/search/browser/search.common.contribution.ts Registers search.searchOnType and debounce settings in the shared contribution so Agents window picks them up.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 1

Comment thread src/vs/workbench/contrib/search/common/search.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sandy081 sandy081 merged commit 813d6b7 into main May 12, 2026
25 checks passed
@sandy081 sandy081 deleted the sandy081/search-on-type-agents-window branch May 12, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants