Skip to content

Show active filters in call hierarchy view#2965

Open
r-mennig wants to merge 1 commit into
eclipse-jdt:masterfrom
r-mennig:show_filters_in_call_hierarchy_view
Open

Show active filters in call hierarchy view#2965
r-mennig wants to merge 1 commit into
eclipse-jdt:masterfrom
r-mennig:show_filters_in_call_hierarchy_view

Conversation

@r-mennig
Copy link
Copy Markdown

Currently, the call hierarchy view offers multiple ways to filter matches via the filter menu. The content description of the view however does not state which filters were active during the search.

image

Since these filters are also persisted between restarts, this might lead to confusion if a user forgets that certain filters are active during search.

What it does

This PR extends the content description of the call hierarchy view with a description of the active filters:

image

The description may include "in main code of" (if option "Hide Test Code" is active) or "in test code of" (if option "Test Code only" is active) prepended to the scope description and/or "(filter patterns: 'xyz')" (if "Qualified type name filter patterns" is non-empty and enabled) appended to the scope description.

How to test

  1. Issue a call hierarchy search (e.g. by pressing Ctrl+Alt+H while selecting a member in the java editor)
  2. Open the filter menu by pressing the filter button and select any option other than "Show all code"
  3. The results get filtered, the scope description is updated depending on the selected filters

Author checklist

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the Call Hierarchy view’s content description by including currently active filter settings, reducing confusion when filters persist across restarts and affect search results.

Changes:

  • Extend Call Hierarchy view content description to prepend test/main-code scope qualifiers and append active filter pattern information.
  • Add new NLS message keys for the filter-related description fragments.
  • Add a new UI test verifying the updated content description and register it in the core test suite.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyViewPart.java Builds a scope description string that incorporates active filters/test-code options.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.properties Adds localized strings for “main code”, “test code”, and active filter pattern suffix.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyMessages.java Exposes the new NLS fields.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CoreTestSuite.java Registers the new test in the core test suite.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyViewPartContentDescriptionTest.java Adds coverage for the updated content description behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants