Imports Tool

Index of All Documentation » Wing Pro Reference Manual » Refactoring »


Wing also provides an Imports tool in the Tools menu, to manage imports in your code. The tool updates to display all imports present in the current editor file.

The following operations are provided:

Remove Import: Imports may be removed by right-clicking on an import and selecting Remove. Wing will first search for any uses in the project files and if uses are found that prevent removal, the Refactoring tool will be displayed with a list of uses and the import can potentially be removed from there. If no uses are found, the import will be removed immediately. A busy icon will be displayed to the left of the Options menu while the find search for uses is active; the search may be terminated using Terminate Remove Import Tasks on the Options menu.

Add Import Statement: New import statements may be added by right-clicking on the Imports tool and selecting Add New Import Statement. This displays the Refactoring tool to prompt for the import statement to add and to complete the operation.

A number of options are available, to control the behavior of the Imports tool. These are found in its Options menu:

  • Follow Selection can be enabled to display the currently selected import in the editor, as the selection on the list in the Imports tool changes.
  • Don't Remove if Likely Uses are Found controls whether an import will be immediately removed if a likely use is found.
  • Don't Remove if Possible Uses are Found controls whether an import will be immediately removed if a possible use is found.
  • Don't Remove if Unlikely Uses are Found controls whether an import will be immediately removed if an unlikely use is found.
  • Show Deletion Warning Dialog controls whether a dialog is shown before switching to the Refactoring tool to manage deletion of an import that appears to be in use. When the dialog is not shown, a message is instead shown in the status area at the bottom of Wing's window.