AI Code Assistant
The AI code assistant provides code suggestions, completions, and chat functionality for your Workspace code editor. The AI code assistant uses Mistral Codestral to provide code suggestions and completions, and OpenAI ChatGPT to provide chat functionality.
Use the AI code assistant by opening a Workspace in Visual Studio Code Browser IDE.
The AI code assistant is powered by continue.dev open-source extension, providing the following features:
-
Chat with the AI to understand and iterate your code.
-
Receive inline autocomplete and code suggestions as you type your code.
-
Modify your code without leaving the current file.
-
Establish shortcuts for common use cases, such as code review, writing comments, generating unit tests, or refactoring methods.
Chat
Chat provides a conversational interface to interact with the AI by asking questions about your code, getting suggestions, and receiving feedback.
- Highlight a code section you want to chat about.
- Press cmd/ctrl + L (VS Code) or cmd/ctrl + J (JetBrains) to open the chat.
- Ask questions about your code or request changes.
- Click
Apply
to apply the AI suggestions to your code.
Upon applying the suggestions, the chat will close, and the changes will be reflected in your code.
Autocomplete
Autocomplete provides inline code suggestions and completions as you type your code. The autocomplete feature uses Mistral Codestral to provide suggestions based on the context of your code.
- Enable the
Enable Tab Autocomplete
option in your IDE settings, or click theContinue
button in the status bar at the bottom right of your IDE. - Start typing your code.
- Accept the suggestion by pressing Tab or reject the suggestion by pressing Esc .
Upon accepting the suggestion, the code will be completed inline in your editor. Rejecting the suggestion will dismiss the autocomplete suggestion.
Edit
Edit provides modifying capabilities to your code without leaving the current file. Describe or request changes to make in your code, and the AI will generate inline diffs with the proposed changes.
- Highlight a code section you want to edit.
- Press cmd/ctrl + i to open the edit dialog.
- Describe and request changes you want to make in your code.
- Changes will be generated as inline diffs within your code selection.
- A diff will be generated inline to your code with the proposed changes.
- Navigate through the proposed changes and press cmd/ctrl + opt + y to accept the changes, or cmd/ctrl + opt + n to reject the changes.
Upon accepting the changes, the proposed changes will be applied to your code. Rejecting the changes will dismiss the proposed changes.
For longer and more complex tasks, use the Chat option to interact with the AI.
Actions
Actions provide shortcuts for common use cases, such as code review, writing comments, generating unit tests, or refactoring methods. Use Actions to create custom actions that automate repetitive tasks, speed up your workflow, and improve your productivity.
Actions provide two methods to perform actions by using:
Default and Built-in Actions
Default actions include /edit
, /comment
, /share
, or /test
.
Built-in actions can be enabled in the config.json
file as slashCommands
objects. Follow the built-in actions guide to enable built-in actions in your code editor.
- Highlight a code section you want to perform an action on.
- Press cmd/ctrl + L (VS Code) or cmd/ctrl + J (JetBrains) to open the chat.
- Use the slash command
/
to invoke an action. - Describe and request an action to perform in your code.
- Accept the changes or reject the changes.
Upon accepting the suggestion, the action will be performed in your editor. Rejecting the suggestion will dismiss the action.
Custom Actions
Custom actions can be created to automate repetitive tasks, speed up your workflow, and improve your productivity. Custom actions are used by defining a .prompt
file in your development environment. Prompt files can be defined to perform simple actions or complex actions using templates.
Follow the custom actions guide to create custom actions for your development environment.
- Highlight a code section you want to perform an action on.
- Press cmd/ctrl + L (VS Code) or cmd/ctrl + J (JetBrains) to open the chat.
- Use the custom slash command
/
to invoke an action. - Describe and request an action to perform in your code.
- Accept the changes or reject the changes.
Upon accepting the suggestion, the action will be performed in your editor. Rejecting the suggestion will dismiss the action.
Quick Actions
Quick actions are displayed as buttons above top-level classes and functions in your source code. Quick actions provide two types of actions:
Customize your Quick actions by defining a by defining a .prompt
file in your development environment.
Follow the prompt files guide to create quick actions for your development environment.
Right-click Actions
Right-click actions provide a context menu to perform actions in your code.
- Highlight a code section you want to perform an action on.
- Right click to open the context menu.
- Select an action from the context dropdown menu to perform the action.
Upon accepting the suggestion, the action will be performed in your editor. Rejecting the suggestion will dismiss the action.
Debug Action
Debug action is a built-in keyboard shortcut to debug your code.
- Press cmd/ctrl + shift + r to copy the contents of the current terminal into the chat sidebar and debug your code.
Quick Fixes (VS Code)
Quick fixes provide suggestions to fix issues in your code by underlining the issue in yellow or red to indicate errors.
- Place your cursor near the underlined issue in your code.
- VS Code will display a lightbulb icon next to the issue.
- Click the lightbulb icon or press cmd/ctrl + . to view a dropdown menu with quick fixes.
- Select
Ask Continue
to apply the suggested fix to your code.
Upon accepting the suggestion, the quick fix will be applied to your code. Rejecting the suggestion will dismiss the quick fix.