Modification Feature
You can use the modification feature to modify or write code in the active document.
To use the modification feature, you can select a piece of code in the active document and do one of the following:
- Right click the circle widget and select
Modify or write code
from the context menu. - Use the Xcode menu
Editor
->Copilot
->Modify or write code
.
To write code, you can simply place the text cursor at the desired location without any selection.
You can also modify multiple selections by selecting multiple pieces of code.
Configurations
You can configure the modification feature in the Feature
-> Modification
section in the host app.
Contexts
The modification feature will always have access to the active document.
Additionally, you can add more contexts by clicking the +
button next to the input field. Or by typing @context
in the input field, the app will show the context list as you type.
To configure each context, you can click the context name in the context list.
Pinned Contexts
If you add a context by clicking the +
button next to the input field, the context will be persisted across the chat sessions. You can also delete the context by clicking the x
button in the context list.
Temporary Contexts
If you add a context by typing @context
in the input field, the context will be a temporary context. The context will be removed after you send a message.
You can also pin the context by clicking the pin
button in the context list.
Detaching the Modification Panel
By default, the modification panel is tied to the active document. If you want to use the modified code in another document, you can detach the panel by clicking the Detach
button in the top left corner of the panel.
Copy Button
You can copy the code block by clicking the copy button in the code block. You can also drag the copy button to the file tree in Xcode to create a new file with the code block content.