fix(ast-grep): add validation for incomplete function declaration patterns #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
export async function $METHOD)이 조용히 실패하는 문제 수정validatePatternForCli) 추가Problem
LLM 에이전트가
ast_grep_search [pattern=export async function $METHOD, lang=typescript]패턴을 사용할 때 결과가 없거나 애매한 에러가 발생했습니다.원인: ast-grep은 완전한 AST 노드만 매칭 가능하며,
export async function $METHOD는 파라미터와 바디가 없어 불완전한 패턴입니다.Solution
validatePatternForCli함수 추가: JS/TS 언어에서 불완전한 함수 선언 패턴 감지Changes
src/tools/ast-grep/tools.ts: 패턴 검증 로직 및 description 업데이트 (+45 lines)Testing
Correct Pattern Examples