Navigate Python Code with Wing IDE
"With Wing and my 40 inch monitor I feel like I can develop anything." -- Peter J. Bismuti
Understanding and getting around complex or unfamiliar source code can be time consuming and difficult. Wing IDE provides a number of features aimed at supporting developers in this regard.
Wing's project manager makes it easy to navigate and work with your source files. Each project can contain one or more live-updating directories or individually selected files. Projects can specify which Python version is being used, the Python Path, environment, and other configuration options that affect how your code is analyzed and which modules are imported. The Project view can be used to quickly open files, can be configured to expand to the location of the current editor file, and can be used to perform disk operations such as adding, deleting, copying, moving, and renaming files. It also shows the version control status of files when a version control system is being used.
Find Files and Symbols by Name
Once a project has been set up, Open from Project in the File menu (or its key binding) can be used to type a fragment of a file name to quickly switch to different files in the project. A similar interface for finding symbols in the current scope is provided by Find Symbol in the Source menu.
Source Index Menus
Wing displays nested source index menus at the top of each editor that contains a Python file. The first of these lists the functions and classes at the top level of the file. The second and later ones enumerate the contents of the current scope, listing methods or nested functions and classes.
Goto and Return from Definition
Wing makes it easy to jump to the point of definition of a symbol in Python source code by ctrl-clicking on it, pressing F4, or right clicking and selecting Goto Definition. To return from the point of definition just click on the back button in the top left of the editor or press Alt-Left. The history buttons in the editor work somewhat like browser forward/back buttons and are useful in traversing recently visited points in your source code.
Wing provides a Uses tool for displaying and browsing through all the points of use of a selected symbol in the source code. This works with local symbols, class or module level symbols, and across imports and subclasses. Aggressive static analysis and type inferencing makes it possible to omit like-named but otherwise distinct symbols from the display.
Source Code Browser
To see the structure of a particular file or to browse through your entire project by module or class hierarchy, select the Source Browser from the Tools menu. Choices for filtering and sorting the symbol list are provided in the Options menus.
The Source Assistant displays symbol type, call signature, and documentation for the currently selected symbol in the editor, the Source Browser, the Python Shell, or the Debug Probe. As you type a function or method invocation, the Source Assistant highlights the matching argument in the call signature. Links on the Source Assistant make it easy to jump to the point of definition and to overridden methods.
The bookmark manager allows you to set and traverse bookmarks in your code, either as anonymous or named marks. Traversal can be in order within the current or all files, by name, or by clicking on the Bookmarks tool. In Python files, the marks are anchored to the symbolic scope and track changes to the file even if they occur outside of Wing IDE.
Powerful Search Features
Wing provides four convenient search interfaces for different search tasks. The toolbar search is a quick way to search the current file. Keyboard-driven Mini-search in the Edit menu offers a more sophisticated interface for text and regular expression search and replace. The Search tool implements a familiar graphical interface for text, wildcard, and regular expression search and replace. The Search in Files tool provides a powerful multi-file search and replace capability, allowing searches to select files by file type from the project, from all open files, or within a selected directory. The Search in Files tool includes multi-file replace using regular expression group matching and can also be used to search Wing IDE's integrated documentation.
Avoid Open File Clutter
Searching, debugging, and browsing source code can all lead to an unmanageable clutter of files open in the editor. Wing avoids this by opening visited files initially in a transient state, so that they are automatically closed when hidden. The state is changed to permanently open if the file is edited or if the stick pin icon in the upper right of the editor is clicked to change the state manually. Right-clicking on the stick pin icon displays a menu of recently visited files for each editor.