Giter Site home page Giter Site logo

intitni / copilotforxcode Goto Github PK

View Code? Open in Web Editor NEW
7.0K 74.0 329.0 13.38 MB

The missing GitHub Copilot, Codeium and ChatGPT Xcode Source Editor Extension

License: Other

Swift 99.93% Makefile 0.03% Objective-C 0.04%
copilot xcode xcode-extension xcode-extensions macos chatgpt codeium github-copilot githubcopilot openai

copilotforxcode's Introduction

copilotforxcode's People

Contributors

ast3150 avatar eltociear avatar gewill avatar intitni avatar moverholt avatar snq-2001 avatar ss18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

copilotforxcode's Issues

Unavailable Node.js installed with nodenv(Anyenv)

My node is installed by nodenv(Anyenv), and install CopilotForXcode with brew cask.

which node return /Users/username/.anyenv/envs/nodenv/shims/node.
I write path to Path to Node, then show Server unavailable, please make sure installed Node.

refresh did not change error message.
so I tried to install Node with brew, rewrite Path to Node to /opt/homebrew/Cellar/node/19.8.1/bin/node is fixed.

スクリーンショット 2023-03-21 12 36 54

env

  • node v19.8.1
  • CopilotForXcode 0.8.6

Expected behavior

it maybe my environment, but I want to be able to specify Node with nodenv as well.

Prompt doesn't show up

I followed the instructions and turned on the accessibility in privacy and security. The circular button shows up in my Xcode, but there's no prompt on the right of the button.
https://ibb.co/c3yh8hP

Unable to type text in GPT chat

The window for entering text when I choose to chat with current selection does not allow me to enter and text. Strangely, I can past text into the window, but I get the Mac error sound when I try selecting it and typing.

error

Xcode extension not visible in System Preferences

I am using macOS Monterey and can't see the Xcode extension in "System Preferences > Extensions" — in fact, there is nothing about Xcode anywhere in that pane (I am not on Ventura, so I think I'm looking in the right place).

The rest of the app is set up correctly, I think:
Screen Shot 2023-03-10 at 13 45 36

Is there a way for me to install the extension manually?

XPC Service hits 100% CPU and stops responding

from maintainer: If the app is freezing for you, please check the 0.8.5 release

Hi,

I'm still trying to get this to work. Suggestions start appearing, but immediately the XPC service hits 100% CPU and completely stops responding.

This happens every single time, I have no idea why. Any ideas?
Screenshot 2023-03-11 at 2 21 18 pm
Screenshot 2023-03-11 at 2 24 40 pm

Xcode autocomplete broken

First of all, thanks very much for putting this together! It's been very helpful to me and I use it daily 🙌 .

I'm finding after installing this plugin, Xcode's auto complete breaks and I can no longer use it. The autocomplete appears for a second and then disappears

Screen.Recording.2023-03-25.at.17.21.51.mov

Consistent CPU usage in the background

Hi! I took a peek at Activity Monitor when I hadn’t been using Xcode for several hours and noticed that CopilotForXcodeExtensionService was consistently using ~5% CPU.

Here’s a sample of the process if that helps: Sample of CopilotForXcodeExtensionService.txt
And an Instruments trace: CopilotForXcode.trace.zip

It looks like most of the processing is happening inside SwiftUI but it would be great if there was a way to reduce or eliminate this CPU usage to improve battery life.

Error message "Couldn't communicate with a helper application" when setting up Copilot for Xcode

I am encountering an error message when trying to set up Copilot for Xcode. Specifically, I receive the message "Couldn't communicate with a helper application" in Copilot for Xcode or whenever I attempt any action within the Xcode -> Editor -> Copilot menu

I have tried using both Xcode 14.2 and 14.3, which I installed via Xcodes. I have also attempted to reinstall both Xcode and Copilot for Xcode multiple times, but the error message persists.

The Node path is setup correctly to /opt/homebrew/bin/node.

I'm using Copilot for Xcode 0.8.6 on the latest macOS 13.2.1

I am hoping to receive guidance on how to troubleshoot this issue and successfully set up Copilot for use in Xcode.

Any help or advice would be greatly appreciated. Thank you.

Screenshot 2023-03-23 at 22 07 43
Screenshot 2023-03-23 at 22 08 22

Prevent real time suggestions blocking editor

  • Make the request interval shorter.
  • The first request will trigger the XPC Service to provide a suggestion, but won't wait for it to finish. Instead, if will return immediately.
  • The XPCService will cache the suggestion, if there is a future request asking for suggestions for the same code and cursor position, return the cache. Otherwise, treat it as a first request.

Accept button on floating window doesn't work

I'm experiencing a weird problem that on the suggestion floating window, the Accept button doesn't work. When I click on it, nothing happens. The suggestion isn't applied to the code, and the floating window doesn't disappear either.

スクリーンショット 2023-03-24 2 31 44

The reject button works as expected that no code changes and the floating window disappears.

I can accept it from Menu bar though

スクリーンショット 2023-03-24 2 32 40

But since it's too inconvenient so I've set a key binding to accept it as a workaround.

Is there anybody having the same problem?

My environment:

  • Chip: M1 Max
  • macOS: 13.2.1(22D68)
  • Xcode: 14.2 (14C18)
  • Copilot for Xcode: 0.8.6 (49)

Server unavailable when Node is installed

Calling which node return /usr/local/bin/node
But when I try use Copilot For Xcode, see error Server unavailable, please make sure you have installed Node

Screenshot 2023-03-20 at 13 50 25

What wrong?

Improved install instructions

Settings.app is now called "System Settings.app". Perhaps change instructions in the README to:

"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". An entry called "Xcode source Editor" with subtext "copilot" should be there. Click it and tick "Copilot".

App stopped working

Screenshot 2023-02-20 at 11 08 09

I have installed node v19.6.1. I have tried to reinstall this app via brew cask, and manual installation and I still have this error. Refresh button does nothing

Not working in full screen mode

After update to 0.8.5 version widget stoped following Xcode editor when I enter full screen mode, it just stayed on Home Screen.

Support auto update

I hope that the version downloaded from GitHub can also support automatic updates, like Spark ?

When requesting "Explain" I get an OpenAI error message: "You didn't provide an API key"

When I request "Explain" for suggestions I get this error message in the widget:

"You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys."

I saw in the install notes that I needed to have an OpenAI API Key and created one but it was never requested during the install process and I can find nowhere in the app or Xcode to enter it.

Light mode support

Right now the app always uses dark UI. For those of us who prefer light mode would it be possible to add a toggle that switches the UI between light, dark, and matching the system setting?

Extension gets stuck in Floating Widget mode

When using the Floating Widget mode, the extension gets stuck after the first suggestion appears. This happens whether real-time suggestion is enabled or disabled.

record.mov

Suggestions in comment mode work fine.

Key bindings for most common commands?

Having just installed and configured the CoPilotForXcode extension all works great but my experience is that I had to always select the menu options to get CoPilot suggestions/actions (maybe I did not setup everything correctly??).

Could creating some default keybindings help with this?
For some, keybindings are a very personal choice as they are often customised but I found these worked pretty well and did not conflict with any existing/standard Xcode keybindings.

CoPilot -> Get Suggestions: ⌥?
CoPilot -> Accept Suggestion: ⌥}
CoPilot -> Reject Suggestion: ⌥{
CoPilot -> Next Suggestion: ⌥>
CoPilot -> Previous Suggestion: ⌥<

Essentially using ⌥⇧ as the "access" key combination for all bindings.

Xcode-CoPilot_KeyBindings_Settings

Xcode-CoPilot_KeyBindings

A floating window for suggestions?

Instead of adding contents in the editor for suggestions, could we use a macOS window for suggestions?

Code in the editor seems to be super disturbing.

Build failed due to incorrect path of 'Main.storyboard'

Thanks for your excellent work. It's fascinating.

While building this project, I found the storyboard may still be in your trash then build failed.

		C81291D52994FE6900196E12 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = ../../../../.Trash/Main.storyboard; sourceTree = "<group>"; };

Thanks!

Quick thread to thank you very much for all the updates, particularly floating window and also the possibility of some chatGPT integration. It certainly makes a everything just that little bit easier. Have you considered placing a donate or buy me a coffee button for those looking to pass on some monetary thanks?

CoPilot status "Not authorized", but unclear what that means

Hello, I just successfully installed Copilot (didn't have success with earlier versions), however, despite having entered the code for Copilot and having authorized the extension on GitHub, I see "not authorized".
I currently don't pay for CoPilot and unfortunately my trial expired (despite having never used it). So it might be that. But paying $10 for just finding out if it's this, or something else (and waiting for a fix, and losing these $10 for it) is no good option in my opinion.

Can you make clear what this message means? Maybe also in the FAQ?

Copilot for Xcode GUI scrolling [BUG]

The current GUI app has a scrollable view for the entire window which causes content to scroll behind the app's Close/Minimise/Full-Screen buttons. This is not usual behaviour for a macOS app.

To re-create the bug...

  1. Resize the GUI height to be small enough for content to go beyond the bottom of the app window.
  2. Scroll the view
  3. Content at the top of the GUI goes behind the app Close/Minimise/Full-Screen buttons.

image

Add buttons to GUI to open relevant sections of the System Settings preferences panel [ENHANCEMENT]

Add button to open System Settings - Accessibility API

The installation intructions for granting permissions requires that the app needs Accessibility permissions to work properly.
Suggestion to simplify access to the correct setting in System Settings by adding a button/control on the GUI to run a bash command to open System Settings on the correct panel.

On macOS Ventura (and I think Monterrey too) the command is:

open "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"

Add button to open System Settings - Xcode Source Editor Extension

The installation intructions for enabling the extension requires that the Copilot is added as an Xcode extension.
Suggestion to simplify access to the correct setting in System Settings by adding a button/control on the GUI to run a bash command to open System Settings on the correct panel.

On macOS Ventura the command is:

open "x-apple.systempreferences:com.apple.ExtensionsPreferences"  

NOTE: I don't have a macOS Monterrey install, these steps should be checked & verified.
On macOS Monterrey, access to the Extensions preference panel is not supported by URLScheme, may need to use AppleScript instead:

tell application "System Preferences"
	activate
	set the current pane to pane id "com.apple.preferences.extensions"
end tell

or using bash

osascript -e 'tell Application "System Preferences"' -e 'activate' -e 'set the current pane to pane id "com.apple.preferences.extensions"' -e 'end tell'

List of methods for opening System Settings obtained from bvanpeski - SystemPreferences

"Cannot find helper application"

I have used mdfind in terminal to remove all instances of the app then reinstalled with brew and cannot seem to get xcode to find the helper application.

I get no errors under 'Copilot' in the app. The XPCService Version is listed and the status reads OK. I can also see the service running as per F.A.Q.

Any other suggestions?

Note: Somewhere it's remembering I've had the app installed previously as Input Monitoring remains selected, so this could be related. i.e Xcode is looking for another helper? Maybe?

Thank you in advance for your assistance and for all your work making this possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.