Skip to content

Commit

Permalink
fix: microsoft#211878 for preferencesModels.ts (microsoft#230031)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhao271 authored Sep 27, 2024
1 parent 7112c83 commit bd9abc6
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ function parse(model: ITextModel, isSettingsProperty: (currentProperty: string,
if (!model.isDisposed()) {
visit(model.getValue(), visitor);
}
return settings.length > 0 ? [<ISettingsGroup>{
return settings.length > 0 ? [{
id: model.isDisposed() ? '' : model.id,
sections: [
{
settings
Expand All @@ -431,7 +432,7 @@ function parse(model: ITextModel, isSettingsProperty: (currentProperty: string,
title: '',
titleRange: nullRange,
range
}] : [];
} satisfies ISettingsGroup] : [];
}

export class WorkspaceConfigurationEditorModel extends SettingsEditorModel {
Expand Down Expand Up @@ -844,7 +845,7 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements

const metadata = this.collectMetadata(resultGroups);
return resultGroups.length ?
<IFilterResult>{
{
allGroups: this.settingsGroups,
filteredGroups,
matches,
Expand Down Expand Up @@ -894,9 +895,10 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements
filterMatches = filterMatches
.map(filteredMatch => {
// Fix match ranges to offset from setting start line
return <ISettingMatch>{
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,
Expand Down Expand Up @@ -965,7 +967,7 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements
}

private getGroup(resultGroup: ISearchResultGroup): ISettingsGroup {
return <ISettingsGroup>{
return {
id: resultGroup.id,
range: nullRange,
title: resultGroup.label,
Expand Down

0 comments on commit bd9abc6

Please sign in to comment.