antgroup / antgroup/YASA-Engine

[OSS26] 接口方法查实现 find_implementations_by_method_name

Open
#132 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OSS26-中等难度
Dominant language
TypeScript
Stars
323
Forks
40
PR merge metrics
No merged PRs in 30d

Description

接口介绍

给定接口的某个具体方法(接口全限定名 + 方法名,可选形参类型消歧),返回所有实现该方法的位置 — 包括所在类、方法签名、文件路径、行号。

工具名

find_implementations_by_method_name

背景与目标

find_implementations_by_interface_name 解决"接口的所有实现类",但很多场景里我们关心的是某个具体方法的实现,而不是整类:

  • 审计 validate(Request):不关心整个 RequestValidator 类,只想看每个实现里这个方法怎么写
  • Service.execute(...) 的所有版本

本工具基于接口实现关系索引,进一步细化到方法级。

输入参数
参数 类型 必填 说明
interface_full_name string 接口全限定名,如 com.example.RequestValidator
method_name string 方法名,如 validate
parameter_types string[] 形参类型列表,用于重载消歧,如 ["com.example.Request"]。不填则返回所有同名重载
repository_path string 仓库本地绝对路径
输出结构
{
  "interface_full_name": "com.example.RequestValidator",
  "method_name": "validate",
  "total_implementations": 2,
  "implementations": [
    {
      "class_full_name": "com.example.impl.JsonRequestValidator",
      "method_signature": "validate(com.example.Request): boolean",
      "file_path": "src/main/java/com/example/impl/JsonRequestValidator.java",
      "line_number": 24,
      "is_override_annotation_present": true
    }
  ]
}
验收标准
  • 正确处理方法重载(同名不同参)
  • 正确处理泛型方法实现
  • 跳过仅声明、未实现的抽象方法
  • 单元测试覆盖:重载、泛型、空实现、桥接方法
  • 中等仓库响应 < 5s
预估工作量

2-3 人日(在接口实现索引基础上扩展)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing find_implementations_by_interface_name tool and its interface-implementation index; the issue names no source files or test paths. Trace how method-level lookup can reuse that index, then cover overloads, generics, empty implementations, and bridge methods in unit tests, with responses completing in under 5 seconds on a medium repository.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
compilers, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.