Skip to content

Commit

Permalink
add missing null service for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Sep 19, 2024
1 parent 7fe2257 commit e237898
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import { IInlineChatSessionService } from '../../browser/inlineChatSessionServic
import { InlineChatSessionServiceImpl } from '../../browser/inlineChatSessionServiceImpl.js';
import { TestWorkerService } from './testWorkerService.js';
import { ILanguageModelsService, LanguageModelsService } from '../../../chat/common/languageModels.js';
import { IActionViewItemService, NullActionViewItemService } from '../../../../../platform/actions/browser/actionViewItemService.js';

suite('InteractiveChatController', function () {

Expand Down Expand Up @@ -132,7 +131,6 @@ suite('InteractiveChatController', function () {
const serviceCollection = new ServiceCollection(
[IConfigurationService, new TestConfigurationService()],
[IChatVariablesService, new SyncDescriptor(ChatVariablesService)],
[IActionViewItemService, new SyncDescriptor(NullActionViewItemService)],
[ILogService, new NullLogService()],
[ITelemetryService, NullTelemetryService],
[IHoverService, NullHoverService],
Expand Down
6 changes: 5 additions & 1 deletion src/vs/workbench/test/browser/workbenchTestServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ import { EnvironmentVariableService } from '../../contrib/terminal/common/enviro
import { ContextMenuService } from '../../../platform/contextview/browser/contextMenuService.js';
import { IHoverService } from '../../../platform/hover/browser/hover.js';
import { NullHoverService } from '../../../platform/hover/test/browser/nullHoverService.js';
import { IActionViewItemService, NullActionViewItemService } from '../../../platform/actions/browser/actionViewItemService.js';

export function createFileEditorInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
return instantiationService.createInstance(FileEditorInput, resource, undefined, undefined, undefined, undefined, undefined, undefined);
Expand Down Expand Up @@ -257,7 +258,10 @@ export function workbenchInstantiationService(
},
disposables: Pick<DisposableStore, 'add'> = new DisposableStore()
): TestInstantiationService {
const instantiationService = disposables.add(new TestInstantiationService(new ServiceCollection([ILifecycleService, disposables.add(new TestLifecycleService())])));
const instantiationService = disposables.add(new TestInstantiationService(new ServiceCollection(
[ILifecycleService, disposables.add(new TestLifecycleService())],
[IActionViewItemService, new SyncDescriptor(NullActionViewItemService)],
)));

instantiationService.stub(IProductService, TestProductService);
instantiationService.stub(IEditorWorkerService, new TestEditorWorkerService());
Expand Down

0 comments on commit e237898

Please sign in to comment.