#436 Suppress "Undefined Import" errors for the hole project

open-works-for-me
nobody
5
2010-04-11
2010-04-10
Maxim Penzin
No

There are many projects that use tricky imports.
For example Werkzeug or Pylons.

Erery time I use
'from werkzeug import Request'
I have to put #@UnresolvedImport on that line in every module.

The same situation with "request.session" or other "request.*" objects.

The idea is to make a list of 'valid imports' or 'defined variables' on a per package basis.

for example:

Alays valid:
'werkzeug.Request, werkzeug.Response'
'request.session', 'request.cookie'

or better:
'werkzeug.Request -> wekrzeug.local.Request' (it really is, but just reimported from werkzeug.local to werkzeug)
'request.session -> dict' (that session acts like a dict, but PyDev doesnt know)

Discussion

  • Fabio Zadrozny
    Fabio Zadrozny
    2010-04-10

    Have you tried adding: 'werkzeug.Request' in the forced builtins... If that doesn't work, it might be possible to create predefined completions in this case. See: http://pydev.org/manual_101_interpreter.html (for both situations)

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2010-04-10

    • status: open --> pending
     
  • Maxim Penzin
    Maxim Penzin
    2010-04-11

    Great!
    Than you very much.

     
  • Maxim Penzin
    Maxim Penzin
    2010-04-11

    • status: pending --> open-works-for-me