From d4bb3930d199fba66723810ce321aa2ade39ec6e Mon Sep 17 00:00:00 2001 From: Andrea Mah <31675041+andreamah@users.noreply.github.com> Date: Tue, 19 Mar 2024 15:20:36 -0500 Subject: [PATCH] add extra debounce for ai search results (#208124) --- src/vs/workbench/contrib/search/browser/searchWidget.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/search/browser/searchWidget.ts b/src/vs/workbench/contrib/search/browser/searchWidget.ts index df86c23e543..5bf1f66744f 100644 --- a/src/vs/workbench/contrib/search/browser/searchWidget.ts +++ b/src/vs/workbench/contrib/search/browser/searchWidget.ts @@ -600,6 +600,7 @@ export class SearchWidget extends Widget { this.setReplaceAllActionState(false); if (this.searchConfiguration.searchOnType) { + const delayMultiplierFromAISearch = (this.searchInput && this.searchInput.isAIEnabled) ? 5 : 1; // expand debounce period to multiple by 5 if AI is enabled if (this.searchInput?.getRegex()) { try { const regex = new RegExp(this.searchInput.getValue(), 'ug'); @@ -618,12 +619,13 @@ export class SearchWidget extends Widget { matchienessHeuristic < 100 ? 5 : // expressions like `.` or `\w` 10; // only things matching empty string - this.submitSearch(true, this.searchConfiguration.searchOnTypeDebouncePeriod * delayMultiplier); + + this.submitSearch(true, this.searchConfiguration.searchOnTypeDebouncePeriod * delayMultiplier * delayMultiplierFromAISearch); } catch { // pass } } else { - this.submitSearch(true, this.searchConfiguration.searchOnTypeDebouncePeriod); + this.submitSearch(true, this.searchConfiguration.searchOnTypeDebouncePeriod * delayMultiplierFromAISearch); } } }