You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add an option not to insert arguments on completion #2903
I'm not sure if the images display the same issue, but it would be nice to have the option to not include the argument names on method calls. I use a screen reader (NVDA) / keyboard and deleting all the arguments when selecting a method call everytime makes using this feature a bit annoying, especially if the method has more than 2 arguments. It would be nice if we could have the option to select between the three modes, one for completely turning it off, one for argument names and other for guessing the method arguments.
Hi @thgcode, the image pasted above in this thread is a screenshot from Eclipse configuration page. It shows that Eclipse has the capability to control the behavior and that can be a reference for the implementation in VS Code Java extension.
I tested with Eclipse and the feature can be used correctly on it. Then I was thinking why it worked on Eclipse and not on VSCode and found some information that can help to implement the feature. It seems the feature is implemented directly on the UI. The JavaCompletionProposalComputer reads the preference and sets the completion collector. It seems this the reason it works on Eclipse.
@thgcode Thank you for the information. If it's implemented in UI, then we have to do it separately in JDT.LS. But I guess it won't be too complicated(hopefully). I can take a look at this sometime in next month.
@thgcode, you can now set java.completion.guessMethodArguments to off stop filling anything on completion. The feature should be available in pre-release version v1.20.2023061504 or higher now.
Activity
snjeza commentedon Jan 26, 2023
@felixxing You can try
felixaszx commentedon Jan 26, 2023
That does not work.
jdneo commentedon Jan 30, 2023
It's currently by design that the method arguments will be filled according to the selected method's signature.
Looks like we need to expose this setting from JDT

I remember it's not exposed now in VS Code Java, @snjeza is it correct?
felixaszx commentedon Jan 30, 2023
Yes, I've never seen setings like that in VsCode.
snjeza commentedon Jan 30, 2023
Yes, it is correct.
thgcode commentedon May 9, 2023
I'm not sure if the images display the same issue, but it would be nice to have the option to not include the argument names on method calls. I use a screen reader (NVDA) / keyboard and deleting all the arguments when selecting a method call everytime makes using this feature a bit annoying, especially if the method has more than 2 arguments. It would be nice if we could have the option to select between the three modes, one for completely turning it off, one for argument names and other for guessing the method arguments.
I don't know much about the LSP protocol, but it seems the feature is hardcoded on the source code of jdt.ls.
jdneo commentedon May 10, 2023
Hi @thgcode, the image pasted above in this thread is a screenshot from Eclipse configuration page. It shows that Eclipse has the capability to control the behavior and that can be a reference for the implementation in VS Code Java extension.
thgcode commentedon May 10, 2023
@jdneo Thanks for the image description!
I tested with Eclipse and the feature can be used correctly on it. Then I was thinking why it worked on Eclipse and not on VSCode and found some information that can help to implement the feature. It seems the feature is implemented directly on the UI. The JavaCompletionProposalComputer reads the preference and sets the completion collector. It seems this the reason it works on Eclipse.
jdneo commentedon May 11, 2023
@thgcode Thank you for the information. If it's implemented in UI, then we have to do it separately in JDT.LS. But I guess it won't be too complicated(hopefully). I can take a look at this sometime in next month.
[-]Autocomplete fill the argument names[/-][+]Add an option not to insert arguments on completion[/+]jdneo commentedon Jun 16, 2023
@thgcode, you can now set
java.completion.guessMethodArgumentstooffstop filling anything on completion. The feature should be available in pre-release versionv1.20.2023061504or higher now.thgcode commentedon Jun 17, 2023
I tested it and it's working perfectly, thank you! This feature will save a lot of time for me.
jdneo commentedon Jun 19, 2023
@thgcode Thanks for the feedback!