Show relative last termination time in Launch History tooltip#2744
Show relative last termination time in Launch History tooltip#2744SougandhS wants to merge 1 commit into
Conversation
|
Hi @iloveeclipse, could you please check this PR or trigger a co-pilot review ? - when you get time |
There was a problem hiding this comment.
Pull request overview
Enhances the Debug UI launch history/favorites drop-down by showing a human-friendly “terminated X ago” tooltip for inactive (previously terminated) launch configurations, backed by persisting the termination timestamp onto the launch configuration.
Changes:
- Persist
ATTR_TERMINATE_TIMESTAMPinto the associatedILaunchConfigurationwhen a launch terminates. - Add relative-time tooltip computation and apply it to inactive launch history/favorite entries.
- Introduce new NLS message keys for relative-time tooltip strings.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java | Adds relative-time tooltip logic and applies it while building the launch history/favorites menu. |
| debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties | Adds localized strings for “a moment ago”, “{n} mins ago”, etc. |
| debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java | Declares new NLS fields for the added tooltip message keys. |
| debug/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java | Persists termination timestamp to the launch configuration on termination. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (launchConfig.isLocal()) { | ||
| ILaunchConfigurationWorkingCopy launchCopy = launchConfig.getWorkingCopy(); | ||
| launchCopy.setAttribute(DebugPlugin.ATTR_TERMINATE_TIMESTAMP, timeStamp); | ||
| launchCopy.doSave(); | ||
| } else { | ||
| IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier()); | ||
| prefs.put(launchConfig.getMemento(), timeStamp); | ||
| prefs.flush(); | ||
| } |
There was a problem hiding this comment.
Hi @iloveeclipse, is this how it should be handled for #2744 (comment) ?
There was a problem hiding this comment.
Yes and no. Correct is launchConfig.isLocal(). Not correct is how the prefs are saved
prefs.put(launchConfig.getMemento(), timeStamp);: this persists entire config as a preference key! I believe in the same category launch configs are "identified" by the name. There shouldn't be two configs with same name as far as I remember it.
There was a problem hiding this comment.
Will update key with launchConfig names 👍
f777347 to
95253ef
Compare
Display the relative termination time (for example, "a moment ago", "5 mins ago", or "1 hour ago") in launch history tooltips using the stored termination timestamp. This provides a quick indication of when a launch was last terminated
|
I hope now its good to be merged |
This change enhances the launch history menu by displaying a relative termination time in the tooltip for previously launched configurations. Instead of showing only the launch configuration name, the tooltip now indicates how recently the launch was terminated using user-friendly text such as "a moment ago", "5 mins ago", or "1 hour ago", based on the stored termination timestamp. This provides quick contextual information about recent launches, making it easier to identify and relaunch configurations that were used recently. The additional context is particularly useful when launch favorites are pinned to the top of the menu, as their fixed ordering does not reflect recent usage and can make it harder to determine which configuration was run most recently.