Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hovering over constructor and it's integer arguments showing wrong signature #7653

Closed
subhash-arabhi opened this issue Aug 9, 2024 · 2 comments · Fixed by #7654
Closed
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) JavaDoc [ci] enable java/javadoc tests and build-javadoc target kind:bug Bug report or fix VSCode Extension [ci] enable VSCode Extension tests

Comments

@subhash-arabhi
Copy link
Contributor

subhash-arabhi commented Aug 9, 2024

Apache NetBeans version

Apache NetBeans 22

What happened

When hovering over the constructor, it shows the class signature. Hovering over the first letter of it's integer argument shows the method signature.

Language / Project Type / NetBeans Component

No response

How to reproduce

Screenshot 2024-08-09 at 4 34 53 PM Screenshot 2024-08-09 at 4 35 15 PM

This bug is visible in Language Server for Java by Apache and Java Platform by Oracle extensions of VS Code

Did this work correctly in an earlier version?

No / Don't know

Operating System

macOS

JDK

openjdk 22.0.1, jdk 17

Apache NetBeans packaging

Apache VSNetBeans for VSCode

Anything else

No response

Are you willing to submit a pull request?

Yes

@subhash-arabhi subhash-arabhi added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Aug 9, 2024
@mbien
Copy link
Member

mbien commented Aug 9, 2024

@subhash-arabhi please add a small reproducer snippet next time additional to screenshots

quick test using:

public class Mavenproject1 {

    /**
     * Doc for static field foo.
     */
    public static final String foo = null;
        
    /**
     * Sample class.
     * @author mbien
     */
    static class Sample {
        /**
         * Sample constructor.
         * @param hello greeting
         * @param par a number
         */
        public Sample(String hello, int par, String args) {
        }
    }

    public static void main(String[] args) {
        Sample sample = new Sample("hello", 42, foo);
    }
}

parts of it are also reproducible in NB 22, e.g completion shows class doc instead of constructor doc:
actually, this is likely working as intended. The completion will show the constructor doc if the cursor is behind the (. Before that, its in type completion mode.

image

however, ctrl+mouse hover does produce the expected results:
image

filed with doc:
image

@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) JavaDoc [ci] enable java/javadoc tests and build-javadoc target and removed needs:triage Requires attention from one of the committers labels Aug 9, 2024
@mbien mbien linked a pull request Aug 9, 2024 that will close this issue
@mbien mbien added the VSCode Extension [ci] enable VSCode Extension tests label Aug 9, 2024
@mbien
Copy link
Member

mbien commented Aug 9, 2024

added VSCode Extension [ci] enable VSCode Extension tests label since I don't think this affects NB, unless I didn't understand the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) JavaDoc [ci] enable java/javadoc tests and build-javadoc target kind:bug Bug report or fix VSCode Extension [ci] enable VSCode Extension tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants