davidhalter / jedi

Awesome autocompletion, static analysis and refactoring library for python
http://jedi.readthedocs.io
Other
5.73k stars 503 forks source link

kwargs forwarding? #1971

Open kflu opened 7 months ago

kflu commented 7 months ago

I noticed that jedi can handle basic kwargs forwarding:

def f(a,b,c): ...

def g(**kwargs):
  return f(**kwargs)

Typing g( it prompts a,b,c.

However, the below won't work:

@click.option(...)
def f(a,b,c): ...

def g(**kwargs):
  return f.callback(**kwargs)

Our codebase uses @click (for the record I disliked it). And because of that, the original function becomes f.callback. But now typing g(, jedi won't prompt for a,b,c anymore.

My question is, is there a way to help jedi to understand kwargs forwarding? I tried typing.ParamSpec, but seems like jedi doesn't support it yet.

I'm using jedi through jedi-language-server

davidhalter commented 7 months ago

Yeah, sorry but ParamSpec is not yet supported.