-
Notifications
You must be signed in to change notification settings - Fork 401
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
[feature] Improve functionality behind java.completion.guessMethodArguments #2512
Comments
I looked inside the code a bit. It seems we have two options
The second option give better choice which can simulate
|
Having separate setting options to handle all of these makes sense. If a user doesn't enable parameter name code lens, they might find it useful to have values auto-filled, particularly for primitive default values. I agree I think you also mentioned that something like chain completion might also improve things down the road. Or even some heuristic like searching all method invocations, looking for what's used for that argument. Could be helpful where an argument is static. |
So when you say a separate setting, should we go with keeping the current setting as it is and then have a new setting like Or should we keep it simple by just filling with parameter names instead of literals when there is no variable to fill in ? Because if there is no variable all arguments will be filled by parameter names and then when the For example I have a pending PR in jdt.core which change the relevance of methods and fields based on paramater name and also adding more smarter chain completion will improve the experience. |
I meant Also, I managed to find the old chain completion PR, https://github.com/rgrunber/eclipse.jdt.ls/tree/chain . I needs to be cleaned up but it should work, if there's interest in it. |
+1 There are some users asking about not filling anything: redhat-developer/vscode-java#2903. |
OK considering different perspectives, I would suggest to move forward as follows
None - Do nothing, just complete the method as We start like this and later we can also add something like |
The three setting values looks good to me. One concern of the value |
I'll take a look at this. |
When enabled
java.completion.guessMethodArguments
it will fill in variable names which are matching the arguments of the method. But when it doesn't find any variable names, instead of filing with argument names, it fills them with null.We can improve this behavior as follows
This new behavior will help the developer to create fields, local variable or parameters for the names that didn't match.
The text was updated successfully, but these errors were encountered: