-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intellisense does work with GTK+ 3 (GObject Introspection) #204
Comments
@jrsrjrsr, thanks for the report. GTK is a compiled module so we need to create stubs for it. Until then, there will not be completions. I will add this the list of compiled modules that need stubs. |
Hello - any update on this issue? I am using VSCode + Pylance for Python/GTK coding. Unable to autocomplete is a bit inconvenience. Would appreicate if there is a progress. Thanks! |
This library doesn't contain any type information currently, and it's largely written in compiled code, so type information cannot be inferred from Python sources. Someone who is familiar with the library will need to create type stubs for the library. Ideally, the library authors would include these stubs with the library so consumers of the library don't need to locate and install the stubs separately. This is the approach most library authors are taking. If this is a library that you depend upon, please consider filing a feature request with the library authors. If you're really ambitious, consider contributing type stubs to the pygtk project. |
How about pygobject-stubs project on github? It is located here. |
As a temporary solution, you can use fakegir to produce stubs: https://github.com/strycore/fakegir |
A bit of a bump, but I do think users are better off using existing and actively maintained community stubs (https://github.com/pygobject/pygobject-stubs) rather than adding here. |
Environment data
Expected behaviour
Autocomplete should show member functions and variables for GTK+ 3 library (
import gi
)Actual behaviour
Autocomplete does not work for
import gi
Logs
Nothing of relevance appeared to be in the logs for the language server. Things like: "setFileOpened, getDiagnosticsForRange, parsing file, binding, file, getSemanticTokens", but nothing odd.
Code Snippet / Additional information
GTK graphical user interface library -- gir bindings (gir1.2-gtk-3.0)
Python 3 bindings for gobject-introspection libraries (python3-gi)
Key issue: This works as expected if I change the language server to
jedi
, but does not work withpylance
. Autocomplete also works fine in the Ubuntu command line interpreter (python3
).Related discussion that I found (but had trouble interpreting) on other github projects:
jedi
GTK+ 3 (GObject introspection) microsoft/pylance-release#531vscode-python
Autocomplete doesn't work for Gtk+ 3 microsoft/pylance-release#582The text was updated successfully, but these errors were encountered: