Ghostwriter is a code completion tool that provides suggestions based on the code in your current file. To use it, simply start coding and the suggestions will appear inline.
- Code completion suggestions based on your current file
- Enhanced suggestions by using code comments
- Prompt engineering for improved results
- Toggle code completion on or off in editor settings
How to Use
- Start coding in your file and Ghostwriter will provide code completion suggestions.
- Use code comments to provide additional context for more accurate suggestions.
- Write clean, relevant code and comments for the best results from Ghostwriter.
- If desired, toggle Ghostwriter on or off in the editor settings.
Here is an example of Ghostwriter providing basic code completion suggestions:
And here is an example of Ghostwriter using code comments to generate more accurate suggestions:
Good prompts for AI code helpers like Ghostwriter can greatly improve the tool's performance and usefulness. Here are some examples of original prompts and improved versions that provide more context and detail:
|Original Prompt||Improved Prompt||Possible AI Confusion|
|Ghostwriter might get confused with what to do with the added numbers. In the original prompt, no steps are specified with what to do with the result.|
|Ghostwriter will not know what to write next if only 'event listener' is specified.|
|Ghostwriter might accidentally provide a URL instead of actually making the api call.|
|Ghostwriter will most likely get confused selecting the checkbox element.|
|Ghostwriter might not know which numbers to include in the array without more specific instructions.|
|Ghostwriter might not know the desired sorting order without more specific instructions.|
|Ghostwriter might not know which file to read without a specific filename.|
|Ghostwriter might not know which database to connect to or which library to use.|
|Ghostwriter might not know what to do with the list items without specific instructions.|
|Ghostwriter might not know which table to insert into without a specific table name.|
Toggling Code Completion
To deactivate Ghostwriter's Code Completion feature, go to your editor settings and switch Ghostwriter on or off.