How Analysis Works

Index of All Documentation » Wing Pro Reference Manual » Source Code Analysis »

In analysing your source, Wing will use the Python interpreter and PYTHONPATH that you have specified in your Project Properties. If you have indicated a main debug file for your project, the values from that file's properties are used; otherwise the project-wide values are used. Whenever any of these values changes, Wing will re-analyze some or all of your source code.

You can view the Python interpreter and PYTHONPATH that are being used by the source code analysis engine, by selecting the Show Analysis Stats item in the Source menu. The values shown in the resulting dialog window are read-only but may be changed by pushing the Settings button. See Project-wide Properties for details on changing these values.

Be aware that if you use multiple versions of the Python interpreter or different PYTHONPATH values for different source files in your project, Wing will analyse all files in the project using the one interpreter version and PYTHONPATH it finds through the main debug file or project-wide debug properties settings. This may lead to incorrect or incomplete analysis of some source, so it is best to use only one version of Python with each Wing project file.

In Wing 101, which which does not have projects, the Python environment is instead configured with Configure Python in the Edit menu.

When Wing tries to find analysis information for a particular module or file, it takes the following steps:

  • The path and same directory as the referencing module are searched for an importable module
  • If the module is Python code, Wing statically analyses the code to extract information from it
  • If the module is an extension module, Wing looks for a *.pi interface description file as described later in this section
  • If the module cannot be found, Wing tries to import it in a separate process space in order to analyze its contents
  • If a debug process is active, Wing tries to read relevant type information from the live runtime state associated with the source code