diff --git a/src/vs/workbench/contrib/void/browser/_dummyContrib.ts b/src/vs/workbench/contrib/void/browser/_dummyContrib.ts index e19c1182..7f88c445 100644 --- a/src/vs/workbench/contrib/void/browser/_dummyContrib.ts +++ b/src/vs/workbench/contrib/void/browser/_dummyContrib.ts @@ -6,6 +6,7 @@ import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; import { Disposable } from '../../../../base/common/lifecycle.js'; import { ServicesAccessor } from '../../../../editor/browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js'; import { localize2 } from '../../../../nls.js'; import { Action2, registerAction2 } from '../../../../platform/actions/common/actions.js'; import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; @@ -14,15 +15,16 @@ import { KeybindingWeight } from '../../../../platform/keybinding/common/keybind import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../common/contributions.js'; +// to change this, just Cmd+Shift+F and replace DummyService with YourServiceName, and replace export interface IDummyService { - readonly _serviceBrand: undefined; + readonly _serviceBrand: undefined; // services need this, just leave it undefined } export const IDummyService = createDecorator('DummyService'); - +// An example of an action (delete if you're not using an action): registerAction2(class extends Action2 { constructor() { super({ @@ -42,18 +44,21 @@ registerAction2(class extends Action2 { } }) -// on mount + class DummyService extends Disposable implements IWorkbenchContribution, IDummyService { - static readonly ID = 'workbench.contrib.void.dummy' + static readonly ID = 'workbench.contrib.void.dummy' // workbenchContributions need this, services do not _serviceBrand: undefined; constructor( + @ICodeEditorService codeEditorService: ICodeEditorService, ) { super() } } + +// pick one and delete the other: registerSingleton(IDummyService, DummyService, InstantiationType.Eager); registerWorkbenchContribution2(DummyService.ID, DummyService, WorkbenchPhase.BlockRestore);