Skip to content

Commit 1657e33

Browse files
committed
Update docs
1 parent 345b10c commit 1657e33

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

DEVELOPMENT.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ To run unit tests, just run test from the `Copilot for Xcode` target.
4141

4242
For new tests, they should be added to the `TestPlan.xctestplan`.
4343

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`.
47+
4448
## Code Style
4549

4650
We use SwiftFormat to format the code.

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Thanks to [LSP-copilot](https://github.com/TerminalFi/LSP-copilot) for showing t
2323
- [Prevent Suggestions Being Committed](#prevent-suggestions-being-committed)
2424
- [Limitations](#limitations)
2525
- [License](#license)
26-
- [FAQ](https://github.com/intitni/CopilotForXcode/issues/65)
26+
27+
For frequently asked questions, check [FAQ](https://github.com/intitni/CopilotForXcode/issues/65).
2728

2829
For development instruction, check [Development.md](DEVELOPMENT.md).
2930

@@ -127,6 +128,17 @@ Whenever you stop typing for a few milliseconds, the app will automatically fetc
127128

128129
Chat commands are not available in comment mode.
129130

131+
#### Chat Plugins
132+
133+
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
134+
```
135+
/run echo hello
136+
```
137+
138+
| Command | Description |
139+
|:---:|---|
140+
| `/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.|
141+
130142
## Key Bindings
131143

132144
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 +176,6 @@ fi
164176
- The first run of the extension will be slow. Be patient.
165177
- 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.
166178
- 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.
168179

169180
## License
170181

0 commit comments

Comments
 (0)