1

I am looking for a built-in feature or plugin for Eclipse to do the following:

  • Open Resource + Jump to Line (in one step)

Ideal would be to do this:

  • Open Resource (Ctrl+Shift+R)
  • Type: FileName:LineNumber (eg. test.html:50)

I know i can do it in 2 steps, but when copying "File:Line" from somewhere i need to paste it in "Open Resource", copy or memorize and delete the line-number, open the file and then invoke "Go to line" (Ctrl+L) and paste or type the line number and confirm. This is very complicated.

It would be great if the "Open resource" dialog could combine these steps.

Is there a built-in feature or plugin for Eclipse that can do this?

If not could anybody write such a plugin?

asked Feb 1, 2016 at 11:45

2 Answers 2

1

You can use eclipse's 'Open from clipboard' navigation option. In Mac, the keyboard shortcut is Command+Shift+V. To use this option copy the java file and line number as it appears in the stackframe and press Command+Shift+V. The file should open at the specified line. You can change the keybinding in eclipse preferences

Read eclipse's documentation for navigation menu actions Open from clipboard :

Open from clipboard Tries to open the matching Java element in the editor if the clipboard contains a single line. Otherwise it opens the contents in the Java Stack Trace Console. Examples:

  • java.lang.String
  • String
  • String#getBytes
  • String.getBytes
  • java.lang.String.getBytes(String)
  • String.java:123
  • at java.lang.String.matches(String.java:1550)
  • java.lang.String.valueOf(char) line: 1456
  • currentTimeMillis()

answered Jun 15, 2018 at 4:18
Sign up to request clarification or add additional context in comments.

Comments

1

The Open Resource dialog does not have such feature. If you think this is a generally useful feature you should open an enhancement request

Writing an external plug-in that provides this feature would be hard as the Open Resource dialog isn't meant to be extended.

In the meanwhile you'd have to hit two more keys:

Ctrl+Shift+R test.html Return Ctrl+L 50 Return

answered Feb 1, 2016 at 11:53

2 Comments

Thanks a lot for this clear answer and especially the link to enhancement request.
I'm glad the answer helped. Please post the link here if you open an enhancement request.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.