Allow setting startupEditor to readme as either default value or user value.

Fix github/codespaces#1580
This commit is contained in:
Jackson Kearl 2021-02-03 10:37:40 -08:00 committed by Sandeep Somavarapu
parent 370a7ee077
commit 5d650cd817

View file

@ -72,7 +72,12 @@ export class WelcomePageContribution implements IWorkbenchContribution {
// Open the welcome even if we opened a set of default editors
if ((!editorService.activeEditor || layoutService.openedDefaultEditors) && !hasBackups) {
const startupEditorSetting = configurationService.inspect<string>(configurationKey);
const openWithReadme = startupEditorSetting.userValue === 'readme';
// 'readme' should not be set in workspace settings to prevent tracking,
// but it can be set as a default (as in codespaces) or a user setting
const openWithReadme = startupEditorSetting.value === 'readme' &&
(startupEditorSetting.userValue === 'readme' || startupEditorSetting.defaultValue === 'readme');
if (openWithReadme) {
return Promise.all(contextService.getWorkspace().folders.map(folder => {
const folderUri = folder.uri;