AI coding assistants

Edit on GitHub

This document describes the AI Assistants you can use when developing your Spryker projects. You will read about recommended AI Assistants, how to set up and use them.

Here are some examples of how you can use AI assistants in your work:

  • Generate a code completion suggestion
  • Describe a code fragment
  • Generate a doc block for a code fragment
  • Fix syntax bugs in a code fragment
  • Simplify a code fragment
  • Generate tests for a code fragment
  • IO interactions
  • Code generation

Before using a AI-related tools, consult with your legal department.

Install AI Assistants

We recommend trying the following assistants:

  • GitHub Copilot
  • Qodo (formerly Codium)
  • Cursor

Install GitHub Copilot

GitHub Copilot is an AI pair programmer that helps you write code faster. It draws context from comments and code and suggests individual lines and whole functions instantly. To start using GitHub Copilot, do the following:

  1. Install the GitHub Copilot extension in your IDE.
  2. Authorize yourself as a GitHub user in Preferences > Languages and Frameworks > GitHub Copilot.

github-copilot-config

Now you can use the GitHub Copilot.

Install Qodo

Qodo is an AI-powered tool that helps developers to generate code, tests, and docs. To set up Qodo, install the Qodo Gen plugin. If the installation is successful, you can see Codiumate in the context menu.

qodo-menu

Install Cursor

Cursor is an AI powered IDE forked from VS Code. To set up Cursor, follow the steps:

  1. Download Cursor from its official website.
  2. Install Cursor from the downloaded file.
  3. Optional: To save your work, enable autosave files in the settings.

cursor-autosave

Using GitHub Copilot

Most features of GitHub Copilot can be used as follows:

  1. Highlight a code fragment to process.
  2. Right-click to open the context menu.
  3. In the context menu, hover over GitHub Copilot and click the needed option.

Generate suggestions based on the existing code in your project:

github-copilot-suggestion

Explain a code fragment:

github-copilot-description

Generate doc blocks and add comments:

github-copilot-generate-docs

Generate suggestions for fixing syntax bugs:

github-copilot-fix-syntax-bugs

Refactor a code fragment:

github-copilot-refactor-code

Generate tests:

github-copilot-generate-tests

Interact with GitHub Copilot using prompts:

github-copilot-io-interaction

Generating tests using Qodo

When it comes to generating tests, Qodo offers a more flexible configuration and a wider range of test scenarios compared to GitHub Copilot. Here’s an example of tests generated with Qodo:

quodo-generate-tests

Code generation using Cursor

Cursor AI offers context-aware suggestions by considering the bigger picture within the codebase. This enables it to deliver more accurate and well-structured recommendations, in contrast to GitHub Copilot, which mainly focuses on real-time suggestions based on the specific line of code you’re working on. It’s great at generating basic code and significantly saves time, especially when you need to create something from scratch.

Here’s an example of code generated with Cursor:

cursor-generate-code

Conclusion

This document provides a basic introduction to AI assistants. For a more detailed guide, check out the AI assistants training course.