Skip to content

Commit bd06f6c

Browse files
authored
Support walkthrough open toSide (microsoft#204220)
1 parent 27e8f40 commit bd06f6c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { EditorExtensions, IEditorFactoryRegistry } from 'vs/workbench/common/ed
1010
import { MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions';
1111
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
1212
import { ContextKeyExpr, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
13-
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
13+
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
1414
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
1515
import { KeyCode } from 'vs/base/common/keyCodes';
1616
import { EditorPaneDescriptor, IEditorPaneRegistry } from 'vs/workbench/browser/editor';
@@ -65,7 +65,10 @@ registerAction2(class extends Action2 {
6565

6666
// We're trying to open the welcome page from the Help menu
6767
if (!selectedCategory && !selectedStep) {
68-
editorService.openEditor({ resource: GettingStartedInput.RESOURCE });
68+
editorService.openEditor({
69+
resource: GettingStartedInput.RESOURCE,
70+
options: <GettingStartedEditorOptions>{ preserveFocus: toSide ?? false }
71+
}, toSide ? SIDE_GROUP : undefined);
6972
return;
7073
}
7174

@@ -110,13 +113,16 @@ registerAction2(class extends Action2 {
110113
editorService.openEditor({
111114
resource: GettingStartedInput.RESOURCE,
112115
options: <GettingStartedEditorOptions>{ selectedCategory: selectedCategory, selectedStep: selectedStep, preserveFocus: toSide ?? false }
113-
}).then((editor) => {
116+
}, toSide ? SIDE_GROUP : undefined).then((editor) => {
114117
(editor as GettingStartedPage)?.makeCategoryVisibleWhenAvailable(selectedCategory, selectedStep);
115118
});
116119

117120
}
118121
} else {
119-
editorService.openEditor({ resource: GettingStartedInput.RESOURCE });
122+
editorService.openEditor({
123+
resource: GettingStartedInput.RESOURCE,
124+
options: <GettingStartedEditorOptions>{ preserveFocus: toSide ?? false }
125+
}, toSide ? SIDE_GROUP : undefined);
120126
}
121127
}
122128
});

0 commit comments

Comments
 (0)