Intellisense does work with GTK+ 3 (GObject Introspection)

Open
#204 7 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start with the GTK/GObject Introspection reproduction in the issue, including import gi, gi.require_version, and from gi.repository import Gtk. Review the linked Jedi and vscode-python discussions to understand the missing autocomplete support. Done means Pylance offers member functions and variables after Gtk. as Jedi does.

Written by the indexing model from the issue text.

Description

compiled needs stub

Environment data

  • Language Server version: v2020.11.2
  • OS and version: Ubuntu 20.04 (WSL2) on Win 10, 19041.630
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.5

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

  • Install GTK graphical user interface library -- gir bindings (gir1.2-gtk-3.0)
  • Install Python 3 bindings for gobject-introspection libraries (python3-gi)
  • Try to autocomplete Gtk.
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
win = Gtk.

Key issue: This works as expected if I change the language server to jedi, but does not work with pylance. Autocomplete also works fine in the Ubuntu command line interpreter (python3).

Related discussion that I found (but had trouble interpreting) on other github projects:

Dominant language
Python
Stars
304
Forks
104
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/python-type-stubs

All issues in microsoft/python-type-stubs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.