简体   繁体   中英

How do I debug PyDev's autocompletion server to figure out why it can't analyze a module?

I'm using PyDev to edit Python and have a module that can't be analyzed statically or as a forced builtin. How do I debug the autocompletion server Python process that PyDev runs to figure out why it can't provide completions for this module, and hopefully tweak things to make it work?

Well, the completions in the forced builtins are mostly driven by doing a dir() in the module and then getting the tokens (so if you can do that from a shell, the code-completion engine should be able to do it too -- but note it'll only import and do a dir, not actually execute your code).

Also, this will only work for code which is not below your project (ie: code which is from an external library in the system interpreter)

For analyzing your own code (below a project), PyDev will only use the static analyzer... in which case it depends on the code, you can usually enhance it with type info on docstrings: http://pydev.org/manual_adv_type_hints.html or by doing some 'if False:' and writing some code which would only be gotten for the static analysis...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM