How to best handle/navigate optional arguments in a signature? #815
Unanswered
windowsrefund
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greets. I find myself somewhat confused over what I believe is the signature and what my expectations around its behavior should be. I'll demonstrate with something simple and common. Assuming I'm working with Lua and type
vim.keymap.de
and then accept thedel
suggestion, I now see the following:vim.keymap.del(modes, lhs, opts?)
Given the first 2 arguments are mandatory, I now move to the first, type my string, move to the next arg, type my string.... Now what? I'm wondering what the fastest and cheapest way might be to leave well enough alone at this point? Seems like the things I've tried have left me with the useless
opts?
as the final argument which I then have to go "clean up". Then there's the issue of removing the needless comma after the 2nd arg. Granted, a format would take care of that but in general, I feel like I'm hitting a wall as soon as I complete that 2nd arg (in this example).So what do the Jedi do here? Feel like I'm missing something really obvious.
Beta Was this translation helpful? Give feedback.
All reactions