Remove threshold check for RelatedInformationProvider (#229103)

This commit is contained in:
Bhavya U
2024-09-19 23:50:51 +02:00
committed by GitHub
parent 0705fd4547
commit 283fa2e016
2 changed files with 2 additions and 4 deletions
@@ -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;
@@ -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<ICommandQuickPick | IQuickPickSeparator>();
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));