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: Copilot for Xcode/InstructionView.swift
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ Text("Instruction")
12
12
Text("Enable Extension")
13
13
.font(.title3)
14
14
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.
17
17
3. Refresh Copilot status (it may fail the first time).
18
18
4. Click `Sign In` to sign into your GitHub account.
19
19
5. After submitting your user code to the verification site, click `Confirm Sign-in` to complete the sign-in.
@@ -24,7 +24,7 @@ Text("""
24
24
Text("Granting Permissions")
25
25
.font(.title3)
26
26
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**..
28
28
29
29
please visit the [project's GitHub page](https://github.com/intitni/CopilotForXcode#granting-permissions-to-the-app) for instructions.
Copy file name to clipboardExpand all lines: DEVELOPMENT.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,13 @@ Copilot for Xcode is the app containing both the XPCService and the editor exten
10
10
11
11
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.
12
12
13
-
### XPCService
13
+
### ExtensionService
14
14
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.
16
16
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.
18
18
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.
Copy file name to clipboardExpand all lines: README.md
+21-23Lines changed: 21 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Thanks to [LSP-copilot](https://github.com/TerminalFi/LSP-copilot) for showing t
16
16
17
17
- Accessibility API
18
18
- Folder Access
19
-
-Maybe Input Monitoring
19
+
- Input Monitoring (for real-time suggestions)
20
20
21
21
## Installation and Setup
22
22
@@ -32,7 +32,7 @@ Or install it manually, by downloading the `Copilot for Xcode.app` from the late
32
32
33
33
Then set it up with the following steps:
34
34
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.
36
36
2. Enable the extension in `System Settings.app`.
37
37
38
38
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:
47
47
48
48
### Granting Permissions to the App
49
49
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
+
50
52
The first time the commands are run, the extension will ask for the necessary permissions. (except Input Monitoring, you have to enable it manually)
51
53
52
54
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.
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.
59
61
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.
Alternatively, You can download the latest version manually from the latest [release](https://github.com/intitni/CopilotForXcode/releases).
71
73
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.
73
75
74
76
If you want to keep track of the new releases, you can watch the releases of this repo to get notifications about updates.
75
77
@@ -82,19 +84,19 @@ If you find that some of the features are no longer working, please first try re
82
84
- Previous Suggestion: If there is more than one suggestion, switch to the previous one.
83
85
- Accept Suggestion: Add the suggestion to the code.
84
86
- 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.
87
88
- 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.
88
89
- Prefetch Suggestions: Call only by Copilot for Xcode. In the background, Copilot for Xcode will occasionally run this command to prefetch real-time suggestions.
89
90
90
91
**About real-time suggestions**
91
92
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.
96
98
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.
98
100
99
101
## Key Bindings
100
102
@@ -136,27 +138,23 @@ fi
136
138
137
139
**Q: The extension doesn't show up in the `Editor` menu.**
138
140
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`.
140
142
141
143
**Q: The extension says it can't connect to the XPC service/helper.**
142
144
143
145
> A: If you have just updated the app from an old version, make sure you have restarted the XPC Service.
144
146
>
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.
146
148
>
147
149
> 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.
148
150
149
151
**Q: The extension complains that it has no access to the Accessibility API**
150
152
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.
154
154
155
155
**Q: I turned on real-time suggestions, but nothing happens**
156
156
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.
0 commit comments