Skip to content

Show relative last termination time in Launch History tooltip#2744

Open
SougandhS wants to merge 1 commit into
eclipse-platform:masterfrom
SougandhS:LastLaunch
Open

Show relative last termination time in Launch History tooltip#2744
SougandhS wants to merge 1 commit into
eclipse-platform:masterfrom
SougandhS:LastLaunch

Conversation

@SougandhS

@SougandhS SougandhS commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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.

Screenshot 2026-06-08 at 2 39 06 PM Screenshot 2026-06-08 at 2 43 43 PM Screenshot 2026-06-08 at 2 43 38 PM Screenshot 2026-06-08 at 2 39 36 PM image

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   56m 27s ⏱️ +40s
 4 677 tests ±0   4 655 ✅ ±0   22 💤 ±0  0 ❌ ±0 
11 925 runs  ±0  11 772 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit 336a381. ± Comparison against base commit a0e395d.

♻️ This comment has been updated with latest results.

@SougandhS SougandhS changed the title Show relative termination time in Launch History tooltip Show relative last termination time in Launch History tooltip Jun 11, 2026
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
@SougandhS

SougandhS commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Hi @iloveeclipse, could you please check this PR or trigger a co-pilot review ? - when you get time

protected void fireTerminate() {
setAttribute(DebugPlugin.ATTR_TERMINATE_TIMESTAMP, Long.toString(System.currentTimeMillis()));
String timeStamp = Long.toString(System.currentTimeMillis());
setAttribute(DebugPlugin.ATTR_TERMINATE_TIMESTAMP, timeStamp);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I see it right, this would alter config stored on a disk every time it finishes. So all shared and git versioned configs will be automatically dirty after use. I would not do that.

Maybe better to restrict this to "not shared" configs and for shared configs in the workspace use bundle location to manage timestamps.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_TIMESTAMP into the associated ILaunchConfiguration when 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.

Comment on lines +374 to 378
} else {
addRecentLaunchTimeTooltip(launch, action);
}
addRecentLaunchTimeTooltip(launch, action);
addToMenu(menu, action, accelerator);
Comment on lines +644 to +655
private void addRecentLaunchTimeTooltip(ILaunchConfiguration launch, LaunchAction launchAction) {
try {
String timeStamp = launch.getAttribute(DebugPlugin.ATTR_TERMINATE_TIMESTAMP, ""); //$NON-NLS-1$
if (!timeStamp.isEmpty()) {
long mytime = Long.parseLong(timeStamp);
String g = getRelativeTime(mytime);
launchAction.setToolTipText(g);
}
} catch (CoreException e) {
DebugUIPlugin.log(e);
}
}
Comment on lines +664 to +665
long diffMillis = System.currentTimeMillis() - timestamp;
long seconds = diffMillis / 1000;
Comment on lines +481 to +490
ILaunchConfiguration launchConfig = getLaunchConfiguration();
if (launchConfig != null) {
try {
ILaunchConfigurationWorkingCopy launchCopy = getLaunchConfiguration().getWorkingCopy();
launchCopy.setAttribute(DebugPlugin.ATTR_TERMINATE_TIMESTAMP, timeStamp);
launchCopy.doSave();
} catch (CoreException e) {
DebugPlugin.log(e);
}
}
Comment on lines +479 to +483
String timeStamp = Long.toString(System.currentTimeMillis());
setAttribute(DebugPlugin.ATTR_TERMINATE_TIMESTAMP, timeStamp);
ILaunchConfiguration launchConfig = getLaunchConfiguration();
if (launchConfig != null) {
try {
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.

3 participants