Skip to content

Commit baf6492

Browse files
committed
Pre-release 0.25.83
1 parent 1b8224d commit baf6492

File tree

9 files changed

+103
-87
lines changed

9 files changed

+103
-87
lines changed

Copilot for Xcode/Assets.xcassets/copilotIcon.imageset/Contents.json

Lines changed: 0 additions & 12 deletions
This file was deleted.
-41.1 KB
Binary file not shown.

Core/Sources/HostApp/GeneralView.swift

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct AppInfoView: View {
6767
var body: some View {
6868
VStack(alignment: .leading) {
6969
HStack(alignment: .center, spacing: 16) {
70-
Image("copilotIcon")
70+
Image(nsImage: NSImage(named: "AppIcon") ?? NSImage())
7171
.resizable()
7272
.frame(width: 110, height: 110)
7373
VStack(alignment: .leading) {
@@ -168,21 +168,20 @@ struct GeneralSettingsView: View {
168168
.padding(8)
169169

170170
Divider()
171-
HStack {
172-
VStack(alignment: .leading) {
173-
Text(StringConstants.extensionPermission)
174-
.font(.body)
175-
Text("""
176-
Check for GitHub Copilot in Xcode's Editor menu. \
177-
Restart Xcode if greyed out.
178-
""")
179-
.font(.footnote)
171+
Link(destination: URL(string: "x-apple.systempreferences:com.apple.ExtensionsPreferences")!) {
172+
HStack {
173+
VStack(alignment: .leading) {
174+
Text(StringConstants.extensionPermission)
175+
.font(.body)
176+
Text("""
177+
Check for GitHub Copilot in Xcode's Editor menu. \
178+
Restart Xcode if greyed out.
179+
""")
180+
.font(.footnote)
181+
}
182+
Spacer()
183+
Image(systemName: "chevron.right")
180184
}
181-
Spacer()
182-
Image(systemName: "chevron.right")
183-
}
184-
.onTapGesture {
185-
shouldPresentExtensionPermissionAlert = true
186185
}
187186
.foregroundStyle(.primary)
188187
.padding(.horizontal, 8)

Core/Sources/SuggestionWidget/ChatPanelWindow.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ final class ChatPanelWindow: NSWindow {
4444
.transient,
4545
.fullScreenPrimary,
4646
.fullScreenAllowsTiling,
47-
.canJoinAllSpaces
4847
]
4948
hasShadow = true
5049
contentView = NSHostingView(

Server/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"description": "Package for downloading @github/copilot-language-server",
55
"private": true,
66
"dependencies": {
7-
"@github/copilot-language-server": "^1.237.0"
7+
"@github/copilot-language-server": "^1.238.0"
88
}
99
}

Tool/Sources/GitHubCopilotService/LanguageServer/GitHubCopilotService.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ public class GitHubCopilotBaseService {
227227
in: .userDomainMask
228228
).first?.appendingPathComponent(
229229
Bundle.main
230-
.object(forInfoDictionaryKey: "APPLICATION_SUPPORT_FOLDER") as! String
230+
.object(forInfoDictionaryKey: "APPLICATION_SUPPORT_FOLDER") as? String
231+
?? "com.github.CopilotForXcode"
231232
) else {
232233
throw CancellationError()
233234
}

Tool/Sources/SharedUIComponents/AsyncCodeBlock.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ public struct AsyncCodeBlock: View {
154154
.fixedSize()
155155
}
156156

157+
@ViewBuilder
158+
func lineBackgroundShape(_ multiLine: Bool) -> some View {
159+
let color = currentLineBackgroundColor ?? backgroundColor
160+
switch multiLine {
161+
case true: HalfCapsule().fill(color)
162+
case false: Rectangle().fill(color)
163+
}
164+
}
165+
157166
@ScaledMetric var iconPadding: CGFloat = 9.0
158167
@ScaledMetric var iconSpacing: CGFloat = 6.0
159168
@ScaledMetric var optionPadding: CGFloat = 0.5
@@ -199,9 +208,7 @@ public struct AsyncCodeBlock: View {
199208
}
200209
}
201210
.frame(height: lineHeight)
202-
.background(
203-
HalfCapsule().fill(currentLineBackgroundColor ?? backgroundColor)
204-
)
211+
.background(lineBackgroundShape(lines.count > 1))
205212
.padding(.leading, firstLineIndent)
206213
.onHover { hovering in
207214
guard hovering != isHovering else { return }

Tool/Sources/SharedUIComponents/CopilotIntroSheet.swift

Lines changed: 72 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct CopilotIntroItem: View {
2525
image
2626
.resizable()
2727
.renderingMode(.template)
28-
.foregroundColor(Color(red: 0.0353, green: 0.4118, blue: 0.8549))
28+
.foregroundColor(.blue)
2929
.scaledToFit()
3030
.frame(width: 28, height: 28)
3131
VStack(alignment: .leading, spacing: 5) {
@@ -39,6 +39,66 @@ struct CopilotIntroItem: View {
3939
}
4040
}
4141

42+
struct CopilotIntroContent: View {
43+
let hideIntro: Binding<Bool>
44+
let continueAction: () -> Void
45+
46+
var body: some View {
47+
VStack {
48+
let appImage = if let nsImage = NSImage(named: "AppIcon") {
49+
Image(nsImage: nsImage)
50+
} else {
51+
Image(systemName: "app")
52+
}
53+
appImage
54+
.resizable()
55+
.scaledToFit()
56+
.frame(width: 64, height: 64)
57+
.padding(.bottom, 24)
58+
Text("Welcome to Copilot for Xcode!")
59+
.font(.title.bold())
60+
.padding(.bottom, 38)
61+
62+
VStack(alignment: .leading, spacing: 20) {
63+
CopilotIntroItem(
64+
imageName: "CopilotLogo",
65+
heading: "In-line Code Suggestions",
66+
text: "Copilot's code suggestions and text completion now available in Xcode. Press Tab ⇥ to accept a suggestion."
67+
)
68+
69+
CopilotIntroItem(
70+
systemImage: "option",
71+
heading: "Full Suggestion",
72+
text: "Press Option ⌥ key to display the full suggestion. Only the first line of suggestions are shown inline."
73+
)
74+
75+
CopilotIntroItem(
76+
imageName: "GitHubMark",
77+
heading: "GitHub Context",
78+
text: "Copilot utilizes project context to deliver smarter code suggestions relevant to your unique codebase."
79+
)
80+
}
81+
.padding(.bottom, 64)
82+
83+
VStack(spacing: 8) {
84+
Button(action: continueAction) {
85+
Text("Continue")
86+
.padding(.horizontal, 80)
87+
.padding(.vertical, 6)
88+
}
89+
.buttonStyle(.borderedProminent)
90+
91+
Toggle("Don't show again", isOn: hideIntro)
92+
.toggleStyle(.checkbox)
93+
}
94+
}
95+
.padding(.horizontal, 56)
96+
.padding(.top, 48)
97+
.padding(.bottom, 16)
98+
.frame(width: 560)
99+
}
100+
}
101+
42102
public struct CopilotIntroSheet<Content: View>: View {
43103
let content: Content
44104
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
@@ -48,58 +108,13 @@ public struct CopilotIntroSheet<Content: View>: View {
48108

49109
public var body: some View {
50110
content.sheet(isPresented: $isPresented) {
51-
VStack {
52-
Image(nsImage: NSImage(named: "AppIcon") ?? NSImage())
53-
.resizable()
54-
.scaledToFit()
55-
.frame(width: 64, height: 64)
56-
.padding(.bottom, 24)
57-
Text("Welcome to Copilot for Xcode!")
58-
.font(.title)
59-
.padding(.bottom, 45)
60-
61-
VStack(alignment: .leading, spacing: 25) {
62-
CopilotIntroItem(
63-
imageName: "CopilotLogo",
64-
heading: "In-line Code Suggestions",
65-
text: "Copilot's code suggestions and text completion now available in Xcode. Just press Tab ⇥ to accept a suggestion."
66-
)
67-
68-
CopilotIntroItem(
69-
systemImage: "option",
70-
heading: "Full Suggestion",
71-
text: "Press Option ⌥ key to display the full suggestion. Only the first line of suggestions are shown inline."
72-
)
73-
74-
CopilotIntroItem(
75-
imageName: "GitHubMark",
76-
heading: "GitHub Context",
77-
text: "Copilot utilizes GitHub and project context to deliver smarter completions and personalized code suggestions relevant to your unique codebase."
78-
)
79-
}
80-
81-
Spacer()
82-
83-
VStack(spacing: 8) {
84-
Button(action: { isPresented = false }) {
85-
Text("Continue")
86-
.padding(.horizontal, 80)
87-
.padding(.vertical, 6)
88-
}
89-
.buttonStyle(.borderedProminent)
90-
91-
Toggle("Don't show again", isOn: $hideIntro)
92-
.toggleStyle(.checkbox)
93-
}
111+
CopilotIntroContent(hideIntro: $hideIntro) {
112+
isPresented = false
94113
}
95-
.padding(EdgeInsets(top: 50, leading: 50, bottom: 16, trailing: 50))
96-
.frame(width: 560, height: 528)
97114
}
98115
.task {
99-
let neverShown = introLastShownVersion.isEmpty
100-
isPresented = neverShown || !hideIntro
101-
if isPresented {
102-
hideIntro = neverShown ? true : hideIntro // default to hidden on first time
116+
if hideIntro == false {
117+
isPresented = true
103118
introLastShownVersion = appVersion
104119
}
105120
}
@@ -111,3 +126,10 @@ public extension View {
111126
CopilotIntroSheet(content: self)
112127
}
113128
}
129+
130+
131+
// MARK: - Preview
132+
@available(macOS 14.0, *)
133+
#Preview(traits: .sizeThatFitsLayout) {
134+
CopilotIntroContent(hideIntro: .constant(false)) { }
135+
}

0 commit comments

Comments
 (0)