redhat-developer / redhat-developer/vscode-java
"Show Call Hierarchy" should have the ability to filter calls, or apply name filter patterns
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 546
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
When I use Show Call Hierarchy on a property in a Java class object that is frequently used in both the main source code, as well as in the unit tests, the Call Hierarchy list would display a bunch of results. Because, the results include both the main source code and unit tests references, there isn't a way to automatically exclude certain folder directories or paths out from unwanted invocations.
I would like to request for the feature to apply any one of the following options:
- Filter test codes. (unit test codes, or codes residing under
src/test/java) - Apply name filter patterns. (Only includes reference names that matches the given filter patterns.)
- Limit the call depth of a given number. (Only goes down in depth up to the given number, inclusive.)
This feature is similar to Eclipse's "Filter Calls" dialog:

This is accessed by invoking "Show Call Hierarchy" on a class member, then opening "Filters" in the "More Options" menu in Eclipse IDE.
Currently, we don't have anything similar to this in Visual Studio Code with RedHat Java extensions installed.
Environment
- Operating System: Ubuntu 20.04.2 LTS
- JDK version: AdoptOpenJDK 11 (jdk-11.0.11+9)
- Visual Studio Code version: 1.61.2
- Java extension version: v1.0.0 (October 19, 2021)
Steps To Reproduce
- Open any Java class object whose object is used in both the main source code, as well as in the unit test codes.
- On any identifiers (method name, class field name, etc.), do
SHIFT+ALT+Hto invoke "Show Call Hierarchy". - Observe in the list, notice how there aren't any options available to filter certain call invocations from the results. You would have to manually click on the "X" button to remove the entry you don't want, one by one.
Current Result
The "Show Call Hierarchy" looks something like this.

Expected Result
After filtering out either all test codes, or applying a name filter pattern to exclude any references containing "test", it should look something like this:

贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 VS Code Java extension 中的 Show Call Hierarchy 入口点开始,检查其结果的呈现方式。比较所请求的测试代码过滤、名称模式和调用深度限制,然后确定可接受的范围。当选定的过滤行为可从 call hierarchy UI 使用,并覆盖所述用例时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, typescript, vscode
- 领域
- devtools
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100