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

Incorrect signatures returned assertEquals #1290

Closed
yyoncho opened this issue Nov 25, 2019 · 7 comments · Fixed by #1302
Closed

Incorrect signatures returned assertEquals #1290

yyoncho opened this issue Nov 25, 2019 · 7 comments · Fixed by #1302

Comments

@yyoncho
Copy link
Contributor

yyoncho commented Nov 25, 2019

        long num = 10;
        assertEquals(num, num);

signature help shows (Object[], Object[]) as the active signature instead of (long, long).

@NikolasKomonen
Copy link
Contributor

Hi, I tried to recreate your issue and I got the following using the code you provided.

Selection_005

Could you share some more information about your setup, Java version, if everything is up to date,
a screenshot of the signature if possible, ...

@yyoncho
Copy link
Contributor Author

yyoncho commented Nov 25, 2019

@NikolasKomonen AFAICS you are showing the information from textDocument/hover. I am talking about the information retrieved via textDocument/signatureHelp. Let me know if you still cannot reproduce the issue.

@fbricon
Copy link
Contributor

fbricon commented Nov 25, 2019

@NikolasKomonen in vscode, you need to enable signatureHelp with "java.signatureHelp.enabled": true in the settings.
Then use ctrl+shift+space. This is definitively wonky:
Nov-25-2019 17-56-20

@NikolasKomonen
Copy link
Contributor

NikolasKomonen commented Nov 25, 2019

Thanks, I just tested it. For sure not doing what it is supposed to. I'll look into it.

@yyoncho
Copy link
Contributor Author

yyoncho commented Nov 25, 2019

@fbricon one more thing: I noticed that ParameterInformation.documentation field is not populated. Is this intentional?

@fbricon
Copy link
Contributor

fbricon commented Nov 25, 2019

@yyoncho I don't think so. Please open a separate ticket for that problem

@NikolasKomonen
Copy link
Contributor

I found the problem area, but I think @snjeza would be more knowledgeable since she worked on it.

package com.example.demo;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

public class DemoApplicationTests {

	@Test
	public void contextLoads() {
		long num = 3;
		assertEquals(num,num);
	}

}

If I do Ctrl+Shift+Space here:

assertEquals(|num,num);

the variable help2 stays null

but when I do it here:

assertEquals(n|um,num);

It triggers this case and populates the help2 variable with completely wrong/different signatures, which I'm not sure exactly what this specific case is for:
https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/SignatureHelpHandler.java#L86

I just wanted to see if you knew what to fix before I dove deeper into the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants