mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Improve the performance of filename completion over large repositories. (#938)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import { GitIgnoreParser, GitIgnoreFilter } from '../utils/gitIgnoreParser.js';
|
||||
import { isGitRepository } from '../utils/gitUtils.js';
|
||||
import * as path from 'path';
|
||||
import fg from 'fast-glob';
|
||||
|
||||
export interface FileDiscoveryOptions {
|
||||
respectGitIgnore?: boolean;
|
||||
@@ -32,6 +33,17 @@ export class FileDiscoveryService {
|
||||
}
|
||||
}
|
||||
|
||||
async glob(
|
||||
pattern: string | string[],
|
||||
options: fg.Options = {},
|
||||
): Promise<string[]> {
|
||||
const files = await fg(pattern, {
|
||||
...options,
|
||||
caseSensitiveMatch: false,
|
||||
});
|
||||
return this.filterFiles(files);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters a list of file paths based on git ignore rules
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import * as fs from 'fs/promises';
|
||||
import * as path from 'path';
|
||||
import ignore, { Ignore } from 'ignore';
|
||||
import ignore, { type Ignore } from 'ignore';
|
||||
import { isGitRepository } from './gitUtils.js';
|
||||
|
||||
export interface GitIgnoreFilter {
|
||||
|
||||
Reference in New Issue
Block a user