oldmud0
oldmud0

Reputation: 147

In Eclipse, how do I link to a line within a comment?

I'm trying to explain why I placed a SuppressWarnings in my code, but since it appears that I can only place those above my method, I want to make a link to a specific line number within my comment. I thought that using (<filename>.java:<line>) would do the thing, but instead it just tells me about the file in question, not the actual contents of the line I want.

For example:

11 | @SuppressWarnings("unchecked") //I tend not to suppress warnings, but (Items.java:22) has no solution.

When I hover to or click on the (Items.java:22) part, it should take me to line 22:

22 | return (T) itemMap.get(name);

What do I have to do in order to make a link to the desired line in Eclipse? It doesn't have to be a specific line number since of course, when I start editing my code, the line I want to link to has already moved somewhere else. It could link to some kind of anchor (although I don't expect Eclipse to have such a complex linking feature set anytime soon).

Upvotes: 2

Views: 963

Answers (1)

DLight
DLight

Reputation: 1835

Ctrl + click on the (<filename>.java:<line>) comment works for me.

Upvotes: 1

Related Questions