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

Typing () returns wrong set of signatures (textDocument/signatureHelp) #1009

Closed
yyoncho opened this issue Apr 25, 2019 · 7 comments · Fixed by #1015
Closed

Typing () returns wrong set of signatures (textDocument/signatureHelp) #1009

yyoncho opened this issue Apr 25, 2019 · 7 comments · Fixed by #1015

Comments

@yyoncho
Copy link
Contributor

yyoncho commented Apr 25, 2019

  public void testB() {
    if (|)
  }

when the cursor in on | I think that the server returns all methods that are in the current scope(class).

@fbricon
Copy link
Contributor

fbricon commented Apr 26, 2019

Same behavior in Eclipse IDE. Note that true/false are also proposed.
I could understand returning non-void methods, as you can make a boolean statement out of any method call that returns something, but even the void methods are returned here. So it looks like a JDT bug. Need to check/open for a matching ticket in JDT.

@fbricon
Copy link
Contributor

fbricon commented Apr 26, 2019

Same behavior in Intellij IDEA, so it might be done on purpose after all

@fbricon
Copy link
Contributor

fbricon commented Apr 26, 2019

IntelliJ IDEA also has a smart completion mode where only items matching the expected type are returned. Which would be nice to have too. See https://www.jetbrains.com/help/idea/auto-completing-code.html#smart_completion

@yyoncho
Copy link
Contributor Author

yyoncho commented Apr 26, 2019

@fbricon signatureHelp is not intended to suggest methods no matter whether they are matching or not but it should describe the function call at the point. So in this case, the server should return empty set since () does not stand for function invocation.

@yyoncho yyoncho changed the title Typing () returns wrong set of signatures. Typing () returns wrong set of signatures (textDocument/signatureHelp) Apr 26, 2019
@fbricon
Copy link
Contributor

fbricon commented Apr 26, 2019

mmmok I didn't realize you were talking about signatureHelp ;-)

@yyoncho
Copy link
Contributor Author

yyoncho commented Apr 26, 2019

Yep, I fixed the title.

@fbricon
Copy link
Contributor

fbricon commented Apr 26, 2019

I can reproduce the problem. Indeed it doesn't make sense to return methods here.

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.

3 participants