Skip to content

Commit dcd3480

Browse files
author
Benjamin Pasero
committed
web - allow to override product config as API
1 parent aab2c89 commit dcd3480

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/vs/workbench/browser/web.main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class BrowserMain extends Disposable {
160160
serviceCollection.set(IWorkbenchEnvironmentService, environmentService);
161161

162162
// Product
163-
const productService: IProductService = { _serviceBrand: undefined, ...product };
163+
const productService: IProductService = { _serviceBrand: undefined, ...product, ...this.configuration.productConfiguration };
164164
serviceCollection.set(IProductService, productService);
165165

166166
// Remote

src/vs/workbench/workbench.web.api.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { Event, Emitter } from 'vs/base/common/event';
1717
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
1818
import { IWorkspaceProvider, IWorkspace } from 'vs/workbench/services/host/browser/browserHostService';
1919
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
20+
import { IProductConfiguration } from 'vs/platform/product/common/productService';
2021

2122
interface IResourceUriProvider {
2223
(uri: URI): URI;
@@ -282,15 +283,25 @@ interface IWorkbenchConstructionOptions {
282283
*/
283284
readonly commands?: readonly ICommand[];
284285

286+
/**
287+
* Optional default layout to apply on first time the workspace is opened.
288+
*/
289+
readonly defaultLayout?: IDefaultLayout;
290+
291+
//#endregion
292+
293+
294+
//#region Branding
295+
285296
/**
286297
* Optional home indicator to appear above the hamburger menu in the activity bar.
287298
*/
288299
readonly homeIndicator?: IHomeIndicator;
289300

290301
/**
291-
* Optional default layout to apply on first time the workspace is opened.
302+
* Optional override for the product configuration properties.
292303
*/
293-
readonly defaultLayout?: IDefaultLayout;
304+
readonly productConfiguration?: Partial<IProductConfiguration>;
294305

295306
//#endregion
296307

@@ -438,8 +449,9 @@ export {
438449
ICommand,
439450
commands,
440451

441-
// Home Indicator
452+
// Branding
442453
IHomeIndicator,
454+
IProductConfiguration,
443455

444456
// Default layout
445457
IDefaultView,

0 commit comments

Comments
 (0)