Inline chat allows developers to have conversations directly in the code editor, enabling developers to modify code in a single file or ask questions instantly through natural language conversations.
To experience the inline chat feature, update Lingma to version 2.5.3 (VS Code)/2.5.2 (JetBrains IDEs) or above.
Open the inline chat window
After installing Lingma in your IDE, open the inline chat window in two ways:
Use the keyboard shortcut
⌘
⇧
I
(Ctl
Shift
I
) to open the chat window.JetBrains IDEs only: Select code snippet in a file, and then click the Lingma icon in front of the code to open the inline chat window.
Action | macOS | Windows |
Open the inline chat window |
|
|
Select a chat mode
After opening the inline chat window and entering your request, you can interact with Lingma in two modes:
Edit: Enter your request in the chat window, then press
Enter
(Ctrl
Enter
). Lingma will modify the current code file based on your request, the selected code snippet, and relevant context.Ask: Enter your request in the chat window, then press
⌘
Enter
(Ctrl
Enter
) to ask questions.
In VS Code, Lingma only supports the Edit mode when you open the inline chat window using the keyboard shortcut.
Add context
In the inline chat window, type #
to add relevant context. You can add files, images, or enterprise knowledge base content. Select the desired context, and Lingma will combine your request with the relevant context to modify the current code file or answer your question.
Use commands
In the inline chat window, type /
to select commands. Currently, /comment
and /optimize
are supported.
Example scenarios
Example 1: Modifying code snippets
When you need to modify a code file or snippet, select the code snippet and open the inline chat window. Enter code modification requirements, such as adding comments or refactoring code. Lingma will generate code changes in the code editor.
Example 2: Adding new code snippets
When you need to add a code snippet, open the inline chat window and enter your coding requirements. Lingma will generate the relevant code suggestions based on your request.
Example 3: Inquiring about code implementation within the project
When you need to instantly query certain methods in the current project during coding, open the inline chat window and provide the file and requirements you want to inquire about. You can quickly obtain this information from Lingma.