symref
Version:
Static code checker for AI code agents (Windsurf, Cline, etc.)
26 lines • 1.29 kB
JavaScript
import * as path from 'node:path';
import { SymbolReferenceAnalyzer } from '../../analyzer/symbol-reference-analyzer.js';
export class SuggestCommand {
static register(program) {
program
.command('suggest-test <symbol>')
.description('指定されたシンボルのテストを提案します')
.option('--to <symbol>', '対象のシンボル')
.option('--dir <dir>', 'ソースコードのディレクトリ', '.')
.option('--include <pattern>', 'インクルードパターン', '**/*.ts')
.option('--exclude <pattern>', '除外パターン', 'node_modules/**,**/*.d.ts')
.option('--project <path>', 'tsconfig.jsonのパス', './tsconfig.json')
.action(async (symbol, options) => {
const analyzer = new SymbolReferenceAnalyzer({
basePath: path.resolve(options.dir),
tsConfigPath: path.resolve(options.project),
includePatterns: [options.include],
excludePatterns: options.exclude.split(',')
});
const result = await analyzer.suggestTest(symbol, options.to);
console.log(result);
});
}
}
// ... existing code ...
//# sourceMappingURL=SuggestCommand.js.map