srusskih / SublimeJEDI

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

Error complete builtin sorted function #284

Open kkew3 opened 5 years ago

kkew3 commented 5 years ago

When I type sorted, Jedi suggests the builtin sorted function as:

Screen Shot 2019-03-14 at 11 40 42 AM

However, the auto-completion regards key as a positional argument (using auto_complete_function_params "required", already restarted ST after setting the option):

Screen Shot 2019-03-14 at 11 40 55 AM

which is apparently incorrect as Python complains:

TypeError: must use keyword argument for key function
srusskih commented 5 years ago

yeap, it's common issue with building functions due to how they described in python

srusskih commented 5 years ago

But I closed it too fast.

I have found this in logs:

2019-03-14 21:28:00,276 DEBUG  - Jedi - Python autocompletion.sublime_jedi.facade:44 - get_function_parameters() - Parameter: (<class 'jedi.evaluate.compiled.context.SignatureParamName'>, <_ParameterKind: 'POSITIONAL_ONLY'>, 'iterable', 'param iterable')
2019-03-14 21:28:00,276 DEBUG  - Jedi - Python autocompletion.sublime_jedi.facade:44 - get_function_parameters() - Parameter: (<class 'jedi.evaluate.compiled.context.SignatureParamName'>, <_ParameterKind: 'KEYWORD_ONLY'>, 'key', 'param key')
2019-03-14 21:28:00,276 DEBUG  - Jedi - Python autocompletion.sublime_jedi.facade:44 - get_function_parameters() - Parameter: (<class 'jedi.evaluate.compiled.context.SignatureParamName'>, <_ParameterKind: 'KEYWORD_ONLY'>, 'reverse', 'param reverse')

Looks like it's possible to try to guess what is keyword was is not