Skip to content
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

Autocomplete doesn't work for Gtk+ 3 #582

Closed
pavan-inferno opened this issue Jan 13, 2018 · 22 comments
Closed

Autocomplete doesn't work for Gtk+ 3 #582

pavan-inferno opened this issue Jan 13, 2018 · 22 comments
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@pavan-inferno
Copy link

Environment data

VS Code version: Code 1.19.1 (0759f77bb8d86658bc935a10a64f6182c5a1eeba, 2017-12-19T09:46:23.884Z)
Python Extension version: 0.9.1
Python Version: 2.7.14
OS and version: Windows_NT x64 10.0.16299

Actual behavior

Autocomplete doesn't work for Gtk+ 3 library. It does work for all other libraries I have tried in the past. It also works for pygtk (gtk 2.x). Even in the given script, it works with gi but doesn't work with Gtk. It shows all the member functions and variables for gi, auto completion only shows suggestions based on used keywords and no member functions.

Is this related to the Gobject and introspection ?

Expected behavior

Autocomplete should show member functions

Steps to reproduce:

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
win = Gtk.

Logs

Output from Python output panel

Output from Console window (Help->Developer Tools menu)

Kudos on the awesome extension BTW ;)

Cheers
Pavan

@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. awaiting 1-verification labels Jan 15, 2018
@inochisa
Copy link

I have the same problem. But I can see something in the module gi, can not see the thing in the gi.repository(use from gi.repository import ...). And I see there is only a __inty__.py and __pycache__ folder in my folder /usr/lib/python3.6/site-package/gi/repository,maybe the extension can not load the information from the pycache?
The other thing I see it's the linting is ok, I get error when I type the wrong function name in the gi.repository(But I don't know why, i just get an message that show me there is no function named "xxx".)
My code version is 1.19.2 and the python version is 3.6.4. Os is linux
My console window is also nothing.

@lazka
Copy link

lazka commented Jan 16, 2018

Does this plugin support PEP 484 stub files? There was some discussion on the python+gtk site to look into supporting that: pygobject/pgi-docgen#79 (comment)

@brettcannon
Copy link
Member

@SakuraLife the __pycache__ is just the cache of .pyc files and is only used when there's a corresponding .py file, so it plays no part in intellisense.

@lazka davidhalter/jedi#839 suggests that Jedi doesn't have support yet for .pyi files.

@pavan-inferno
Copy link
Author

Should have seen this earlier. Its a jedi issue.
davidhalter/jedi#531
It doesn't support gobject introspection modules (Gtk 3 is one). I wanted to know if the source of jedi used by the extension is patched to resolve this issue. And also the suggested monkey patch in the above link doesn't work for me.

@brettcannon
Copy link
Member

We don't patch Jedi ATM, but @MikhailArkhipov is collecting known issues with Jedi in hopes that we can resolve them eventually.

@pavan-inferno
Copy link
Author

Thanks brett !
I have another question.
Can I use python.jediPath to try monkey patching it ?

@brettcannon
Copy link
Member

@pavan-inferno I believe so, yes.

@MikhailArkhipov
Copy link

We integrated Jedi 0.11, could you try insiders build please

https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#insiders-build

@MikhailArkhipov MikhailArkhipov removed their assignment Feb 17, 2018
@brettcannon brettcannon added info-needed Issue requires more information from poster and removed needs PR labels Feb 21, 2018
@fredrikaverpil
Copy link

@MikhailArkhipov do you mean that pyi files should now work in the Insiders build, or are you referring to something else?

@brettcannon
Copy link
Member

@fredrikaverpil it doesn't look like it: davidhalter/jedi#839

@MikhailArkhipov
Copy link

@fredrikaverpil - may or may not, I just meant there is new Jedi that could have the fix. Apparently not.

@tristan957
Copy link

Surprisingly just the issue I was looking for. @MikhailArkhipov do you need someone to test the insiders build of vscode-python to see if this issue is resolved

@brettcannon
Copy link
Member

@tristan957 until davidhalter/jedi#839 is fixed upstream or we replace Jedi this won''t get fixed in the extension.

@brettcannon brettcannon added needs PR and removed info-needed Issue requires more information from poster needs PR labels May 7, 2018
@skewty

This comment has been minimized.

@brettcannon

This comment has been minimized.

@fredrikaverpil
Copy link

For anyone interested, work is now being done on davidhalter/jedi#839 !

@tristan957
Copy link

Has anyone tried this with the Python language server? Admittedly I don't write much Python anymore. Not sure if the language server makes use of Jedi or not.

@brettcannon
Copy link
Member

@tristan957 the language server does not use Jedi.

@tristan957
Copy link

@brettcannon I am aware. I was meaning that "has someone tried writing PyGObject using the language server instead of the Jedi-based completions".

@fredrikaverpil
Copy link

@brettcannon @MikhailArkhipov jedi now has stubs support in the master branch.

@fredrikaverpil
Copy link

Proof of .pyi files being loaded in vscode: davidhalter/jedi#1318 (comment)

@brettcannon
Copy link
Member

Closing as this is an upstream issue which we don't have direct control or influence over.

@ghost ghost removed the needs upstream fix label Jul 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

8 participants