Use IdeClient directly instead of config.ideClient (#7627)

This commit is contained in:
Tommaso Sciortino
2025-09-04 09:32:09 -07:00
committed by GitHub
parent 45d494a8d8
commit cb43bb9ca4
24 changed files with 288 additions and 217 deletions

View File

@@ -64,7 +64,7 @@ describe('BuiltinCommandLoader', () => {
vi.clearAllMocks();
mockConfig = { some: 'config' } as unknown as Config;
ideCommandMock.mockReturnValue({
ideCommandMock.mockResolvedValue({
name: 'ide',
description: 'IDE command',
kind: CommandKind.BUILT_IN,
@@ -81,7 +81,7 @@ describe('BuiltinCommandLoader', () => {
await loader.loadCommands(new AbortController().signal);
expect(ideCommandMock).toHaveBeenCalledTimes(1);
expect(ideCommandMock).toHaveBeenCalledWith(mockConfig);
expect(ideCommandMock).toHaveBeenCalledWith();
expect(restoreCommandMock).toHaveBeenCalledTimes(1);
expect(restoreCommandMock).toHaveBeenCalledWith(mockConfig);
});
@@ -105,7 +105,7 @@ describe('BuiltinCommandLoader', () => {
const loader = new BuiltinCommandLoader(null);
await loader.loadCommands(new AbortController().signal);
expect(ideCommandMock).toHaveBeenCalledTimes(1);
expect(ideCommandMock).toHaveBeenCalledWith(null);
expect(ideCommandMock).toHaveBeenCalledWith();
expect(restoreCommandMock).toHaveBeenCalledTimes(1);
expect(restoreCommandMock).toHaveBeenCalledWith(null);
});

View File

@@ -64,7 +64,7 @@ export class BuiltinCommandLoader implements ICommandLoader {
editorCommand,
extensionsCommand,
helpCommand,
ideCommand(this.config),
await ideCommand(),
initCommand,
mcpCommand,
memoryCommand,