Skip to content

Commit 69d18ad

Browse files
committed
Pre-release 0.25.84
1 parent baf6492 commit 69d18ad

File tree

11 files changed

+251
-81
lines changed

11 files changed

+251
-81
lines changed

Copilot for Xcode/App.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct CopilotForXcodeApp: App {
2727
.onAppear {
2828
UserDefaults.setupDefaultSettings()
2929
}
30-
.environment(\.updateChecker, UpdateChecker(hostBundle: Bundle.main))
3130
.copilotIntroSheet()
3231
}
3332
}

Copilot-for-Xcode-Info.plist

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key></key>
6-
<string>$(AppIdentifierPrefix)</string>
7-
<key>APPLICATION_SUPPORT_FOLDER</key>
8-
<string>$(APPLICATION_SUPPORT_FOLDER)</string>
9-
<key>BUNDLE_IDENTIFIER_BASE</key>
10-
<string>$(BUNDLE_IDENTIFIER_BASE)</string>
11-
<key>EXTENSION_BUNDLE_NAME</key>
12-
<string>$(EXTENSION_BUNDLE_NAME)</string>
13-
<key>HOST_APP_NAME</key>
14-
<string>$(HOST_APP_NAME)</string>
15-
<key>LANGUAGE_SERVER_PATH</key>
16-
<string>$(LANGUAGE_SERVER_PATH)</string>
17-
<key>NODE_PATH</key>
18-
<string>$(NODE_PATH)</string>
19-
<key>SUEnableAutomaticChecks</key>
20-
<string>YES</string>
21-
<key>SUEnableJavaScript</key>
22-
<string>NO</string>
23-
<key>SUFeedURL</key>
24-
<string>$(SPARKLE_FEED_URL)</string>
25-
<key>SUPublicEDKey</key>
26-
<string>$(SPARKLE_PUBLIC_KEY)</string>
27-
<key>TEAM_ID_PREFIX</key>
28-
<string>$(TeamIdentifierPrefix)</string>
29-
</dict>
4+
<dict>
5+
<key></key>
6+
<string>$(AppIdentifierPrefix)</string>
7+
<key>APPLICATION_SUPPORT_FOLDER</key>
8+
<string>$(APPLICATION_SUPPORT_FOLDER)</string>
9+
<key>BUNDLE_IDENTIFIER_BASE</key>
10+
<string>$(BUNDLE_IDENTIFIER_BASE)</string>
11+
<key>EXTENSION_BUNDLE_NAME</key>
12+
<string>$(EXTENSION_BUNDLE_NAME)</string>
13+
<key>HOST_APP_NAME</key>
14+
<string>$(HOST_APP_NAME)</string>
15+
<key>LANGUAGE_SERVER_PATH</key>
16+
<string>$(LANGUAGE_SERVER_PATH)</string>
17+
<key>NODE_PATH</key>
18+
<string>$(NODE_PATH)</string>
19+
<key>SUEnableAutomaticChecks</key>
20+
<string>YES</string>
21+
<key>SUScheduledCheckInterval</key>
22+
<string>3600</string>
23+
<key>SUEnableJavaScript</key>
24+
<string>NO</string>
25+
<key>SUFeedURL</key>
26+
<string>$(SPARKLE_FEED_URL)</string>
27+
<key>SUPublicEDKey</key>
28+
<string>$(SPARKLE_PUBLIC_KEY)</string>
29+
<key>TEAM_ID_PREFIX</key>
30+
<string>$(TeamIdentifierPrefix)</string>
31+
</dict>
3032
</plist>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import AppKit
2+
import Logger
3+
import Preferences
4+
import SwiftUI
5+
6+
struct LoggingSettingsView: View {
7+
@AppStorage(\.verboseLoggingEnabled) var verboseLoggingEnabled: Bool
8+
@State private var shouldPresentRestartAlert = false
9+
10+
var body: some View {
11+
VStack(alignment: .leading) {
12+
Text("Logging")
13+
.bold()
14+
.padding(.leading, 8)
15+
VStack(spacing: .zero) {
16+
HStack(alignment: .center) {
17+
Text("Verbose Logging")
18+
.padding(.horizontal, 8)
19+
Spacer()
20+
Toggle(isOn: $verboseLoggingEnabled) {
21+
}
22+
.toggleStyle(.switch)
23+
.padding(.horizontal, 8)
24+
}
25+
.padding(.vertical, 8)
26+
.onChange(of: verboseLoggingEnabled) { _ in
27+
shouldPresentRestartAlert = true
28+
}
29+
30+
Divider()
31+
32+
HStack {
33+
Text("Open Copilot Log Folder")
34+
.font(.body)
35+
Spacer()
36+
Image(systemName: "chevron.right")
37+
}
38+
.onTapGesture {
39+
NSWorkspace.shared.open(URL(fileURLWithPath: FileLoggingLocation.path.string, isDirectory: true))
40+
}
41+
.foregroundStyle(.primary)
42+
.padding(.horizontal, 8)
43+
.padding(.vertical, 10)
44+
}
45+
.background(Color.gray.opacity(0.1))
46+
.cornerRadius(8)
47+
}
48+
.padding(.horizontal, 20)
49+
.alert(isPresented: $shouldPresentRestartAlert) {
50+
Alert(
51+
title: Text("Quit And Restart Xcode"),
52+
message: Text(
53+
"""
54+
Logging level changes will take effect the next time Copilot \
55+
for Xcode is started. To update logging now, please quit \
56+
Copilot for Xcode and restart Xcode.
57+
"""
58+
),
59+
dismissButton: .default(Text("OK"))
60+
)
61+
}
62+
}
63+
}

Core/Sources/HostApp/FeatureSettings/Suggestion/SuggesionSettingProxyView.swift

Lines changed: 70 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,112 @@ import Toast
66
import Client
77

88
struct SuggesionSettingProxyView: View {
9-
109
class Settings: ObservableObject {
1110
@AppStorage("username") var username: String = ""
1211
@AppStorage(\.gitHubCopilotProxyUrl) var gitHubCopilotProxyUrl
1312
@AppStorage(\.gitHubCopilotProxyUsername) var gitHubCopilotProxyUsername
1413
@AppStorage(\.gitHubCopilotProxyPassword) var gitHubCopilotProxyPassword
1514
@AppStorage(\.gitHubCopilotUseStrictSSL) var gitHubCopilotUseStrictSSL
1615
@AppStorage(\.gitHubCopilotEnterpriseURI) var gitHubCopilotEnterpriseURI
17-
18-
init() {}
1916
}
2017

2118
@StateObject var settings = Settings()
2219
@Environment(\.toast) var toast
2320

2421
var body: some View {
2522
VStack(alignment: .leading) {
26-
SettingsDivider("Enterprise")
23+
Text(StringConstants.enterprise)
24+
.bold()
25+
.padding(.leading, 8)
2726

2827
Form {
2928
TextField(
3029
text: $settings.gitHubCopilotEnterpriseURI,
31-
prompt: Text("Leave it blank if none is available.")
30+
prompt: Text(StringConstants.leaveBlankPrompt)
3231
) {
33-
Text("Auth provider URL")
32+
Text(StringConstants.authProviderURL)
3433
}
34+
.textFieldStyle(PlainTextFieldStyle())
35+
.multilineTextAlignment(.trailing)
3536
}
37+
.padding(8)
38+
.background(Color.gray.opacity(0.1))
39+
.cornerRadius(6)
40+
.padding(.bottom, 16)
3641

37-
SettingsDivider("Proxy")
42+
Text(StringConstants.proxy)
43+
.bold()
44+
.padding(.leading, 8)
3845

39-
Form {
40-
TextField(
41-
text: $settings.gitHubCopilotProxyUrl,
42-
prompt: Text("http://host:port")
43-
) {
44-
Text("Proxy URL")
46+
VStack(spacing: 0) {
47+
Form {
48+
TextField(
49+
text: $settings.gitHubCopilotProxyUrl,
50+
prompt: Text(StringConstants.proxyURLPrompt)
51+
) {
52+
Text(StringConstants.proxyURL)
53+
}
54+
.textFieldStyle(PlainTextFieldStyle())
55+
.multilineTextAlignment(.trailing)
4556
}
46-
TextField(text: $settings.gitHubCopilotProxyUsername) {
47-
Text("Proxy username")
57+
.padding(.horizontal, 16)
58+
.padding(.vertical, 8)
59+
60+
Divider()
61+
62+
Form {
63+
TextField(text: $settings.gitHubCopilotProxyUsername, prompt: Text(StringConstants.proxyUsernamePrompt)) {
64+
Text(StringConstants.proxyUsername)
65+
}
66+
.textFieldStyle(PlainTextFieldStyle())
67+
.multilineTextAlignment(.trailing)
4868
}
49-
SecureField(text: $settings.gitHubCopilotProxyPassword) {
50-
Text("Proxy password")
69+
.padding(.horizontal, 16)
70+
.padding(.vertical, 8)
71+
72+
Divider()
73+
74+
Form {
75+
SecureField(text: $settings.gitHubCopilotProxyPassword, prompt: Text(StringConstants.proxyPasswordPrompt)) {
76+
Text(StringConstants.proxyPassword)
77+
}
78+
.textFieldStyle(PlainTextFieldStyle())
79+
.multilineTextAlignment(.trailing)
5180
}
52-
Toggle("Proxy strict SSL", isOn: $settings.gitHubCopilotUseStrictSSL)
81+
.padding(.horizontal, 16)
82+
.padding(.vertical, 8)
83+
84+
Divider()
5385

54-
Button("Refresh configurations") {
86+
HStack {
87+
Text(StringConstants.proxyStrictSSL)
88+
Spacer()
89+
Toggle("", isOn: $settings.gitHubCopilotUseStrictSSL)
90+
.toggleStyle(.switch)
91+
}
92+
.padding(.horizontal, 16)
93+
.padding(.vertical, 8)
94+
}
95+
.background(Color.gray.opacity(0.1))
96+
.cornerRadius(6)
97+
.padding(.bottom, 8)
98+
99+
HStack {
100+
Spacer()
101+
Button(StringConstants.refreshConfigurations) {
55102
refreshConfiguration()
56-
}.padding(.top, 6)
103+
}
57104
}
105+
.padding(.horizontal, 16)
106+
Spacer()
58107
}
59-
.textFieldStyle(.roundedBorder)
108+
.padding(16)
60109
}
61-
62110
func refreshConfiguration() {
63111
NotificationCenter.default.post(
64112
name: .gitHubCopilotShouldRefreshEditorInformation,
65113
object: nil
66114
)
67-
68115
Task {
69116
let service = try getService()
70117
do {

Core/Sources/HostApp/FeatureSettings/Suggestion/SuggestionSettingsGeneralSectionView.swift

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,62 @@ import XPCShared
66

77
struct SuggestionSettingsGeneralSectionView: View {
88
final class Settings: ObservableObject {
9-
@AppStorage(\.realtimeSuggestionToggle)
10-
var realtimeSuggestionToggle
11-
@AppStorage(\.suggestionFeatureEnabledProjectList)
12-
var suggestionFeatureEnabledProjectList
13-
@AppStorage(\.acceptSuggestionWithTab)
14-
var acceptSuggestionWithTab
9+
@AppStorage(\.realtimeSuggestionToggle) var realtimeSuggestionToggle
10+
@AppStorage(\.suggestionFeatureEnabledProjectList) var suggestionFeatureEnabledProjectList
11+
@AppStorage(\.acceptSuggestionWithTab) var acceptSuggestionWithTab
1512
}
1613

1714
@StateObject var settings = Settings()
1815
@State var isSuggestionFeatureDisabledLanguageListViewOpen = false
1916

2017
var body: some View {
21-
Form {
22-
Toggle(isOn: $settings.realtimeSuggestionToggle) {
23-
Text("Request suggestions in real-time")
24-
}
18+
VStack(alignment: .leading) {
19+
Text(StringConstants.suggestionSettings)
20+
.bold()
21+
.padding(.leading, 8)
22+
23+
VStack(spacing: .zero) {
24+
HStack(alignment: .center) {
25+
Text(StringConstants.requestSuggestionsInRealTime)
26+
.padding(.horizontal, 8)
27+
Spacer()
28+
Toggle(isOn: $settings.realtimeSuggestionToggle) {
29+
}
30+
.toggleStyle(SwitchToggleStyle(tint: .blue))
31+
.padding(.horizontal, 8)
32+
}
33+
.padding(.vertical, 8)
2534

26-
Toggle(isOn: $settings.acceptSuggestionWithTab) {
27-
HStack {
28-
Text("Accept suggestions with Tab")
35+
Divider()
36+
37+
HStack(alignment: .center) {
38+
Text(StringConstants.acceptSuggestionsWithTab)
39+
.padding(.horizontal, 8)
40+
Spacer()
41+
Toggle(isOn: $settings.acceptSuggestionWithTab) {
42+
}
43+
.toggleStyle(SwitchToggleStyle(tint: .blue))
44+
.padding(.horizontal, 8)
2945
}
46+
.padding(.vertical, 8)
3047
}
48+
.background(Color.gray.opacity(0.1))
49+
.cornerRadius(6)
50+
.padding(.bottom, 8)
3151

3252
HStack {
33-
Button("Disabled language list") {
53+
Spacer()
54+
Button(StringConstants.disabledLanguageList) {
3455
isSuggestionFeatureDisabledLanguageListViewOpen = true
3556
}
36-
}.sheet(isPresented: $isSuggestionFeatureDisabledLanguageListViewOpen) {
37-
SuggestionFeatureDisabledLanguageListView(
38-
isOpen: $isSuggestionFeatureDisabledLanguageListViewOpen
39-
)
4057
}
58+
.padding(.horizontal)
59+
.sheet(isPresented: $isSuggestionFeatureDisabledLanguageListViewOpen) {
60+
SuggestionFeatureDisabledLanguageListView(isOpen: $isSuggestionFeatureDisabledLanguageListViewOpen)
61+
}
62+
Spacer()
4163
}
64+
.padding(16)
4265
}
4366
}
4467

Core/Sources/HostApp/FeatureSettings/Suggestion/SuggestionSettingsView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ struct SuggestionSettingsView: View {
99
ScrollView {
1010
SuggestionSettingsGeneralSectionView()
1111
SuggesionSettingProxyView()
12+
LoggingSettingsView()
1213
}.padding()
1314
}
1415
}

Core/Sources/HostApp/StringConstants.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
struct StringConstants {
2+
// General Tab Strings
23
static let rightsReserved = "GitHub. All rights reserved."
34
static let appName = "GitHub Copilot for Xcode"
45
static let languageServerVersion = "Language Server Version:"
@@ -28,4 +29,24 @@ struct StringConstants {
2829
static let copilotDocumentation = "View Copilot Documentation"
2930
static let copilotFeedbackForum = "View Copilot Feedback Forum"
3031
static let loading = "Loading.."
32+
33+
// Feature Tab Settings Strings
34+
static let suggestionSettings = "Suggestion Settings"
35+
static let requestSuggestionsInRealTime = "Request suggestions in real-time"
36+
static let acceptSuggestionsWithTab = "Accept suggestions with Tab"
37+
static let disabledLanguageList = "Disabled language list"
38+
39+
// Proxy String
40+
static let enterprise = "Enterprise"
41+
static let leaveBlankPrompt = "Leave it blank if none is available."
42+
static let authProviderURL = "Auth provider URL"
43+
static let proxy = "Proxy"
44+
static let proxyURLPrompt = "http://host:port"
45+
static let proxyURL = "Proxy URL"
46+
static let proxyUsernamePrompt = "username"
47+
static let proxyUsername = "Proxy username"
48+
static let proxyPasswordPrompt = "password"
49+
static let proxyPassword = "Proxy password"
50+
static let proxyStrictSSL = "Proxy strict SSL"
51+
static let refreshConfigurations = "Refresh configurations"
3152
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy