srusskih / SublimeJEDI

awesome Python autocompletion with SublimeText
MIT License
938 stars 109 forks source link

Detect optional arguments by the presence of '...' or '*' #230

Closed edelvalle closed 6 years ago

edelvalle commented 6 years ago

Hi @srusskih,

This PR is because I hate when I have auto-completion of arguments set to "required" and the auto-completion for print pops up like this:

print(value, sep, end, file, flush)

But I know is not your plugin's fault, is that Jedi changed the way it returns completions for c-compiled and not not compiled code. So I detect the optional arguments part in print because in real live the auto-completion is:

print(value, ..., sep, end, file, flush)

So if auto-completion of arguments is set to "required" and I find an ellipsis then I stop the completion right there. Resulting in:

print(value)

What do you think? Are you Ok with that?

Cheers, Eddy

srusskih commented 6 years ago

Hi @edelvalle

Thanks for PR! Looking into it.

srusskih commented 6 years ago

fix #224

edelvalle commented 6 years ago

yoohoo! 😄