-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Add completion on a variable if it matches a module name #1042
Comments
Why don't you use type annotations? |
I don't have control over the module I'm importing - it's 3rd party - and it's also based on Python 2, unless you meant something else? I'm not familiar with type annotations enough to know what you're suggesting |
Well I guess I'm starting to understand. I'm not sure if there is a way to annotate something with a specific module. That might be problematic. You could for sure annotate some things that might help you, but probably not everything. I'm keeping it open, but don't expect much progress in the next few months or even years. IMO this is something that the typing module has to solve. |
I've decided that I won't further pursue this. To solve your issue in the future, please follow #626. Once you can use Jedi plugins, you can write your own and solve your problems. |
I have a scenario where I'd like to get completion for some unknown object. The idea is that, though the object is completely unknown, the variable name of that object also matches the name of an importable module. The completion options for that object will just be the same as if it were an imported module.
Minimal Example:
I must stress though that I wouldn't want this to be the default behavior, just something for a couple select module/variable names that I knew in advance that I wanted this for.
Full Context:
I use rpyc to communicate between two Python interpreter sessions. On the client side, I have to assign the connection as a variable and the variable's name shadows the import. Jedi tries to complete for the nuke variable which has no completions and not the nuke module, which has all the completions.
The function import_remote_server() has to be after the import because the object that it returns is basically the namespace needed to communicate with the server. But adding it after the import shadows the module name and all completion is lost, because of that. I wrote a search/replace script that is something like a "best of both worlds" scenario but was also wondering if there was a simpler way to achieve this.
I use Jedi with the latest YouCompleteMe, Vim 8.0, on CentOS 7. Any help would be greatly appreciated
The text was updated successfully, but these errors were encountered: