Skip to content

Commit 04b15b5

Browse files
committed
feat: add settings search provider names
1 parent cbd7b0e commit 04b15b5

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ class EmbeddingsSearchProvider implements IRemoteSearchProvider {
416416

417417
return {
418418
filterMatches: await this.getEmbeddingsItems(token),
419-
exactMatch: false
419+
exactMatch: false,
420+
providerName: 'embeddings'
420421
};
421422
}
422423

@@ -507,7 +508,8 @@ class TfIdfSearchProvider implements IRemoteSearchProvider {
507508

508509
return {
509510
filterMatches: await this.getTfIdfItems(token),
510-
exactMatch: false
511+
exactMatch: false,
512+
providerName: 'tfIdf'
511513
};
512514
}
513515

src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,7 @@ export class SettingsEditor2 extends EditorPane {
11891189
type SettingsEditorModifiedSettingEvent = {
11901190
key: string;
11911191
groupId: string | undefined;
1192+
providerName: string | undefined;
11921193
nlpIndex: number | undefined;
11931194
displayIndex: number | undefined;
11941195
showConfiguredOnly: boolean;
@@ -1198,6 +1199,7 @@ export class SettingsEditor2 extends EditorPane {
11981199
type SettingsEditorModifiedSettingClassification = {
11991200
key: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The setting that is being modified.' };
12001201
groupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the setting is from the local search or remote search provider, if applicable.' };
1202+
providerName: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The name of the remote search provider, if applicable.' };
12011203
nlpIndex: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The index of the setting in the remote search provider results, if applicable.' };
12021204
displayIndex: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The index of the setting in the combined search results, if applicable.' };
12031205
showConfiguredOnly: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the user is in the modified view, which shows configured settings only.' };
@@ -1208,6 +1210,7 @@ export class SettingsEditor2 extends EditorPane {
12081210
};
12091211

12101212
let groupId: string | undefined = undefined;
1213+
let providerName: string | undefined = undefined;
12111214
let nlpIndex: number | undefined = undefined;
12121215
let displayIndex: number | undefined = undefined;
12131216
if (props.searchResults) {
@@ -1220,6 +1223,7 @@ export class SettingsEditor2 extends EditorPane {
12201223
groupId = settingInLocalResults ? 'local' : 'remote';
12211224
}
12221225
if (rawResults[SearchResultIdx.Remote]) {
1226+
providerName = rawResults[SearchResultIdx.Remote].providerName;
12231227
const _nlpIndex = rawResults[SearchResultIdx.Remote].filterMatches.findIndex(m => m.setting.key === props.key);
12241228
nlpIndex = _nlpIndex >= 0 ? _nlpIndex : undefined;
12251229
}
@@ -1234,6 +1238,7 @@ export class SettingsEditor2 extends EditorPane {
12341238
const data = {
12351239
key: props.key,
12361240
groupId,
1241+
providerName,
12371242
nlpIndex,
12381243
displayIndex,
12391244
showConfiguredOnly: props.showConfiguredOnly,

src/vs/workbench/services/preferences/common/preferences.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export interface ISearchResult {
111111
filterMatches: ISettingMatch[];
112112
exactMatch: boolean;
113113
metadata?: IFilterMetadata;
114+
providerName?: string;
114115
}
115116

116117
export interface ISearchResultGroup {

0 commit comments

Comments
 (0)