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: DEVELOPMENT.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,10 @@ To run unit tests, just run test from the `Copilot for Xcode` target.
41
41
42
42
For new tests, they should be added to the `TestPlan.xctestplan`.
43
43
44
+
## Chat Plugins
45
+
46
+
To create a chat plugin, please use the `TerminalChatPlugin` as an example. You should add your plugin to the target `ChatPlugin` and register it in `ChatService`.
For frequently asked questions, check [FAQ](https://github.com/intitni/CopilotForXcode/issues/65).
27
30
28
31
For development instruction, check [Development.md](DEVELOPMENT.md).
29
32
@@ -57,18 +60,26 @@ Then set it up with the following steps:
57
60
58
61
1. Open the app, the app will create a launch agent to setup a background running Service that does the real job.
59
62
2. Optionally setup the path to Node. The default value is just `node`, Copilot for Xcode.app will try to find the Node from `/usr/bin:/usr/local/bin`. If your Node is installed somewhere else, you can run `which node` from terminal to get the path.
60
-
3. Enable the extension in `System Settings.app`.
61
63
62
-
From the Apple menu located in the top-left corner of your screen click `System Settings`. Navigate to `Privacy & Security` then toward the bottom click `Extensions`. Click `Xcode Source Editor` and tick `Copilot`.
64
+
### Enable the Extension
65
+
66
+
Enable the extension in `System Settings.app`.
67
+
68
+
From the Apple menu located in the top-left corner of your screen click `System Settings`. Navigate to `Privacy & Security` then toward the bottom click `Extensions`. Click `Xcode Source Editor` and tick `Copilot`.
63
69
64
-
If you are using macOS Monterey, enter the `Extensions` menu in `System Preferences.app` with its dedicated icon.
70
+
If you are using macOS Monterey, enter the `Extensions` menu in `System Preferences.app` with its dedicated icon.
65
71
66
72
### Sign In GitHub Copilot
67
73
68
-
1. In the app, refresh the Copilot status (it may fail for the first time, try at least one more time).
74
+
1. In the host app, click GitHub Copilot to enter the GitHub Copilot account settings.
69
75
2. Click "Sign In", and you will be directed to a verification website provided by GitHub, and a user code will be pasted into your clipboard.
70
76
3. After signing in, go back to the app and click "Confirm Sign-in" to finish.
71
77
78
+
### Setting Up OpenAI API Key
79
+
80
+
1. In the host app, click OpenAI to enter the OpenAI account settings.
81
+
2. Enter your api key to the text field.
82
+
72
83
### Granting Permissions to the App
73
84
74
85
The first time the app is open and command run, the extension will ask for the necessary permissions.
@@ -99,8 +110,6 @@ Alternatively, You can use the in-app updater or download the latest version man
99
110
100
111
If you are upgrading from a version lower than **0.7.0**, please run `Copilot for Xcode.app` at least once to let it set up the new launch agent for you and re-grant the permissions according to the new rules.
101
112
102
-
If you want to keep track of the new releases, you can watch the releases of this repo to get notifications about updates.
103
-
104
113
If you find that some of the features are no longer working, please first try regranting permissions to the app.
105
114
106
115
## Commands
@@ -127,6 +136,17 @@ Whenever you stop typing for a few milliseconds, the app will automatically fetc
127
136
128
137
Chat commands are not available in comment mode.
129
138
139
+
#### Chat Plugins
140
+
141
+
The chat panel supports chat plugins that may not require an OpenAI API key. For example, if you need to use the `/run` plugin, you just type
142
+
```
143
+
/run echo hello
144
+
```
145
+
146
+
| Command | Description |
147
+
|:---:|---|
148
+
|`/run`| Runs the command under the project root. You can also use environment variable `PROJECT_ROOT` to get the project root and `FILE_PATH` to get the editing file path.|
149
+
130
150
## Key Bindings
131
151
132
152
It looks like there is no way to add default key bindings to commands, but you can set them up in `Xcode settings > Key Bindings`. You can filter the list by typing `copilot` in the search bar.
@@ -164,7 +184,6 @@ fi
164
184
- The first run of the extension will be slow. Be patient.
165
185
- The extension uses some dirty tricks to get the file and project/workspace paths. It may fail, it may be incorrect, especially when you have multiple Xcode windows running, and maybe even worse when they are in different displays. I am not sure about that though.
166
186
- The suggestions are presented as C-style comments in comment mode, they may break your code if you are editing a JSON file or something.
167
-
- When a real-time suggestion request is triggered, there is a chance that it may briefly block the editor. This can occur at most once for each file after each restart of the extension because the extension needs to initiate real-time suggestion by clicking an item from the menu bar. However, once a command has been executed and some information is cached, the extension will be able to trigger real-time suggestion using a different method.
0 commit comments