Open normal editor when opening a non-vscode settings.json

Fix #123795
This commit is contained in:
Rob Lourens 2021-05-13 11:35:57 -07:00
parent 478ec15a80
commit f5df5fb197

View file

@ -23,6 +23,7 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IEditorInputWithOptions } from 'vs/workbench/common/editor';
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
import { ContributedEditorPriority, IEditorOverrideService } from 'vs/workbench/services/editor/common/editorOverrideService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { FOLDER_SETTINGS_PATH, IPreferencesService, USE_SPLIT_JSON_SETTING } from 'vs/workbench/services/preferences/common/preferences';
import { PreferencesEditorInput } from 'vs/workbench/services/preferences/common/preferencesEditorInput';
@ -41,6 +42,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
@IWorkspaceContextService private readonly workspaceService: IWorkspaceContextService,
@IConfigurationService private readonly configurationService: IConfigurationService,
@IEditorOverrideService private readonly editorOverrideService: IEditorOverrideService,
@IEditorService private readonly editorService: IEditorService,
) {
this.settingsListener = this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(USE_SPLIT_JSON_SETTING)) {
@ -94,7 +96,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
}
}
return { editor: this.preferencesService.getCurrentOrNewSplitJsonEditorInput(ConfigurationTarget.USER_LOCAL, this.environmentService.settingsResource, group), options };
return { editor: this.editorService.createEditorInput({ resource }), options };
}
);
}