Skip to main content

Explain Code

Ghostwriter can give you step-by-step natural language explanations of your code with Explain Code. This feature is especially useful when trying to understand other people's code or code you wrote in the past.

Consider this example from 100 Days of Code. Follow these steps:

  1. Select the block of code you want explained.
  2. Right-click in the editor to open up the context menu.
  3. Select Explain code from the context menu and wait for Ghostwriter to generate an explanation for the code you selected.
  4. Once your explanation has been generated, you'll see a step-by-step walkthrough of the code you selected.
  5. If the explanation wasn't helpful, you can have Ghostwriter try again by pressing the Generate new feedback button.
  6. You can also help Ghostwriter improve by telling us whether it was a good explanation, and/or pressing the Share feedback button to provide written details.
Was this doc useful?