Skip to content

Commit e29df87

Browse files
committed
Revise the text
1 parent 13425fa commit e29df87

3 files changed

Lines changed: 28 additions & 30 deletions

File tree

Copilot for Xcode/InstructionView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Text("Instruction")
1212
Text("Enable Extension")
1313
.font(.title3)
1414
Text("""
15-
1. Install Node.
16-
2. Click `Set Up Launch Agent` to set up an XPC service to run in the background.
15+
1. Install Node. Correctly setup the node path.
16+
2. Launching the app for the first time, it will automatically setup a launch agent.
1717
3. Refresh Copilot status (it may fail the first time).
1818
4. Click `Sign In` to sign into your GitHub account.
1919
5. After submitting your user code to the verification site, click `Confirm Sign-in` to complete the sign-in.
@@ -24,7 +24,7 @@ Text("""
2424
Text("Granting Permissions")
2525
.font(.title3)
2626
Text("""
27-
The app needs at least **Accessibility API** permissions to work. If you are using real-time suggestions and it doesn't work properly with **Accessibility API** permissions, try also enabling **Input Monitoring**..
27+
The app needs at least **Accessibility API** permissions to work. If you are using real-time suggestions, please also enabling **Input Monitoring**..
2828
2929
please visit the [project's GitHub page](https://github.com/intitni/CopilotForXcode#granting-permissions-to-the-app) for instructions.
3030
""")

DEVELOPMENT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Copilot for Xcode is the app containing both the XPCService and the editor exten
1010

1111
As its name suggests, the editor extension. Since an editor extension must be sandboxed, it will need to talk to a trusted non-sandboxed XPCService to break out the limitations. The identifier of the XPCService must be listed under `com.apple.security.temporary-exception.mach-lookup.global-name` in entitlements.
1212

13-
### XPCService
13+
### ExtensionService
1414

15-
The XPCService is a program that runs in the background and does basically everything. It redirects the requests from EditorExtension to `CopilotService` and returns the updated code back to the extension.
15+
The ExtensionService is a program that runs in the background and does basically everything. It redirects the requests from EditorExtension to `CopilotService` and returns the updated code back to the extension.
1616

17-
Since the Xcode source editor extension only allows its commands to be triggered manually, the XPCService has to use Apple Scripts to trigger the menu items to generate real-time suggestions.
17+
Since the Xcode source editor extension only allows its commands to be triggered manually, the ExtensionService has to use Apple Scripts to trigger the menu items to generate real-time suggestions.
1818

19-
The XPCService is also using a lot of Apple Script tricks to get the file paths and project/workspace paths of the active Xcode window because Xcode is not providing this information.
19+
The ExtensionService is also using a lot of Apple Script tricks to get the file paths and project/workspace paths of the active Xcode window because Xcode is not providing this information.
2020

2121
## Building and Archiving the App
2222

README.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Thanks to [LSP-copilot](https://github.com/TerminalFi/LSP-copilot) for showing t
1616

1717
- Accessibility API
1818
- Folder Access
19-
- Maybe Input Monitoring
19+
- Input Monitoring (for real-time suggestions)
2020

2121
## Installation and Setup
2222

@@ -32,7 +32,7 @@ Or install it manually, by downloading the `Copilot for Xcode.app` from the late
3232

3333
Then set it up with the following steps:
3434

35-
1. Open the app, and click "Set Up Launch Agents" to set up a background running XPC Service that does the real job.
35+
1. Open the app, the app will create a launch agent to setup a background running Service that does the real job.
3636
2. Enable the extension in `System Settings.app`.
3737

3838
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`.
@@ -47,17 +47,19 @@ Then set it up with the following steps:
4747

4848
### Granting Permissions to the App
4949

50+
**Permissions should be granted to `CopilotForXcodeExtensionService.app`**. Not `Copilot for Xcode.app`. It is located in `Copilot for Xcode.app/Contents/Applications/CopilotForXcodeExtensionService.app`, you can access this directory by right-clicking the app icon, and selecting `Show Package Contents`.
51+
5052
The first time the commands are run, the extension will ask for the necessary permissions. (except Input Monitoring, you have to enable it manually)
5153

5254
Or you can grant them manually by going to the `Privacy & Security` tab in `System Settings.app`, and
53-
- Accessibility API: Click `Accessibility`, and add `Copilot for Xcode.app` to the list.
54-
- Input Monitoring: (Accessibility API should cover Input Monitoring. You can try to enable it if Accessibility API is not enough for you). Click `Input Monitoring` and add `Copilot for Xcode.app` to the list.
55+
- Accessibility API: Click `Accessibility`, and drag `CopilotForXcodeExtensionService.app` to the list.
56+
- Input Monitoring (If you need real-time suggestions): Click `Input Monitoring` and drag `CopilotForXcodeExtensionService.app` to the list.
5557

56-
### Alternative Ways to Launch the XPC Service
58+
### Managing `CopilotForXcodeExtensionService.app`
5759

58-
The launch agent is set to `RunAtLoad`, so it will start when you log on to your computer. If you have a solution to configure the launch agent to start and stop on demand, please file an issue or pull request (note that the XPC service must be started before the user calls any commands, as it needs to call some of the commands proactively to provide real-time suggestions).
60+
This app runs whenever you open `Copilot for Xcode.app` or `Xcode.app`. You can quit it with its menu bar item that looks like a steering wheel.
5961

60-
Alternatively, you can skip the Launch Agent part and use other applications to watch Xcode launch and then launch the XPC service when needed. The executable is located at `Copilot for Xcode.app/Contents/MacOS/CopilotForXcodeXPCService`. Or you can remove the `RunAtLoad` field from the plist and run it manually.
62+
You can also set it to quit automatically when the above 2 apps are closed.
6163

6264
## Update
6365

@@ -69,7 +71,7 @@ brew upgrade --cask copilot-for-xcode
6971

7072
Alternatively, You can download the latest version manually from the latest [release](https://github.com/intitni/CopilotForXcode/releases).
7173

72-
If you are upgrading from a version lower than 0.6.0, don't forget to click `Restart XPC Service` in the application after the update to kill the old version and start the new one.
74+
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.
7375

7476
If you want to keep track of the new releases, you can watch the releases of this repo to get notifications about updates.
7577

@@ -82,19 +84,19 @@ If you find that some of the features are no longer working, please first try re
8284
- Previous Suggestion: If there is more than one suggestion, switch to the previous one.
8385
- Accept Suggestion: Add the suggestion to the code.
8486
- Reject Suggestion: Remove the suggestion comments.
85-
- Turn On Real-time Suggestions: When turn on, Copilot will auto-insert suggestion comments to your code while editing.
86-
- Turn Off Real-time Suggestions: Turns the real-time suggestions off.
87+
- Toggle Real-time Suggestions: When turn on, Copilot will auto-insert suggestion comments to your code while editing.
8788
- 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.
8889
- Prefetch Suggestions: Call only by Copilot for Xcode. In the background, Copilot for Xcode will occasionally run this command to prefetch real-time suggestions.
8990

9091
**About real-time suggestions**
9192

92-
- The on/off state is persisted, make sure you turn it off manually if you no longer want it.
93-
- The implementation won't feel as smooth as that of VSCode.
94-
95-
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.
93+
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 breathing dot will show up next to the mouse pointer or the editing cursor.
94+
95+
Whenever you stop typing for a few seconds, the app will automatically fetch suggestions for you, you can cancel this by clicking the mouse, or pressing **Escape** or the **arrow keys**.
96+
97+
When a fetch occurs, the dot will have a slightly different animation. If you don't see it, your permissions may not be set correctly.
9698

97-
Hope that next year, Apple can spend some time on Xcode Extensions.
99+
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.
98100

99101
## Key Bindings
100102

@@ -136,27 +138,23 @@ fi
136138

137139
**Q: The extension doesn't show up in the `Editor` menu.**
138140

139-
> A: Please make sure `Copilot for Xcode` is turned on in `System Settings.app > Privacy & Security > Extensions > Xcode Source Editor Extension`.
141+
> A: Please make sure `Copilot` is turned on in `System Settings.app > Privacy & Security > Extensions > Xcode Source Editor Extension`.
140142
141143
**Q: The extension says it can't connect to the XPC service/helper.**
142144

143145
> A: If you have just updated the app from an old version, make sure you have restarted the XPC Service.
144146
>
145-
> Please make sure you have set up Launch Agents, try running `launchctl list | grep com.intii` from the terminal, and see if `com.intii.CopilotForXcode.XPCService` exists. If not, check `~/Library/LaunchAgents` to see if `com.intii.CopilotForXcode.XPCService.plist` exists. If they don't, and the button in the app fails to create them, please try to do it by hand.
147+
> Please make sure you have set up Launch Agents, try running `launchctl list | grep com.intii` from the terminal, and see if `com.intii.CopilotForXcode.ExtensionService` exists. If not, check `~/Library/LaunchAgents` to see if `com.intii.CopilotForXcode.ExtensionService.plist` exists. If they don't, and the button in the app fails to create them, please try to do it by hand.
146148
>
147149
> If you are installing multiple versions of the extension on your machine, it's also possible that Xcode is using the older version of the extension.
148150
149151
**Q: The extension complains that it has no access to the Accessibility API**
150152

151-
> A: Check the list in `System Settings.app > Privacy & Security > Accessibility`. Turn the toggle on for `Copilot for Xcode`. If it's not on the list, add it manually.
152-
>
153-
> If you have just **updated the app**, consider restarting XPCService in app or trying removing the Launch Agents and set it up again!
153+
> A: Please check if the [Accessibility API permission](https://github.com/intitni/CopilotForXcode#granting-permissions-to-the-app) is setup correctly.
154154
155155
**Q: I turned on real-time suggestions, but nothing happens**
156156

157-
> A: Please first check that the Accessibility API permission is granted, see the previous QA for details. The Accessibility API should cover Input Monitoring, but if real-time suggestions still do not work, try adding `Copilot for Xcode` to the list in `System Settings.app > Privacy & Security > Input Monitoring`. After that, you may then need to restart the XPC Service.
158-
>
159-
> If that doesn't help, try to restart the XPC Service again.
157+
> A: Please check if the [Accessibility API and Input Monitoring permission](https://github.com/intitni/CopilotForXcode#granting-permissions-to-the-app) is setup correctly.
160158
161159
**Q: Will it work in future Xcode updates?**
162160

0 commit comments

Comments
 (0)