From bd9abc6ebe37ad975b7dc0c43c6ce2b384ec726d Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:37:13 -0700 Subject: [PATCH] fix: #211878 for preferencesModels.ts (#230031) --- .../services/preferences/common/preferencesModels.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/services/preferences/common/preferencesModels.ts b/src/vs/workbench/services/preferences/common/preferencesModels.ts index 8bc828292b109..e97874375fae9 100644 --- a/src/vs/workbench/services/preferences/common/preferencesModels.ts +++ b/src/vs/workbench/services/preferences/common/preferencesModels.ts @@ -422,7 +422,8 @@ function parse(model: ITextModel, isSettingsProperty: (currentProperty: string, if (!model.isDisposed()) { visit(model.getValue(), visitor); } - return settings.length > 0 ? [{ + return settings.length > 0 ? [{ + id: model.isDisposed() ? '' : model.id, sections: [ { settings @@ -431,7 +432,7 @@ function parse(model: ITextModel, isSettingsProperty: (currentProperty: string, title: '', titleRange: nullRange, range - }] : []; + } satisfies ISettingsGroup] : []; } export class WorkspaceConfigurationEditorModel extends SettingsEditorModel { @@ -844,7 +845,7 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements const metadata = this.collectMetadata(resultGroups); return resultGroups.length ? - { + { allGroups: this.settingsGroups, filteredGroups, matches, @@ -894,9 +895,10 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements filterMatches = filterMatches .map(filteredMatch => { // Fix match ranges to offset from setting start line - return { + return { setting: filteredMatch.setting, score: filteredMatch.score, + matchType: filteredMatch.matchType, matches: filteredMatch.matches && filteredMatch.matches.map(match => { return new Range( match.startLineNumber - filteredMatch.setting.range.startLineNumber, @@ -965,7 +967,7 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements } private getGroup(resultGroup: ISearchResultGroup): ISettingsGroup { - return { + return { id: resultGroup.id, range: nullRange, title: resultGroup.label,