netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

JavaDoc window should prioritize constructor doc over class doc.

Open mbien opened this issue 1 year ago • 9 comments

If the caret is positioned over a constructor invocation, show the javadoc of that constructor (analog to the ctrl+mouse hover tooltip).

image (caret is over ArrayList, putting it inside () works too)

Before this change the class doc was shown.

mbien avatar Aug 10 '24 01:08 mbien

going to rebase this pr to latest master

mbien avatar Oct 09 '24 21:10 mbien

rebased again for a fresh build. If master isn't frozen yet when I am done manually testing I might merge this for NB24 since I think this is fairly low risk (and aligns javadoc behavior with ctrl+hover)

mbien avatar Oct 22 '24 09:10 mbien

LGTM, on import javadoc is for the class, on ArrayList and in () it constructor

ebarboni avatar Oct 22 '24 09:10 ebarboni

checked and everything is working fine still. Going to merge once CI is green.

mbien avatar Oct 22 '24 09:10 mbien

I'm not sure I'm entirely convinced by this. Caret inside parentheses should behave as currently does when caret immediately adjacent. But I think caret over type (eg. ArrayList) should continue to show class doc.

neilcsmith-net avatar Oct 22 '24 09:10 neilcsmith-net

ok, no problem. Thought constructor doc makes mores sense than class doc in this situation + it would work analog to completion / mouse over: image

mbien avatar Oct 22 '24 09:10 mbien

dropping the milestone

mbien avatar Oct 22 '24 09:10 mbien

Caret inside parentheses should behave as currently does when caret immediately adjacent

btw this isn't how it works right now in practice. In this particular example it does since int 5 is ignored - but if it would be a field or something else it would show the doc of the other item.

mbien avatar Oct 22 '24 09:10 mbien

it would work analog to completion / mouse over:

Don't let me be the only arbiter. I rarely use the Javadoc window. However completion doesn't work like mouse over here as far as I can tell?! They all seem inconsistent.

neilcsmith-net avatar Oct 22 '24 09:10 neilcsmith-net