From 283fa2e016c0765ce2e712f0e1edd0378db42bef Mon Sep 17 00:00:00 2001 From: Bhavya U Date: Thu, 19 Sep 2024 14:50:51 -0700 Subject: [PATCH] Remove threshold check for RelatedInformationProvider (#229103) --- .../workbench/contrib/preferences/browser/preferencesSearch.ts | 3 +-- .../contrib/quickaccess/browser/commandsQuickAccess.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts b/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts index c19cb697c46..e81c8009f79 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts @@ -360,7 +360,6 @@ class AiRelatedInformationSearchKeysProvider { } class AiRelatedInformationSearchProvider implements IRemoteSearchProvider { - private static readonly AI_RELATED_INFORMATION_THRESHOLD = 0.73; private static readonly AI_RELATED_INFORMATION_MAX_PICKS = 5; private readonly _keysProvider: AiRelatedInformationSearchKeysProvider; @@ -399,7 +398,7 @@ class AiRelatedInformationSearchProvider implements IRemoteSearchProvider { relatedInformation.sort((a, b) => b.weight - a.weight); for (const info of relatedInformation) { - if (info.weight < AiRelatedInformationSearchProvider.AI_RELATED_INFORMATION_THRESHOLD || filterMatches.length === AiRelatedInformationSearchProvider.AI_RELATED_INFORMATION_MAX_PICKS) { + if (filterMatches.length === AiRelatedInformationSearchProvider.AI_RELATED_INFORMATION_MAX_PICKS) { break; } const pick = info.setting; diff --git a/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts b/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts index 6dcf73e0c8e..3ab1684b9ac 100644 --- a/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts +++ b/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts @@ -43,7 +43,6 @@ import { IPreferencesService } from '../../../services/preferences/common/prefer export class CommandsQuickAccessProvider extends AbstractEditorCommandsQuickAccessProvider { private static AI_RELATED_INFORMATION_MAX_PICKS = 5; - private static AI_RELATED_INFORMATION_THRESHOLD = 0.8; private static AI_RELATED_INFORMATION_DEBOUNCE = 200; // If extensions are not yet registered, we wait for a little moment to give them @@ -199,7 +198,7 @@ export class CommandsQuickAccessProvider extends AbstractEditorCommandsQuickAcce const additionalPicks = new Array(); for (const info of relatedInformation) { - if (info.weight < CommandsQuickAccessProvider.AI_RELATED_INFORMATION_THRESHOLD || additionalPicks.length === CommandsQuickAccessProvider.AI_RELATED_INFORMATION_MAX_PICKS) { + if (additionalPicks.length === CommandsQuickAccessProvider.AI_RELATED_INFORMATION_MAX_PICKS) { break; } const pick = allPicks.find(p => p.commandId === info.command && !setOfPicksSoFar.has(p.commandId));