You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3

4
4
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.
6
6
7
7
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.
8
8
@@ -31,7 +31,8 @@ For development instruction, check [Development.md](DEVELOPMENT.md).
31
31
32
32
-[Node](https://nodejs.org/) installed to run the Copilot LSP.
33
33
- 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).
35
36
36
37
## Permissions Required
37
38
@@ -104,26 +105,27 @@ If you find that some of the features are no longer working, please first try re
104
105
105
106
## Commands
106
107
108
+
### Suggestion
109
+
107
110
- Get Suggestions: Get suggestions for the editing file at the current cursor position.
108
111
- Next Suggestion: If there is more than one suggestion, switch to the next one.
109
112
- Previous Suggestion: If there is more than one suggestion, switch to the previous one.
110
113
- Accept Suggestion: Add the suggestion to the code.
111
114
- Reject Suggestion: Remove the suggestion comments.
112
115
- Toggle Real-time Suggestions: When turn on, Copilot will auto-insert suggestion comments to your code while editing.
113
116
- 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.
115
118
116
119
**About real-time suggestions**
117
120
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
-
120
121
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**.
121
122
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
123
124
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.
125
127
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.
127
129
128
130
## Key Bindings
129
131
@@ -141,6 +143,8 @@ A [recommended setup](https://github.com/intitni/CopilotForXcode/issues/14) that
141
143
142
144
Essentially using `⌥⇧` as the "access" key combination for all bindings.
143
145
146
+
Another convenient method to access commands is by using the `⇧⌘/` shortcut to search for a command in the menu bar.
147
+
144
148
## Prevent Suggestions Being Committed (in comment mode)
145
149
146
150
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