redhat-developer / redhat-developer/vscode-java

"Show Call Hierarchy" should have the ability to filter calls, or apply name filter patterns

Đang mở
#2,179 3 bình luận 4 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

enhancement navigation upstream
Ngôn ngữ chính
TypeScript
Star
2.3k
Fork
546
Merge trung bình
20 giờ 1 phút
Pull request đã merge (30 ngày)
11

Mô tả

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:

image

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
  1. Open any Java class object whose object is used in both the main source code, as well as in the unit test codes.
  2. On any identifiers (method name, class field name, etc.), do SHIFT+ALT+H to invoke "Show Call Hierarchy".
  3. 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.

image

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:

image

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu từ điểm vào Show Call Hierarchy trong VS Code Java extension và xem xét cách các kết quả của nó được trình bày. So sánh việc lọc mã kiểm thử được yêu cầu, các mẫu tên và giới hạn độ sâu lời gọi, sau đó xác định phạm vi được chấp nhận. Hoàn thành có nghĩa là hành vi lọc đã chọn có thể sử dụng từ call hierarchy UI và bao quát trường hợp sử dụng đã nêu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, typescript, vscode
Lĩnh vực
devtools
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.