[RSS]

Python support in NetBeans

NetBeans IDE for Python Early Access available at http://download.netbeans.org/netbeans/6.7/python/ea2/. Feature list available at http://www.netbeans.org/features/python/index.html

To get the latest development builds of the Python IDE, see the How to install page.

You can browse the sources of the Python support at http://hg.netbeans.org/main.

Before being moved to Mercurial, the project was hosted at http://nbpython.dev.java.net.

Getting Started

Old mailing list archives can be found at https://nbpython.dev.java.net/servlets/ProjectMailingListList

Features

Code completion

Code completion is available for

  • Modules available for imports
  • Imported symbols
  • Local variables
  • Other known classes and functions
  • Keywords

In addition, documentation is shown when available.

http://blogs.sun.com/tor/resource/pycompletion3.png

code-completion.png

Smart Indent, Outdent, and Pair matching

Pressing the return key will indent or outdent in a smart fashion. Matching for (), , , and "" is supported.

pair-matching.png

Editor Hints

Editor hints provide the capability to dynamically check the syntax and the semantics of your python code.

Detailed descriptions of the available python hints are available in this document.

http://wiki.netbeans.org/wiki/attach/PythonHints/circularredundancy.png

Code Folding

Classes, methods, functions, and triple quoted strings can be folded to conserve screen real estate and reduce clutter.

Unfolded code:

unfolded-code.png

Folded code:

folded-code.png

Semantic highlighting

Syntax highlighting reflects the semantics of the program: local and global variables are colored appropriately (and differently)

semantic-highlighting.png

Instant Rename

You can click on the name of a variable and synchronously rename all occurrences of it. This screenshot captures the screen in the middle of an instant rename operation. The variable being renamed is shown in red.

(Note - this screenshot is a bit old, and the bug shown here (the scope of name incorrectly includes for example the parameter in the nested function "withversion") has been fixed)

instant-rename.png

Mark Occurrences

Placing the caret on a variable shows other uses of the variable. Placing the caret on a function or method call shows other calls to the function or method.

(Note - this screenshot is a bit old, and the bug shown here (the scope of name incorrectly includes for example the parameter in the nested function "withversion") has been fixed)

mark-occurrences.png

Refactoring

Find Usages, and Rename, are available. TODO: Add screenshots.

Debugger

The debugger is derived from Jean-Yves Mengant's jpydbg debugger. A primer is available here at : http://wiki.netbeans.org/nbpythondebuggerprimer

debugger-local-variables.png

debugger-command-prompt.png

Multi-threaded debugging: http://jpydbg.blogspot.com/2009/01/jpydbg-mutithreaded-python-debugger.html

Platform Manager

The platform manager lets you specify which Python runtime (CPython or Jython) you wish to use. You can control which CPython is used, as well as specifying values for command line arguments. It is also possible to set the PYTHONPATH variable to set the Python load path.

platform-manager.png

Code Coverage

http://blogs.sun.com/tor/entry/netbeans_screenshot_of_the_week6

Test Runner UI

http://blogs.sun.com/tor/entry/netbeans_screenshot_of_the_week7

Creating Python Eggs

http://amitksaha.blogspot.com/2009/01/hatching-python-eggs-from-netbeans.html

Planning

Planning for NetBeans 7.0 has moved to http://wiki.netbeans.org/Python70Roadmap

NBPython

  • Milestone M5 (Jul 21)
    • Code folding for methods, classes and string blocks (e.g. documentation) (Tor Norbye) (DONE) (EA)
    • Semantic highlighting (highlights method definitions and parameter and usages of parameters) (Tor Norbye) (DONE) (EA)
    • Instant Rename for local variables/parameters (Tor Norbye) (DONE) (EA)
    • Mark Occurrences for local variables/parameters (Tor Norbye) (DONE) (EA)
    • Code completion on local variables and keywords (Tor Norbye) (DONE) (EA)
    • Keystroke handler (smart indent when you press return, and smart outdent, pair matching for quotes, parens, brackets and braces) (Tor Norbye) (DONE) (EA)
    • Platform Manager Platform Info tool(Allan Davis)(DONE) (EA)
    • Project Known File Types(Allan Davis)(DONE) (EA)
    • Python Platform Manager(Allan Davis)(DONE) (EA)
  • Milestone M6 (Aug 4)
    • Indexing (Tor Norbye) (EA)
    • Platform Manager Integration to Project(Thomas Zezula and Allan Davis)(DONE) (EA)
    • Project Actions(Thomas Zezula and Allan Davis)(DONE) (EA)
    • Code Templates for basic statements and built-in functions(Manuel Tijerino)(DONE)
  • Milestone M7 (Aug 18)
    • Integration with project system (Tor Norbye) (EA)
    • Create Python project from existing code(Thomas Zezula and Allan Davis)(DONE) (EA)
    • Python Debugger(Jean-Yves Mengant) (DONE) (EA)
      • Debugger Session
      • Debugger Actions
      • Debugger views
  • Milestone M8 (Sep 1)
    • Python Unit Test templets(Allan Davis) (EA)
    • Platform AutoDetect(Allan Davis) (EA)
    • Basic Type analysis for smarter code completion/go to declaration (Tor Norbye) (EA)
    • Python Project Customizers(Thomas Zezula and Allan Davis) (80%)(EA)
  • Milestone M9 (Sep 15)
    • Basic Quick Fixes (Tor Norbye) (EA)
    • Basic Refactoring (Find Usages and Rename) (Tor Norbye) (EA)

Attachments

code-completion.png Info on code-completion.png 47957 bytes
debugger-command-prompt.png Info on debugger-command-prompt.png 28822 bytes
debugger-local-variables.png Info on debugger-local-variables.png 73312 bytes
external.zip Info on external.zip 2433949 bytes
folded-code.png Info on folded-code.png 36449 bytes
instant-rename.png Info on instant-rename.png 76927 bytes
jython-antlr.jar Info on jython-antlr.jar 2539587 bytes
mark-occurrences.png Info on mark-occurrences.png 77319 bytes
pair-matching.png Info on pair-matching.png 6895 bytes
platform-manager.png Info on platform-manager.png 39072 bytes
semantic-highlighting.png Info on semantic-highlighting.png 23725 bytes
unfolded-code.png Info on unfolded-code.png 44312 bytes