Skip to content

Commit 682ed66

Browse files
committed
Update README.md for chat commands
1 parent f10863f commit 682ed66

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Screenshot](/Screenshot.png)
44

5-
Copilot for Xcode is an Xcode Source Editor Extension that provides Github Copilot support for Xcode. It uses the LSP provided through [Copilot.vim](https://github.com/github/copilot.vim/tree/release/copilot/dist) to generate suggestions and displays them as comments or in a separate window.
5+
Copilot for Xcode is an Xcode Source Editor Extension that provides Github Copilot and ChatGPT support for Xcode. It uses the LSP provided through [Copilot.vim](https://github.com/github/copilot.vim/tree/release/copilot/dist) to generate suggestions and displays them as comments or in a separate window.
66

77
Thanks to [LSP-copilot](https://github.com/TerminalFi/LSP-copilot) for showing the way to interact with Copilot. And thanks to [LanguageClient](https://github.com/ChimeHQ/LanguageClient) for the Language Server Protocol support in Swift.
88

@@ -31,7 +31,8 @@ For development instruction, check [Development.md](DEVELOPMENT.md).
3131

3232
- [Node](https://nodejs.org/) installed to run the Copilot LSP.
3333
- Public network connection.
34-
- Active GitHub Copilot subscription.
34+
- Active GitHub Copilot subscription (to use suggestion features).
35+
- Valid OpenAI API key (to use chat features).
3536

3637
## Permissions Required
3738

@@ -104,26 +105,27 @@ If you find that some of the features are no longer working, please first try re
104105

105106
## Commands
106107

108+
### Suggestion
109+
107110
- Get Suggestions: Get suggestions for the editing file at the current cursor position.
108111
- Next Suggestion: If there is more than one suggestion, switch to the next one.
109112
- Previous Suggestion: If there is more than one suggestion, switch to the previous one.
110113
- Accept Suggestion: Add the suggestion to the code.
111114
- Reject Suggestion: Remove the suggestion comments.
112115
- Toggle Real-time Suggestions: When turn on, Copilot will auto-insert suggestion comments to your code while editing.
113116
- Real-time Suggestions: Call only by Copilot for Xcode. When suggestions are successfully fetched, Copilot for Xcode will run this command to present the suggestions.
114-
- Prefetch Suggestions: Call only by Copilot for Xcode. In the background, Copilot for Xcode will occasionally run this command to prefetch real-time suggestions.
117+
- Prefetch Suggestions: Call only by Copilot for Xcode. In the background, Copilot for Xcode will occasionally run this command to prefetch real-time suggestions.
115118

116119
**About real-time suggestions**
117120

118-
The on/off state is persisted, so be sure to turn it off manually when you no longer want it. When real-time suggestion is turned on, a dot will show up next to the text cursor.
119-
120121
Whenever you stop typing for a few milliseconds, the app will automatically fetch suggestions for you, you can cancel this by clicking the mouse, or pressing **Escape** or the **arrow keys**.
121122

122-
When a fetch occurs, the dot will play an animation. If you don't see it, your permissions may not be set correctly.
123+
### Chat
123124

124-
The implementation won't feel as smooth as that of VSCode. The magic behind it is that it will keep calling the command from the menu when you are not typing or clicking the mouse. So it will have to listen to those events, I am not sure if people like it. Hope that next year, Apple can spend some time on Xcode Extensions.
125+
- Chat with Selection: Open a chat window, if there is a selection, the selected code will be added to the prompt.
126+
- Explain Selection: Open a chat window and explain the selected code.
125127

126-
It will be a better experience if you use the "Floating Widget" mode with real-time suggestions turned on.
128+
Chat commands are not available in comment mode.
127129

128130
## Key Bindings
129131

@@ -141,6 +143,8 @@ A [recommended setup](https://github.com/intitni/CopilotForXcode/issues/14) that
141143

142144
Essentially using `⌥⇧` as the "access" key combination for all bindings.
143145

146+
Another convenient method to access commands is by using the `⇧⌘/` shortcut to search for a command in the menu bar.
147+
144148
## Prevent Suggestions Being Committed (in comment mode)
145149

146150
Since the suggestions are presented as comments, they are in your code. If you are not careful enough, they can be committed to your git repo. To avoid that, I would recommend adding a pre-commit git hook to prevent this from happening.

0 commit comments

Comments
 (0)