Skip to content

Commit 0f04557

Browse files
committed
Merge tag '0.14.0' into develop
2 parents 850cab3 + 6943df0 commit 0f04557

11 files changed

Lines changed: 166 additions & 71 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Bug Report
2+
description: File a bug report
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
assignees:
6+
- intitni
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to fill out this bug report!
12+
- type: checkboxes
13+
id: before-reporting
14+
attributes:
15+
label: Before Reporting
16+
description: Before reporting the bug, we suggestion that you first refer to the [FAQ](https://github.com/intitni/CopilotForXcode/issues/65) to check if it may address your issue. And search for existing issues to avoid duplication.
17+
options:
18+
- label: I have checked FAQ, and there is no solution to my issue
19+
required: true
20+
- label: I have searched the existing issues, and there is no existing issue for my issue
21+
required: true
22+
- type: textarea
23+
id: what-happened
24+
attributes:
25+
label: What happened?
26+
description: Also tell us, what did you expect to happen?
27+
placeholder: Tell us what you see!
28+
value: "A bug happened!"
29+
validations:
30+
required: true
31+
- type: textarea
32+
id: reproduce
33+
attributes:
34+
label: How to reproduce the bug.
35+
description: If possible, please provide the steps to reproduce the bug.
36+
placeholder: "1. *****\n2.*****"
37+
value: "It just happens!"
38+
- type: textarea
39+
id: logs
40+
attributes:
41+
label: Relevant log output
42+
description: If it's a crash, please provide the crash report. You can find it in the Console.app.
43+
render: shell
44+
- type: input
45+
id: mac-version
46+
attributes:
47+
label: macOS version
48+
- type: input
49+
id: xcode-version
50+
attributes:
51+
label: Xcode version
52+
- type: input
53+
id: copilot-for-xcode-version
54+
attributes:
55+
label: Copilot for Xcode version
56+
- type: input
57+
id: node-version
58+
attributes:
59+
label: Node version
60+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Feature Request
2+
description: Request a feature
3+
title: "[Enhancement]: "
4+
labels: ["enhancement"]
5+
assignees:
6+
- intitni
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to fill out this feature request!
12+
- type: checkboxes
13+
id: before-reporting
14+
attributes:
15+
label: Before Requesting
16+
description: Before requesting the feature, we suggestion that you first search for existing issues to avoid duplication.
17+
options:
18+
- label: I have searched the existing issues, and there is no existing issue for my feature request
19+
required: true
20+
- type: textarea
21+
id: what-feature
22+
attributes:
23+
label: What feature do you want?
24+
description: Please describe the feature you want.
25+
placeholder: Tell us what you want!
26+
value: "I want a feature!"
27+
validations:
28+
required: true

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/help-wanted.md

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Help Wanted
2+
description: Ask for help from the developer and the community
3+
title: "[Help Wanted]: "
4+
labels: ["help wanted"]
5+
body:
6+
- type: checkboxes
7+
id: before-reporting
8+
attributes:
9+
label: Before Reporting
10+
description: Before asking for help, we suggestion that you first refer to the [FAQ](https://github.com/intitni/CopilotForXcode/issues/65) to check if it may address your issue. And search for existing issues to avoid duplication.
11+
options:
12+
- label: I have checked FAQ, and there is no solution to my issue
13+
required: true
14+
- label: I have searched the existing issues, and there is no existing issue for my issue
15+
required: true
16+
- type: textarea
17+
id: what-help
18+
attributes:
19+
label: Describe your issue
20+
description: Please describe the help you want.
21+
placeholder: My issue is...
22+
value: "I want help!"
23+
validations:
24+
required: true

Core/Sources/PromptToCodeService/OpenAIPromptToCodeAPI.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ final class OpenAIPromptToCodeAPI: PromptToCodeAPI {
6262
6363
# Code
6464
65-
```
65+
```\(language.rawValue)
6666
\(code)
6767
```
6868
"""
@@ -75,10 +75,16 @@ final class OpenAIPromptToCodeAPI: PromptToCodeAPI {
7575
return .init { continuation in
7676
Task {
7777
var content = ""
78+
var extracted = extractCodeAndDescription(from: content)
7879
do {
7980
for try await fragment in stream {
8081
content.append(fragment)
81-
continuation.yield(extractCodeAndDescription(from: content))
82+
extracted = extractCodeAndDescription(from: content)
83+
if !content.isEmpty, extracted.code.isEmpty {
84+
continuation.yield((code: content, description: ""))
85+
} else {
86+
continuation.yield(extracted)
87+
}
8288
}
8389
continuation.finish()
8490
} catch {
@@ -134,3 +140,4 @@ final class OpenAIPromptToCodeAPI: PromptToCodeAPI {
134140
return (code, description)
135141
}
136142
}
143+

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
![Screenshot](/Screenshot.png)
44

5-
Copilot for Xcode is an Xcode Source Editor Extension that provides Github Copilot and ChatGPT support for Xcode. It uses the LSP provided through [Copilot.vim](https://github.com/github/copilot.vim/tree/release/copilot/dist) to generate suggestions and displays them as comments or in a separate window.
6-
7-
Thanks to [LSP-copilot](https://github.com/TerminalFi/LSP-copilot) for showing the way to interact with Copilot. And thanks to [LanguageClient](https://github.com/ChimeHQ/LanguageClient) for the Language Server Protocol support in Swift.
5+
Copilot for Xcode is an Xcode Source Editor Extension that provides GitHub Copilot and ChatGPT support for Xcode.
86

97
<a href="https://www.buymeacoffee.com/intitni" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
108

@@ -27,7 +25,7 @@ Thanks to [LSP-copilot](https://github.com/TerminalFi/LSP-copilot) for showing t
2725
- [Granting Permissions to the App](#granting-permissions-to-the-app)
2826
- [Managing `CopilotForXcodeExtensionService.app`](#managing-copilotforxcodeextensionserviceapp)
2927
- [Update](#update)
30-
- [Commands](#commands)
28+
- [Feature](#feature)
3129
- [Key Bindings](#key-bindings)
3230
- [Prevent Suggestions Being Committed](#prevent-suggestions-being-committed)
3331
- [Limitations](#limitations)
@@ -123,10 +121,20 @@ If you are upgrading from a version lower than **0.7.0**, please run `Copilot fo
123121

124122
If you find that some of the features are no longer working, please first try regranting permissions to the app.
125123

126-
## Commands
124+
## Feature
127125

128126
### Suggestion
129127

128+
GitHub Copilot can provide real-time code suggestions based on the files you have opened. It utilizes its knowledge of your codebase to generate helpful suggestions.
129+
130+
If you're working on a company project and don't want the suggestion feature to be triggered, you can globally disable it and choose to enable it only for specific projects.
131+
132+
Whenever you stop typing for a few milliseconds, the app will automatically fetch suggestions for you, you can cancel this by clicking the mouse, or pressing **Escape** or the **arrow keys**.
133+
134+
*: If a file is already open before the helper app launches, you will need to switch to those files in order to send the open file notification.
135+
136+
#### Commands
137+
130138
- Get Suggestions: Get suggestions for the editing file at the current cursor position.
131139
- Next Suggestion: If there is more than one suggestion, switch to the next one.
132140
- Previous Suggestion: If there is more than one suggestion, switch to the previous one.
@@ -136,11 +144,15 @@ If you find that some of the features are no longer working, please first try re
136144
- 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.
137145
- Prefetch Suggestions: Call only by Copilot for Xcode. In the background, Copilot for Xcode will occasionally run this command to prefetch real-time suggestions.
138146

139-
**About real-time suggestions**
147+
### Chat
140148

141-
Whenever you stop typing for a few milliseconds, the app will automatically fetch suggestions for you, you can cancel this by clicking the mouse, or pressing **Escape** or the **arrow keys**.
149+
This feature is powered by ChatGPT. Please ensure that you have set up your OpenAI account before using it.
142150

143-
### Chat
151+
There are currently two tabs in the chat panel: one is available globally across Xcode, and the other is only available in the current file.
152+
153+
You can detach the chat panel by simply dragging it away. Once detached, the chat panel will remain visible even if Xcode is inactive. To re-attach it to the widget, click the message bubble button located next to the circular widget.
154+
155+
#### Commands
144156

145157
- Chat with Selection: Open a chat window, if there is a selection, the selected code will be added to the prompt.
146158
- Explain Selection: Open a chat window and explain the selected code.
@@ -166,13 +178,15 @@ If you need to end a plugin, you can just type
166178

167179
### Prompt to Code
168180

169-
- Prompt to Code: Open a prompt to code window, where you can use natural language to write or edit selected code.
181+
Refactor selected code or write new code using natural language.
170182

171-
Prompt to code commands are not available in comment mode.
183+
#### Commands
184+
185+
- Prompt to Code: Open a prompt to code window, where you can use natural language to write or edit selected code.
172186

173187
### Custom Commands
174188

175-
You can create custom commands that runs Chat and Prompt to Code with custom prompts. This commands can be accessed from the Xcode menu bar and the context menu of the circular widget.
189+
You can create custom commands that run Chat and Prompt to Code with personalized prompts. These commands are easily accessible from both the Xcode menu bar and the context menu of the circular widget.
176190

177191
## Key Bindings
178192

@@ -217,3 +231,10 @@ fi
217231
## License
218232

219233
MIT.
234+
235+
## What's More
236+
237+
The app uses the LSP provided through [Copilot.vim](https://github.com/github/copilot.vim/tree/release/copilot/dist) to generate suggestions and displays them as comments or in a separate window.
238+
239+
Thanks to [LSP-copilot](https://github.com/TerminalFi/LSP-copilot) for showing the way to interact with GitHub Copilot. And thanks to [LanguageClient](https://github.com/ChimeHQ/LanguageClient) for the Language Server Protocol support in Swift.
240+

Screenshot.png

-160 KB
Loading

Version.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
APP_VERSION = 0.13.4
2-
APP_BUILD = 110
1+
APP_VERSION = 0.14.0
2+
APP_BUILD = 130

0 commit comments

Comments
 (0)