Ask mode in Qoder CN answers coding questions, generates code suggestions, adds comments, optimizes code, explains code, fixes issues, and troubleshoots compilation errors.
Ask general questions
To get help with coding problems, open the AI Chat panel from the IDE side toolbar or use a keyboard shortcut, and switch to Ask mode. You can get answers and troubleshooting ideas without leaving your IDE.
If web tools are enabled in the settings, Qoder CN can autonomously decide when to call web-search tools, such as retrieving web page content or querying the internet, based on your question.
Ask about code
To ask about specific code, select a code snippet or file, then type your question in the AI Chat window. Qoder CN responds based on the selected code.
When tool invocation is enabled, Qoder CN can autonomously call project-search tools, such as symbol search, file search, and code search, without requiring you to manually add project files. It automatically perceives the project context so the answers better match your project.
Commands
Commands are supported in Visual Studio Code and JetBrains IDE plug-in only, not in Qoder CN IDE.
How to trigger commands
Qoder CN supports the following ways to trigger commands:
- Right-click menu: Select code in the editor, right-click, and choose a command from the Qoder CN submenu.
- Type /: In the chat box, type / to list quick commands and select one.
- Quick access above functions: Click the quick access button above a function to generate unit tests, comments, explanations, or optimizations without selecting code.
Ask mode provides four built-in commands:
| Command | Details |
|---|
| Explain Code/explain | Recognizes the programming language of selected code and generates explanations. |
| Generate Unit Test/unittest | Generates unit tests based on frameworks, such as JUnit, Mockito, Spring Test, unit test, and pytest. |
| Generate Comments/comment | Generates method and inline comments in one click. |
| Code Optimization/optimize | Detects issues from syntax errors to performance problems and suggests improvements. |
Add requirements to commands
Add specific requirements in the chat box alongside your command. Examples:
- Select /unittest and specify a framework, such as JUnit 5.
- Select /comment and add details, such as including the date at the start.
Suggest fixes
Quick fix
To fix code issues, Qoder CN provides one-click fix suggestions for bugs and errors.
To do so, either:
- In the editor, find the error icon and select Fix using Qoder CN from the list.
- In the Problem tool window, find the row with the error message, right-click it, and select Fix using Qoder CN from the list.
Troubleshooting (IntelliJ IDEA)
If an exception occurs while running code in IntelliJ IDEA, click the Qoder CN icon in the Run tool window. Qoder CN provides troubleshooting suggestions based on the code context and error messages.
Troubleshooting (VS Code)
If an error occurs after compiling or running code in the VS Code terminal, right-click the message and select Explain using Qoder CN. Qoder CN explains the error and suggests fixes.