apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.62k stars 841 forks source link

Javadoc: "value" should not only be suggested at constants #7254

Open jepsar opened 5 months ago

jepsar commented 5 months ago

Description

When using code completing after typing {@ in Javadoc, "value" is not in the list.

Are you willing to submit a pull request?

No

ebarboni commented 5 months ago

This lacks context. {@value }will work on constant for me in Apache NetBeans 21

jepsar commented 5 months ago

I'm on 21 as well. When I press the shortcut keys for auto completing when I have typed {@ I'm getting:

Screenshot 2024-04-10 at 13 43 11

I don't know what more context you need.

How do you mean "will work on constant"? What does that have to do with code completion?

Edit: so, when you write do on a static itself, you will indeed see the option "value". I guess that is what you were referring to. However, if you want to use that constant's value in doc of a method for example, it's not offered.

Screenshot 2024-04-10 at 13 51 11
mbien commented 4 months ago

looks like {@value} is only allowed on constants while {@value foo.Bar#constant} can be used everywhere as long it points to a constant.

https://github.com/apache/netbeans/blob/00a4a7ae25fc0e1ae1c7d6a89ffc2811f61fa3b4/java/java.editor/src/org/netbeans/modules/java/editor/javadoc/TagRegistery.java#L118 can be set to ALL_KINDS most likely, rest will be in the javadoc error log I suppose if used wrong.