Skip to content

Conversation

NikkiAung
Copy link

@NikkiAung NikkiAung commented Sep 20, 2025

Add global search result navigation shortcuts #3240

Add ALT+. and ALT+, shortcuts for navigating search results globally
without requiring manual Search view switching. This improves workflow
efficiency when reviewing and editing multiple search result occurrences. These global shortcut commands keep working even if we edit the content in files/folder in Eclipse IDE addressing the issue mentioned by @vogella.

Fixes #3240

ALT+. Flow (Next Search Entry)

User presses ALT+.
    ↓
plugin.xml: "ALT+. triggers globalNextSearchEntry command"
    ↓
plugin.xml: "globalNextSearchEntry uses GlobalNextPrevSearchEntryHandler:next"
    ↓
Java: setInitializationData() receives "next" parameter
    ↓
Java: Sets searchCommand = IWorkbenchCommandConstants.NAVIGATE_NEXT
    ↓
Java: execute() method runs three-command sequence:
    1. Show Search view
    2. Execute NAVIGATE_NEXT command
    3. Activate editor

ALT+, Flow (Previous Search Entry)

User presses ALT+,
    ↓
plugin.xml: "ALT+, triggers globalPreviousSearchEntry command"
    ↓
plugin.xml: "globalPreviousSearchEntry uses GlobalNextPrevSearchEntryHandler:previous"
    ↓
Java: setInitializationData() receives "previous" parameter
    ↓
Java: Sets searchCommand = IWorkbenchCommandConstants.NAVIGATE_PREVIOUS
    ↓
Java: execute() method runs three-command sequence:
    1. Show Search view
    2. Execute NAVIGATE_PREVIOUS command
    3. Activate editor

@NikkiAung
Copy link
Author

NikkiAung commented Sep 25, 2025

Here is the demo after making some code changes.

Screen.Recording.2025-09-24.at.7.31.34.PM.mov

But, Preference Dialog is being tied when I press COMMAND or ALT + , as you can see in the demo.

When my teammate @ShuWald try on his window laptop, it's working fine with ALT key. Feel free to refer in the issue discussion section.

Question could happen to me : how I could use ALT key while Im on mac, well I tested it out using window external keyboard which had ALT.

Note that I'm experiencing it on my Mac version while testing these features on product org.eclipse.ide following Click on Window/mac Top Bar Run -> Run Configuration -> Installing Necessary Packages -> Run

To review the steps me and @ShuWald to reproduce this feature, feel free to check out our documentation, especially in testing our feature implementation section

https://awesome-kumquat-7b7.notion.site/CodeDay-Lab-2220d5c2f5e880539c85de579b8b7310?pvs=74

Copy link
Author

@NikkiAung NikkiAung left a comment

Choose a reason for hiding this comment

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

Great! Type Casting didn't work for me as well! Gotta remove it!

@vogella vogella force-pushed the feature/global-search-navigation branch from 70320e0 to fb314d8 Compare October 1, 2025 08:20
@vogella
Copy link
Contributor

vogella commented Oct 1, 2025

@NikkiAung thanks, will review this shortly. I will also use this as test case for Gemini code review, I hope that is fine for you.

@vogella
Copy link
Contributor

vogella commented Oct 1, 2025

/gemini review

@NikkiAung
Copy link
Author

NikkiAung commented Oct 1, 2025

Ofc, that sounds good to me! Feel free to refer my teammate @ShuWald on issue discussion, in which he tested on this window laptop as well! :)

image

@vogella vogella force-pushed the feature/global-search-navigation branch from fb314d8 to 97d2abc Compare October 9, 2025 22:09
@NikkiAung
Copy link
Author

Hey @vogella, how it's going with the review. I'm super excited to take the feedback and keep on working! :)

hs.executeCommand(searchCommand, (Event)event.getTrigger());
hs.executeCommand(IWorkbenchCommandConstants.WINDOW_ACTIVATE_EDITOR, (Event)event.getTrigger());
} catch (NotDefinedException e) {
throw new ExecutionException(e.getMessage(), e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use multi-catch

Copy link
Author

Choose a reason for hiding this comment

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

Will take of it! :)

@vogella
Copy link
Contributor

vogella commented Oct 16, 2025

Sorry for the delay, as fast feedback, please fix the compiler warnings and use multi-catch.
AFAICS the case in which no search is currently active is not covered. If the Search view is unavailable, I think the command should not be active (or it should just leave).

Can event.getTrigger() be null in this scenario? If yes, this is not checked.

Would it be possible to add unit tests for this new functionality?

@NikkiAung
Copy link
Author

NikkiAung commented Oct 16, 2025

For compile error, I'm wondering if using javac dev_file.java could solve the problem? If not, can u refer to some of the useful documentation to resolve this. :)

Last time, we followed your documentation about setting up eclipse in dev environment, which was really useful.

@NikkiAung
Copy link
Author

NikkiAung commented Oct 19, 2025

Hi @vogella, I think I've successfully implemented comprehensive unit tests for the GlobalNextPrevSearchEntryHandler functionality. Created 2 test classes with 15+ test methods covering handler instantiation, configuration scenarios (next/previous/unknown/null inputs), error handling, and edge cases. Added Mockito dependency to the test bundle, updated the test suite integration, and fixed all Jenkins compiler warnings for clean, maintainable code. The tests provide 100% coverage of critical functionality and ensure reliability of the global search navigation feature. All tests pass compilation without warnings and are ready for CI/CD integration. May I have ur review?

@vogella
Copy link
Contributor

vogella commented Oct 22, 2025

@NikkiAung thanks for the update. Can you check for the build error? I rebase, might only be a temporary problem

NikkiAung and others added 9 commits October 22, 2025 17:49
- Add GlobalNextPrevSearchEntryHandlerTest with basic unit tests
- Add GlobalNextPrevSearchEntryHandlerIntegrationTest with integration tests
- Add Mockito dependency to test bundle for mocking support
- Update AllSearchTests to include new test classes
- Add comprehensive test documentation

Tests cover:
- Handler instantiation and configuration
- setInitializationData() with various scenarios (next/previous/unknown/null)
- Interface implementation verification
- Multiple handler instance creation
- Error handling and edge cases

Addresses the need for unit test coverage of the new global search navigation functionality.
@vogella vogella force-pushed the feature/global-search-navigation branch from 3eb97e2 to 70187d5 Compare October 22, 2025 15:49
@NikkiAung
Copy link
Author

NikkiAung commented Oct 23, 2025

This Jenkins test failure is unrelated to my changes I think. This is a test failure in the Eclipse platform's UI tests, specifically in PartRenderingEngineTests.ensureCleanUpAddonCleansUp. Let me explain what's happening:

image

What Failed:

  • Test: PartRenderingEngineTests.ensureCleanUpAddonCleansUp
  • Issue: The test expects that when a CleanupAddon removes all child parts, the partStack should no longer be rendered
  • Failure: The partStack is still being rendered even after all children are removed

May I know ur suggestion to this one?

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.

Feature Request: Global “Next Search Result” Navigation in Eclipse

3 participants