Skip to content

Add editor hyperlink option for 'Open in new tab' for Types & Methods#2301

Open
SougandhS wants to merge 1 commit into
eclipse-jdt:masterfrom
SougandhS:openMethod
Open

Add editor hyperlink option for 'Open in new tab' for Types & Methods#2301
SougandhS wants to merge 1 commit into
eclipse-jdt:masterfrom
SougandhS:openMethod

Conversation

@SougandhS
Copy link
Copy Markdown
Member

@SougandhS SougandhS commented Jun 27, 2025

Allows opening a method or type in a new editor tab from the hyperlink options (cmd+selection) if the element's implementation in the same editor . Improves code navigation, especially when working with large files or understanding multiple methods or types in parallel.

image

Fixes : #2265

Neww.mp4

See discussion - #2265

What it does

How to test

Right click context menu on methods -> "open method"

Author checklist

@SougandhS
Copy link
Copy Markdown
Member Author

Hi @noopur2507, could you please check this PR when you have some time ?

@SougandhS SougandhS requested a review from noopur2507 June 27, 2025 08:24
@SougandhS SougandhS force-pushed the openMethod branch 3 times, most recently from 732c412 to b91584b Compare December 11, 2025 01:01
@SougandhS SougandhS changed the title Add context menu to open method in new tab Add hyperlink menu in editor for Open in new cloned editor Feb 22, 2026
@SougandhS
Copy link
Copy Markdown
Member Author

Hi @noopur2507

I just modified the entire implementation to show this feature in editor selection hyperlink (cmd+selection on element) this way the context menu wont feel cluttered with this option

and this activates only if the implementation is in current editor
image
image

else it wont activate, so even better now !
image

Neww.mp4

I have updated PR details too..

@SougandhS SougandhS changed the title Add hyperlink menu in editor for Open in new cloned editor Add editor hyperlink option for 'Open in new cloned editor' Feb 22, 2026
@SougandhS SougandhS changed the title Add editor hyperlink option for 'Open in new cloned editor' Add editor hyperlink option for 'Open in new tab' for Types & Methods Feb 23, 2026
@iloveeclipse iloveeclipse requested a review from Copilot February 24, 2026 07:33
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

Adds a new Java editor hyperlink option intended to open a selected type/method in a new (cloned) editor tab to improve navigation within large files (per Issue #2265).

Changes:

  • Introduces a new hyperlink detector and hyperlink implementation to open a type/method in a new tab.
  • Registers the detector via plugin.xml and adds user-visible labels via NLS (JavaEditorMessages + plugin.properties).

Reviewed changes

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

Show a summary per file
File Description
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementOpenInNewImplementationHyperlink.java New hyperlink implementation that opens an editor with MATCH_NONE and reveals the element.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementOpenInNewHyperlinkDetector.java New detector that conditionally contributes the “Open In New Tab” hyperlink.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties Adds NLS string for the hyperlink text.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.java Adds NLS field for the new hyperlink label.
org.eclipse.jdt.ui/plugin.xml Registers the new hyperlink detector extension.
org.eclipse.jdt.ui/plugin.properties Adds display name for the detector.

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

Comment thread org.eclipse.jdt.ui/plugin.xml Outdated
Comment thread org.eclipse.jdt.ui/plugin.properties Outdated
@eclipse-jdt-bot
Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

org.eclipse.jdt.ui/META-INF/MANIFEST.MF
org.eclipse.jdt.ui/pom.xml

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From fa5a9494c6ff58319e3444ac65d85d2e229baf04 Mon Sep 17 00:00:00 2001
From: Eclipse JDT Bot <jdt-bot@eclipse.org>
Date: Tue, 3 Mar 2026 08:07:39 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/org.eclipse.jdt.ui/META-INF/MANIFEST.MF b/org.eclipse.jdt.ui/META-INF/MANIFEST.MF
index 2d6f4e8ff1..2b3c023d46 100644
--- a/org.eclipse.jdt.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.ui/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.jdt.ui
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.ui; singleton:=true
-Bundle-Version: 3.37.0.qualifier
+Bundle-Version: 3.37.100.qualifier
 Bundle-Activator: org.eclipse.jdt.internal.ui.JavaPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %providerName
diff --git a/org.eclipse.jdt.ui/pom.xml b/org.eclipse.jdt.ui/pom.xml
index 59b583dcf7..2ac6bd499d 100644
--- a/org.eclipse.jdt.ui/pom.xml
+++ b/org.eclipse.jdt.ui/pom.xml
@@ -18,7 +18,7 @@
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.ui</artifactId>
-  <version>3.37.0-SNAPSHOT</version>
+  <version>3.37.100-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
 	<build>
-- 
2.53.0

Further information are available in Common Build Issues - Missing version increments.

@SougandhS
Copy link
Copy Markdown
Member Author

Hi @iloveeclipse
Do you have any suggestions/reviews on this ?

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

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


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

@SougandhS
Copy link
Copy Markdown
Member Author

@iloveeclipse done all the changes 👍

Allows opening a type/method in a new cloned editor from java editor
hyperlink menu. Improves code navigation, especially when working with
large files or understanding multiple methods in parallel.

Fixes : eclipse-jdt#2265
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.

Can you make the option the open a method in a different tab just like clone tab

3 participants