Bug 498316 - Combine "open resource" and "goto line"
Summary: Combine "open resource" and "goto line"
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-21 21:16 EDT by Woody Yu CLA
Modified: 2020-06-05 12:11 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Woody Yu CLA 2016-07-21 21:16:35 EDT
combine "open resource" and "goto line",
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?
Comment 1 Woody Yu CLA 2016-07-21 21:22:27 EDT
This future will be very useful when open tracing stack like this:


   at sun.reflect.GeneratedConstructorAccessor105.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:981)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3465)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3365)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3805)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2478)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2625)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2551)
      ....

I can just paste the thing in the parenthesis and it is done!
Comment 2 Rüdiger Herrmann CLA 2016-07-22 04:13:35 EDT
(In reply to Woody Yu from comment #1)
> This future will be very useful when open tracing stack like this:
> 
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>         at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
>         at
>       ....
> 
> I can just paste the thing in the parenthesis and it is done!

Are you aware that there is a Stack Trace Console, specifically to open types from stack traces?
Comment 3 Rüdiger Herrmann CLA 2016-07-22 04:17:12 EDT
For your reference, there is an SO question [1] that this feature request originates from. The original poster asked for an Open Resource extension to go to lines by entering file name and line number like so: "file.txt:123"

[1] http://stackoverflow.com/questions/35129704/how-to-open-a-resource-at-specified-line-in-eclipse-in-one-step
Comment 4 Andrey Loskutov CLA 2016-07-22 04:39:23 EDT
As long as this is not in the platform, I also highly recommend AnyEdit plugin [1], which can do that by right clicking the line and "Open File under Cursor".

Beside this, it should be possible to implement it in the resources dialog, be changing the filter condition to ignore :<line> part of the search string.

So typing <file_path>:<line_nr> should filter to <file_path> and after OK and opening the editor it will try to jump to <line_nr>.

[1] http://marketplace.eclipse.org/content/anyedit-tools
Comment 5 Lars Vogel CLA 2018-04-04 06:58:25 EDT
Jonas, please have a look.