diff --git a/.swiftformat b/.swiftformat deleted file mode 100644 index a57b933..0000000 --- a/.swiftformat +++ /dev/null @@ -1,56 +0,0 @@ ---allman false ---beforemarks ---binarygrouping 4,8 ---categorymark "MARK: %c" ---classthreshold 0 ---closingparen balanced ---commas always ---conflictmarkers reject ---decimalgrouping 3,6 ---elseposition same-line ---enumthreshold 0 ---exponentcase lowercase ---exponentgrouping disabled ---fractiongrouping disabled ---fragment false ---funcattributes preserve ---guardelse auto ---header ignore ---hexgrouping 4,8 ---hexliteralcase uppercase ---ifdef no-indent ---importgrouping testable-bottom ---indent 4 ---indentcase false ---lifecycle ---linebreaks lf ---maxwidth 100 ---modifierorder ---nospaceoperators ...,..< ---nowrapoperators ---octalgrouping 4,8 ---operatorfunc spaced ---patternlet hoist ---ranges spaced ---self remove ---selfrequired ---semicolons inline ---shortoptionals always ---smarttabs enabled ---stripunusedargs unnamed-only ---structthreshold 0 ---tabwidth unspecified ---trailingclosures ---trimwhitespace always ---typeattributes preserve ---varattributes preserve ---voidtype void ---wraparguments before-first ---wrapcollections disabled ---wrapparameters before-first ---xcodeindentation disabled ---yodaswap always - ---enable isEmpty - ---exclude Pods,**/Generated diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md deleted file mode 100644 index 877cdd9..0000000 --- a/DEVELOPMENT.md +++ /dev/null @@ -1,70 +0,0 @@ -# Development - -## Prerequisites - -Requires Node installed and `npm` available on your system path, e.g. - -```sh -sudo ln -s `which npm` /usr/local/bin -sudo ln -s `which node` /usr/local/bin -``` - -For context, this is used by an Xcode run script as part of the build. Run -scripts use a very limited path to resolve commands. - -## Targets - -### Copilot for Xcode - -Copilot for Xcode is the host app containing both the XPCService and the editor extension. It provides the settings UI. - -### EditorExtension - -As its name suggests, the Xcode source editor extension. Its sole purpose is to forward editor content to the XPCService for processing, and update the editor with the returned content. Due to the sandboxing requirements for editor extensions, it has to communicate with a trusted, non-sandboxed XPCService (CommunicationBridge and ExtensionService) to bypass the limitations. The XPCService service name must be included in the `com.apple.security.temporary-exception.mach-lookup.global-name` entitlements. - -### ExtensionService - -The `ExtensionService` is a program that operates in the background. All features are implemented in this target. - -### CommunicationBridge - -It's responsible for maintaining the communication between the Copilot for Xcode/EditorExtension and ExtensionService. - -### Core and Tool - -Most of the logics are implemented inside the package `Core` and `Tool`. - -- The `Service` contains the implementations of the ExtensionService target. -- The `HostApp` contains the implementations of the Copilot for Xcode target. - -## Building and Archiving the App - -1. Update the xcconfig files, bridgeLaunchAgent.plist, and Tool/Configs/Configurations.swift. -2. Build or archive the Copilot for Xcode target. -3. If Xcode complains that the pro package doesn't exist, please remove the package from the project. - -## Testing Source Editor Extension - -Just run both the `ExtensionService`, `CommunicationBridge` and the `EditorExtension` Target. Read [Testing Your Source Editor Extension](https://developer.apple.com/documentation/xcodekit/testing_your_source_editor_extension) for more details. - -## SwiftUI Previews - -Looks like SwiftUI Previews are not very happy with Objective-C packages when running with app targets. To use previews, please switch schemes to the package product targets. - -## Unit Tests - -To run unit tests, just run test from the `Copilot for Xcode` target. - -For new tests, they should be added to the `TestPlan.xctestplan`. - -## Code Style - -We use SwiftFormat to format the code. - -The source code mostly follows the [Ray Wenderlich Style Guide](https://github.com/raywenderlich/swift-style-guide) very closely with the following exception: - -- Use the Xcode default of 4 spaces for indentation. - -## App Versioning - -The app version and all targets' version in controlled by `Version.xcconfig`. diff --git a/Server/package-lock.json b/Server/package-lock.json deleted file mode 100644 index 88a089c..0000000 --- a/Server/package-lock.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@github/copilot-xcode", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@github/copilot-xcode", - "version": "0.0.1", - "dependencies": { - "@github/copilot-language-server": "^1.245.0" - } - }, - "node_modules/@github/copilot-language-server": { - "version": "1.245.0", - "resolved": "https://registry.npmjs.org/@github/copilot-language-server/-/copilot-language-server-1.245.0.tgz", - "integrity": "sha512-K/PSxLMQFhnM8CIhL0mF/FAEzB2EYqOEu0Ai0gvFEy+fMl3FvhxFkagb6w1qaQ0dQJSY5qExT88sABn3wDyHiA==", - "bin": { - "copilot-language-server": "dist/language-server.js" - } - } - } -} diff --git a/Server/package.json b/Server/package.json deleted file mode 100644 index 68b97a1..0000000 --- a/Server/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@github/copilot-xcode", - "version": "0.0.1", - "description": "Package for downloading @github/copilot-language-server", - "private": true, - "dependencies": { - "@github/copilot-language-server": "^1.245.0" - } -} diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md deleted file mode 100644 index 98fdca7..0000000 --- a/TROUBLESHOOTING.md +++ /dev/null @@ -1,67 +0,0 @@ -# Troubleshooting for Copilot for Xcode - -If you are having trouble with Copilot for Xcode follow these steps to resolve -common issues: - -1. Check for updates and restart Xcode. Ensure that Copilot for Xcode has the - [latest release](https://github.com/github/CopilotForXcode/releases/latest) - by click `Check for Updates` in the settings or under the status menu. After - updating, restart Xcode. - -2. Ensure that the Copilot for Xcode extension is enabled. Open Xcode and go to - the top menu bar and open the `Editor` menu. If there is no `GitHub Copilot` - menu is under `Editor` then [extension permission](#extension-permission) - needs to be enabled. If the `GitHub Copilot` menu is shown but grayed out, - then Xcode needs to be restarted to enable the extension. - -3. Need more help? If these steps don't resolve the issue, please [open an - issue](https://github.com/github/CopilotForXcode/issues/new/choose). Make - sure to [include logs](#logs) and any other relevant information. - -## Extension Permission - -GitHub Copilot for Xcode is an Xcode Source Editor extension and requires the -extension to be enabled. In the Copilot for Xcode settings, clicking `Extension -Permission` will open the System Settings to the Extensions page where `GitHub -Copilot` can be enabled under `Xcode Source Editor`. - -Or you can navigate to the permission manually depending on your OS version: - -| macOS | Location | -| :--- | :--- | -| 15 | System Settings > General > Login Items > Extensions > Xcode Source Editor | -| 13 & 14 | System Settings > Privacy & Security > Extensions > Xcode Source Editor | -| 12 | System Preferences > Extensions | - -## Accessibility Permission - -GitHub Copilot for Xcode requires the accessibility permission to receive -real-time updates from the active Xcode editor. [The XcodeKit -API](https://developer.apple.com/documentation/xcodekit) -enabled by the Xcode Source Editor extension permission only provides -information when manually triggered by the user. In order to generate -suggestions as you type, the accessibility permission is used read the -Xcode editor content in real-time. - -The accessibility permission is also used to accept suggestions when `tab` is -pressed. - -The accessibility permission is __not__ used to read or write to any -applications besides Xcode. There are no granular options for the permission, -but you can audit the usage in this repository: search for `CGEvent` and `AX`*. - -Enable in System Settings under `Privacy & Security` > `Accessibility` > -`GitHub Copilot for Xcode Extension` and turn on the toggle. - -## Logs - -Logs can be found in `~/Library/Logs/GitHubCopilot/` the most recent log file -is: - -``` -~/Library/Logs/GitHubCopilot/github-copilot-for-xcode.log -``` - -To enable verbose logging, open the GitHub Copilot for Xcode settings and enable -`Verbose Logging` in the `Advanced` tab. After enabling verbose logging, restart -Copilot for Xcode for the change to take effect.