AI Suggested Code Completion

Index of All Documentation » Wing Pro Reference Manual » AI Assisted Development »


You can ask Wing Pro's AI integration to suggest code appropriate for your current insertion point in the editor at any time by pressing Ctrl-? or Ctrl-Tab. This enters AI suggestion mode and sends a query off to the AI provider.

The query to the AI provider may take quite a while to complete, depending on the complexity of the problem, but generally produces code that would take far longer to write manually. Wing shows the status of the query in the status area in the bottom left of its window.

Once a result is available, it is placed into the editor in provisional form and the editor enters into AI suggestion mode. If you don't like the suggestion, you can press Ctrl-? again (or Tab while still in AI suggestion mode) to request another suggestion. This can be done repeatedly, and you can traverse suggestions that you have requested with Shift-Tab to move backwards and Tab to move forwards. Then press Enter to accept the current suggestion or Esc (or Ctrl-G or Esc Esc in Emacs mode) to cancel and exit AI suggestion mode.

A single Undo will undo any changes inserted into the editor if you decide you did not want the suggestion after you have already accepted it.

Note that moving the caret in the editor while waiting for an AI suggestion will automatically cancel the pending query and exit AI suggestion mode.

Auto-Context

By default Wing sends only the current file with your AI suggestion request. If the code you are asking the AI to write needs access to other files in your project, you can ask Wing to include those by enabling the AI Suggest Uses Auto-Context option on the Request Context page of the AI tool. Doing this causes requests to take longer to complete and cost significantly more, but can produce more accurate and precise results if the added context is relevant to your request. Be sure to read and understand AI Request Context and Managing Cost.

Key Binding

If you prefer a different key binding for this feature, you can bind the command ai-suggest to any key sequence with the User Interface > Keyboard > Custom Key Bindings preference.