UNPKG

symref

Version:

Static code checker for AI code agents (Windsurf, Cline, etc.)

42 lines 1.59 kB
import { SymbolReferenceAnalyzer } from '../../analyzer'; import { OutputFormatter } from '../formatters/OutputFormatter'; /** * シンボル参照分析のコマンドクラス */ export class RefsCommand { /** * コマンドを実行する * @param symbols シンボル名(カンマ区切り) * @param options オプション */ static async execute(symbols, options) { try { const analyzerOptions = { basePath: options.dir, tsConfigPath: options.project, includePatterns: options.include ? options.include.split(',') : undefined, excludePatterns: options.exclude ? options.exclude.split(',') : undefined }; const analyzer = new SymbolReferenceAnalyzer(analyzerOptions); const symbolList = symbols.split(',').map((s) => s.trim()); for (const symbol of symbolList) { try { const result = analyzer.analyzeSymbol(symbol); OutputFormatter.displayReferenceResult(result); } catch (error) { console.log(`\n=== シンボル分析エラー: ${symbol} ===`); if (error instanceof Error) { console.log(error.message); } console.log(); } } } catch (error) { console.error(`エラー: ${error.message}`); process.exit(1); } } } //# sourceMappingURL=RefsCommand.js.map