Last Site Update: 20 May 2009 | Latest Version: 1.4.6


Main

Download

Buy

License

Manual

About/Contact




Previous (Refactoring) Root Next (Code Coverage)


Content Assistants

Some content assistants to make your life easier...

They are ALL activated through Ctrl+1, but which one(s) will show depend on the context it is activated.

Currently, there are 4 content assistants implemented in the Pydev 'Open Source' and 3 provided in the Pydev Extensions:

Pydev Extensions

  • Make import for undefined token
  • Ignore error
  • Don't analyze module

Pydev 'Open Source'

  • Move import to global scope
  • Create docstring
  • Assign parameters to attributes
  • Assign result to new local variable (or field)
  • Surround code with try..except or try..finally


Pydev Extensions content assistants

Make import for undefined token / Ignore error

Let's say that you have the code below, and that the code-analysis has just seen that the 'xmlreader' token was undefined (this is important, as we cannot make this analysis before the token was generated). In this case, we have 2 options offered, one to fix that importing the token and another one saying that pydev should ignore that error. The example below shows it in action:



If we let the cursor at the undefined token line and press Ctrl+1, we get:



After choosing the second import we have:



Now, if we had chosen the third option (@UndefinedVariable), a note would have been entered in the code, to warn Pydev Extensions to ignore that error, as pointed below...


Don't analyze module

Pydev Extensions can accept a 'note' to warn it not to make code-analysis at all in some module. In order to do that' you can go to the first line of the module and press 'Ctrl+1' and choose the @PydevCodeAnalysisIgnore flag. Doing that will add a note in the code to warn that this module should not be analyzed by Pydev Extensions.

If you use automatically generated files, it might be useful to put that warning on those files, as it would not be useful to analyze those files. The example below shows the result of this action.



After choosing choosing it, we have:





Pydev 'Open Source' content assistants


Move import to global scope

Before


After




Create docstring

NOTE:Must be called in the 'def' line.

Before



After




Assign result to new local variable (or field)

Before


After




Assign parameters to attributes

Before


After




Surround code with try..except or try..finally

NOTE:Must have some code selected

Before


After



Previous (Refactoring) Root Next (Code Coverage)

© Copyright: Aptana, Inc. 2008-2009