Skip to content

Commit

Permalink
Pre-release 0.29.98
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 5, 2025
1 parent dfe1195 commit 8379cfa
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF5",
"green" : "0xF9",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x07",
"green" : "0x37",
"red" : "0x8A"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xB4",
"green" : "0xCF",
"red" : "0xFD"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"localizable" : true
}
}
5 changes: 3 additions & 2 deletions Core/Sources/HostApp/GeneralSettings/AppInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct AppInfoView: View {
@StateObject var viewModel: GitHubCopilotViewModel

@State var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
@State var automaticallyCheckForUpdates: Bool?

let store: StoreOf<General>

Expand Down Expand Up @@ -47,8 +48,8 @@ struct AppInfoView: View {
}
HStack {
Toggle(isOn: .init(
get: { updateChecker.getAutomaticallyChecksForUpdates() },
set: { updateChecker.setAutomaticallyChecksForUpdates($0) }
get: { automaticallyCheckForUpdates ?? updateChecker.getAutomaticallyChecksForUpdates() },
set: { updateChecker.setAutomaticallyChecksForUpdates($0); automaticallyCheckForUpdates = $0 }
)) {
Text("Automatically Check for Updates")
}
Expand Down
15 changes: 11 additions & 4 deletions Core/Sources/HostApp/GeneralSettings/CopilotConnectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct CopilotConnectionView: View {
var accountStatus: some View {
SettingsButtonRow(
title: "GitHub Account Status Permissions",
subtitle: "GitHub Connection: \(viewModel.status?.description ?? "Loading...")"
subtitle: "GitHub Account: \(viewModel.status?.description ?? "Loading...")"
) {
if viewModel.isRunningAction || viewModel.waitingForSignIn {
ProgressView().controlSize(.small)
Expand All @@ -34,7 +34,7 @@ struct CopilotConnectionView: View {
viewModel.cancelWaiting()
}
} else if viewModel.status == .notSignedIn {
Button("Login to GitHub") {
Button("Log in to GitHub") {
viewModel.signIn()
}
.alert(
Expand All @@ -56,17 +56,24 @@ struct CopilotConnectionView: View {
if viewModel.status == .ok || viewModel.status == .alreadySignedIn ||
viewModel.status == .notAuthorized
{
Button("Logout from GitHub") { viewModel.signOut()
Button("Log Out from GitHub") { viewModel.signOut()
viewModel.isSignInAlertPresented = false
}
}
}
}

var connection: some View {
SettingsSection(title: "Copilot Connection") {
SettingsSection(title: "Account Settings", showWarning: viewModel.status == .notAuthorized) {
accountStatus
Divider()
if viewModel.status == .notAuthorized {
SettingsLink(
url: "https://github.com/features/copilot/plans",
title: "Enable powerful AI features for free with the GitHub Copilot Free plan"
)
Divider()
}
SettingsLink(
url: "https://github.com/settings/copilot",
title: "GitHub Copilot Account Settings"
Expand Down
7 changes: 0 additions & 7 deletions Core/Sources/HostApp/GitHubCopilotViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ class GitHubCopilotViewModel: ObservableObject {
status = try await service.checkStatus()
version = try await service.version()
isRunningAction = false

if status != .ok, status != .notSignedIn {
toast(
"GitHub Copilot status is not \"ok\". Please check if you have a valid GitHub Copilot subscription.",
.error
)
}
} catch {
toast(error.localizedDescription, .error)
}
Expand Down
28 changes: 25 additions & 3 deletions Core/Sources/HostApp/SharedComponents/SettingsSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,36 @@ import SwiftUI

struct SettingsSection<Content: View, Footer: View>: View {
let title: String
let showWarning: Bool
@ViewBuilder let content: () -> Content
@ViewBuilder let footer: () -> Footer


init(title: String, showWarning: Bool = false, @ViewBuilder content: @escaping () -> Content, @ViewBuilder footer: @escaping () -> Footer) {
self.title = title
self.showWarning = showWarning
self.content = content
self.footer = footer
}

var body: some View {
VStack(alignment: .leading, spacing: 10) {
Text(title)
.bold()
.padding(.horizontal, 10)
if showWarning {
HStack{
Text("GitHub Copilot features are disabled. Please check your subscription to access them.")
.foregroundColor(Color("WarningForegroundColor"))
.padding(4)
Spacer()
}
.background(Color("WarningBackgroundColor"))
.overlay(
RoundedRectangle(cornerRadius: 3)
.stroke(Color("WarningStrokeColor"), lineWidth: 1)
)
}
VStack(alignment: .leading, spacing: 0) {
content()
}
Expand All @@ -22,8 +44,8 @@ struct SettingsSection<Content: View, Footer: View>: View {
}

extension SettingsSection where Footer == EmptyView {
init(title: String, @ViewBuilder content: @escaping () -> Content) {
self.init(title: title, content: content, footer: { EmptyView() })
init(title: String, showWarning: Bool = false, @ViewBuilder content: @escaping () -> Content) {
self.init(title: title, showWarning: showWarning, content: content, footer: { EmptyView() })
}
}

Expand All @@ -37,7 +59,7 @@ extension SettingsSection where Footer == EmptyView {
Divider()
SettingsLink(url: "https://example.com", title: "Example")
}
SettingsSection(title: "Advanced") {
SettingsSection(title: "Advanced", showWarning: true) {
SettingsLink(url: "https://example.com", title: "Example")
} footer: {
Text("Footer")
Expand Down
Binary file added Docs/macos-download-open-confirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ Use of the GitHub Copilot Xcode Extension is subject to [GitHub's Pre-Release Te

Updates can be downloaded and installed by the app.

1. A background item will be added to enable Copilot to start when Xcode is opened.
1. Open the `GitHub Copilot for Xcode` application (from the `Applications` folder). Accept the security warning.
<p align="center">
<img alt="Screenshot of MacOS download permission request" src="./Docs/macos-download-open-confirm.png" width="529" />
</p>


1. A background item will be added to enable Copilot to start when `GitHub Copilot for Xcode` is opened.
<p align="center">
<img alt="Screenshot of background item" src="./Docs/background-item.png" width="370" />
</p>
Expand All @@ -53,16 +59,16 @@ Use of the GitHub Copilot Xcode Extension is subject to [GitHub's Pre-Release Te
</p>

The `Xcode Source Editor Extension` permission needs to be enabled manually. Click
`Extension Permission` from the `Copilot for Xcode` settings to open the
`Extension Permission` from the `GitHub Copilot for Xcode` application settings to open the
System Preferences to the `Extensions` panel. Select `Xcode Source Editor`
and enable `GitHub Copilot`:

<p align="center">
<img alt="Screenshot of extension permission" src="./Docs/extension-permission.png" width="582" />
</p>

1. After granting the extension permission, please restart Xcode to ensure the
`Github Copilot` menu is available and not disabled under the Xcode `Editor`
1. After granting the extension permission, open Xcode. Verify that the
`Github Copilot` menu is available and enabled under the Xcode `Editor`
menu.
<br>
<p align="center">
Expand Down
33 changes: 29 additions & 4 deletions Server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"description": "Package for downloading @github/copilot-language-server",
"private": true,
"dependencies": {
"@github/copilot-language-server": "^1.245.0"
"@github/copilot-language-server": "^1.263.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public enum GitHubCopilotAccountStatus: String, Codable, CustomStringConvertible
case .alreadySignedIn:
return "Already Signed In"
case .maybeOk:
return "Maybe OK"
return "Unknown"
case .notAuthorized:
return "Not Authorized"
return "No Subscription"
case .notSignedIn:
return "Not Signed In"
case .ok:
return "OK"
return "Active"
case .failedToGetToken:
return "Failed to Get Token"
}
Expand Down
2 changes: 1 addition & 1 deletion Tool/Sources/WorkspaceSuggestionService/LineEdit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public struct LineEdit {
public let headEnd: String.Index
public let tailStart: String.Index

static let tailChars: Set<Character> = [")", "}", "]", "\"", "'", "`"]
static let tailChars: Set<Character> = [")", ">", "}", "]", "\"", "'", "`"]

/// The portion of the line to the left of the cursor.
public var head: String.SubSequence {
Expand Down

0 comments on commit 8379cfa

Please sign in to comment.