Python plugin for IDEA has reached an early access preview (EAP) stage. It is alpha-quality software, lacking in many obvious spots, but already allowing to sample some features.
This release concentrates on means for writing code and navigating code.
Things known to work
- A module of Python type can be added to a regular IDEA project.
- Any reasonable CPython installation can be chosen as project's Python SDK; autodetection works reasonably on Windows, Linux, and Mac OS X.
- When Jython code is used in a regular Java-based project, plugin's features kick in.
- For Python modules, project window lists your sources and Python's standard libraries, including zips and eggs.
- Source code is parsed on the fly and checked for syntax errors. Imports from __future__ are respected for with_statement and nested_scopes.
- Ctrl+Click on an identifier leads to the latest definition of this identifier, or first probable out-of-context definition of it. Note that such resolution is not always possible: consider something like foo[i].bar.
- "Find usages" (Alt+F7) works for identifiers, with same limitations as for Ctrl+Click.
- Names defined in C-based modules are resolvable as long as the modules are importable.
- Classes have usual "inheritors" navigation icons on the gutter.
- Methods have usual "overrides" navigation icons on the gutter.
- Structure View shows functions, classes, methods, and class variables, with arbitrary nesting.
- Names that must definitely resolve but don't are highlighted by an inspection.
- Code completion (Ctrl+Space) on a blank space proposes visible identifiers, including imported, with module name as a hint.
- Code completion in import statements suggests module names; try typing import th and pressing Ctrl+Space.
- Code completion proposes known items for qualified expressions, including inherited. Try typing "foo".cap and pressing Ctrl+Space.
- Code completion and name resolution also work for attributes dynamically added to an object in immediate scope. Try typing foo = object(); foo.bar = 1; foo.b and pressing Ctrl+Space.
- Quick documentation (Ctrl+Q) for classes shows either doc comment or definition.
- Function parameter popup appears on pressing Ctrl+P in argument list, parameters under cursor highlighted. This includes fancier cases of starred and double-starred parameters and arguments, implicit "self", etc.
- Pseudo-source is auto-generated for built-in and C-based modules, allowing to navigate to identifiers defined therein.
- Rename refactoring (Shift+F6) works reasonably.
- A DeMorgan law intention is available for boolean expressions. (Internally it is implemented in Python.)
- Function parameters are checked for consistency.
- Method parameters are checked for presence of first parameter (the "self").
- Where possible, argument lists of function calls are checked against parameter lists of corresponding functions, errors detected. This is an inspection which you can turn off.
- Any file from sources can be run, with output going to console, as usual.
- Source control must work as for any other IDEA modules.
Things that work only partially
- All code is parsed as Python 2.5; version-dependent features are yet to come.
- Import statements do not support relative import correctly.
- Support for standalone Jython is present but is very limited as of now; Jython installations detection is very limited.
- In Structure View, instance variables are not included. The view is not always updated regularly; switch it off and on to refresh.
- Keyword completion proposes keywords, but sometimes unsuitable keywords are proposed.
- Code navigation does not handle multiple definitions (e.g. when in identifier is defined both in an "if" and in the "else" branches).
- Code navigation does not honor class-private names (e.g. __foo) and the __all__ attribute of modules imported via "from foo import *", so certain names look more visible than they are.
- When an unknown name is found, the choice of possible ways to import it is limited to top-level modules.
- Auto-indentation is often incorrect.
- Type is inferred only for simplest expressions.
- Several special functions from standard library (like super() or dict.fromkeys()) don't have correct signature.
- Syntax highlighting is very basic.
- Name resolution and completion works somehow for Jython when referencing imported Java objects.
Things that are missing
- Decorators are only parsed. They are not included in quick documentation. Their arguments are not correctly checked. The standard @classmethod and @staticmethod decorators are not handled properly.
- Properties are not detected as properties; assignment to read-only properties is not detected.
- Many significant inspections are not implemented yet (unused values, unreachable code, unsafe string handling, definite assignment, endless loops, etc).
- There are no significant refactorings yet.
- There are no significant quickfixes and intentions yet.
- There are no code templates yet.
- There is no unit testing support yet.
- There is no documentation generators support yet.
- There is no support for packaging and deployment yet.
- There is no debugger yet.
Please don't hesitate to point us to deficiencies you notice and to suggest features.
Labels:
None
1 Comment
comments.show.hideNov 20, 2008
Anonymous
The debugger and unit testing are the most important part in Python IDE. When will these two features come out? Thanks.