fix: faster autocomplete lookup (#387)

* fix:faster-autocmp

* fixinitializing

* fix

* fixonwindows

* unconsole
This commit is contained in:
Jacob Nguyen
2025-02-02 19:37:59 -06:00
committed by GitHub
parent 3a569726d8
commit 974c30fa6c
7 changed files with 393 additions and 342 deletions

View File

@@ -28,3 +28,21 @@ export function createRandomModule(plugins: any[]): Processed<Module> {
execute: vi.fn(),
};
}
export function createRandomChoice() {
return {
type: faker.number.int({ min: 1, max: 11 }),
name: faker.word.noun(),
description: faker.word.adjective(),
};
}
export function createRandomPlugins(len: number) {
const random = () => Math.floor(Math.random() * 2) + 1; // 1 or 2, plugin enum
return Array.from({ length: len }, () => ({
type: random(),
execute: () => (random() === 1 ? controller.next() : controller.stop()),
}));
}