pgi-docgen
pgi-docgen copied to clipboard
IDE auto completion
Provide fake python packages for IDE auto completion: most of the logic is already there, so why not
Existing code: https://github.com/strycore/fakegir
Could this also be used to generate stubs for mypy and others? If Jedi will support stubs someday (https://github.com/davidhalter/jedi/issues/839), then this can also be used for auto completion. Mypy has a generator for stubs: 'python3 -m mypy.stubgen'. Maybe this can be used? Is has an option to use .rst docs, but I'm not sure how to use it for gi.
Definitely sounds interesting. I haven't worked with mypy yet besides some small experiments, but I'm planning to give it a go in quodlibet some time.
One question is how we would provide those stubs to users and how jedi/mypy could discover them. Does anything similar exist already?
There is typeshed: https://github.com/python/typeshed I think this is used by mypy/pycharm/pytype
I've opened https://github.com/pygobject/pycairo/issues/99
my plan is to test things out with pycairo and then take it from there..
Thank you for looking into this @lazka excited to see the possibilities. fakegir gets you most of the way there, but it is prone to issues and requires quite a bit of manual tweaking(Though I imagine any solution might require tweaking haha). If you need anyone to test this out, just ping me! Fyi, i'm on OS X, using vscode.
Hey, @lazka I'd like to ask if you still plan to support stubs, I'm looking forward to using them :)
Hey, @lazka I'd like to ask if you still plan to support stubs, I'm looking forward to using them :)
https://github.com/pygobject/pygobject-stubs/