Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Feb 6, 2024
1 parent e9c651e commit ff3f265
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 23 deletions.
3 changes: 3 additions & 0 deletions src/vs/workbench/common/contributions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export interface IWorkbenchContribution {
}

export namespace Extensions {
/**
* @deprecated use `registerWorkbenchContribution2` instead.
*/
export const Workbench = 'workbench.contributions.kind';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { EditorPaneDescriptor, IEditorPaneRegistry } from 'vs/workbench/browser/
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { IWalkthroughsService } from 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService';
import { GettingStartedEditorOptions, GettingStartedInput } from 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput';
import { Extensions as WorkbenchExtensions, registerWorkbenchContribution2, WorkbenchPhase } from 'vs/workbench/common/contributions';
import { registerWorkbenchContribution2, WorkbenchPhase } from 'vs/workbench/common/contributions';
import { ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
Expand All @@ -27,9 +27,9 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA
import { isLinux, isMacintosh, isWindows, OperatingSystem as OS } from 'vs/base/common/platform';
import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { StartupPageEditorResolverContribution, StartupPageRunnerContribution } from 'vs/workbench/contrib/welcomeGettingStarted/browser/startupPage';
import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput';
import { Categories } from 'vs/platform/action/common/actionCommonCategories';
import { StartupPageContribution } from 'vs/workbench/contrib/welcomeGettingStarted/browser/startupPage';

export * as icons from 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedIcons';

Expand Down Expand Up @@ -268,6 +268,9 @@ registerAction2(class extends Action2 {

export const WorkspacePlatform = new RawContextKey<'mac' | 'linux' | 'windows' | 'webworker' | undefined>('workspacePlatform', undefined, localize('workspacePlatform', "The platform of the current workspace, which in remote or serverless contexts may be different from the platform of the UI"));
class WorkspacePlatformContribution {

static readonly ID = 'workbench.contrib.workspacePlatform';

constructor(
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
Expand Down Expand Up @@ -300,8 +303,6 @@ class WorkspacePlatformContribution {
}
}

registerWorkbenchContribution2(WorkbenchExtensions.Workbench, WorkspacePlatformContribution, WorkbenchPhase.AfterRestored);

const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
configurationRegistry.registerConfiguration({
...workbenchConfigurationNodeBase,
Expand Down Expand Up @@ -337,6 +338,6 @@ configurationRegistry.registerConfiguration({
}
});

registerWorkbenchContribution2(StartupPageContribution.ID, StartupPageContribution, {
editorTypeId: GettingStartedPage.ID,
});
registerWorkbenchContribution2(WorkspacePlatformContribution.ID, WorkspacePlatformContribution, WorkbenchPhase.AfterRestored);
registerWorkbenchContribution2(StartupPageEditorResolverContribution.ID, StartupPageEditorResolverContribution, WorkbenchPhase.BlockRestore);
registerWorkbenchContribution2(StartupPageRunnerContribution.ID, StartupPageRunnerContribution, { editorTypeId: GettingStartedPage.ID, });
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { URI } from 'vs/base/common/uri';
import { ICommandService } from 'vs/platform/commands/common/commands';
import * as arrays from 'vs/base/common/arrays';
import { IWorkbenchContribution, getWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { onUnexpectedError } from 'vs/base/common/errors';
Expand Down Expand Up @@ -37,25 +37,12 @@ const configurationKey = 'workbench.startupEditor';
const oldConfigurationKey = 'workbench.welcome.enabled';
const telemetryOptOutStorageKey = 'workbench.telemetryOptOutShown';

export class StartupPageContribution implements IWorkbenchContribution {
export class StartupPageEditorResolverContribution implements IWorkbenchContribution {

static readonly ID = 'workbench.contrib.startupPage';
static readonly ID = 'workbench.contrib.startupPageEditorResolver';

constructor(
@IInstantiationService private readonly instantiationService: IInstantiationService,
@IConfigurationService private readonly configurationService: IConfigurationService,
@IEditorService private readonly editorService: IEditorService,
@IWorkingCopyBackupService private readonly workingCopyBackupService: IWorkingCopyBackupService,
@IFileService private readonly fileService: IFileService,
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
@ILifecycleService private readonly lifecycleService: ILifecycleService,
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
@IProductService private readonly productService: IProductService,
@ICommandService private readonly commandService: ICommandService,
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
@IStorageService private readonly storageService: IStorageService,
@ILogService private readonly logService: ILogService,
@INotificationService private readonly notificationService: INotificationService,
@IEditorResolverService editorResolverService: IEditorResolverService
) {
editorResolverService.registerEditor(
Expand All @@ -81,7 +68,28 @@ export class StartupPageContribution implements IWorkbenchContribution {
}
}
);
}
}

export class StartupPageRunnerContribution implements IWorkbenchContribution {

static readonly ID = 'workbench.contrib.startupPageRunner';

constructor(
@IConfigurationService private readonly configurationService: IConfigurationService,
@IEditorService private readonly editorService: IEditorService,
@IWorkingCopyBackupService private readonly workingCopyBackupService: IWorkingCopyBackupService,
@IFileService private readonly fileService: IFileService,
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
@ILifecycleService private readonly lifecycleService: ILifecycleService,
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
@IProductService private readonly productService: IProductService,
@ICommandService private readonly commandService: ICommandService,
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
@IStorageService private readonly storageService: IStorageService,
@ILogService private readonly logService: ILogService,
@INotificationService private readonly notificationService: INotificationService
) {
this.run().then(undefined, onUnexpectedError);
}

Expand Down

0 comments on commit ff3f265

Please sign in to comment.