mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 11:41:04 +00:00
perf(filesearch): Use async fzf for non-blocking file search (#5771)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
parent
c38147a3a6
commit
9fc7115b86
3 changed files with 33 additions and 24 deletions
|
|
@ -157,7 +157,7 @@ describe('useAtCompletion', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should NOT show a loading indicator for subsequent searches that complete under 100ms', async () => {
|
||||
it('should NOT show a loading indicator for subsequent searches that complete under 200ms', async () => {
|
||||
const structure: FileSystemStructure = { 'a.txt': '', 'b.txt': '' };
|
||||
testRootDir = await createTmpDir(structure);
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ describe('useAtCompletion', () => {
|
|||
expect(result.current.isLoadingSuggestions).toBe(false);
|
||||
});
|
||||
|
||||
it('should show a loading indicator and clear old suggestions for subsequent searches that take longer than 100ms', async () => {
|
||||
it('should show a loading indicator and clear old suggestions for subsequent searches that take longer than 200ms', async () => {
|
||||
const structure: FileSystemStructure = { 'a.txt': '', 'b.txt': '' };
|
||||
testRootDir = await createTmpDir(structure);
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ describe('useAtCompletion', () => {
|
|||
const originalSearch = FileSearch.prototype.search;
|
||||
vi.spyOn(FileSearch.prototype, 'search').mockImplementation(
|
||||
async function (...args) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 200));
|
||||
await new Promise((resolve) => setTimeout(resolve, 300));
|
||||
return originalSearch.apply(this, args);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue