Skip to content

Commit

Permalink
Pre-release 0.25.84
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 16, 2024
1 parent baf6492 commit 69d18ad
Show file tree
Hide file tree
Showing 11 changed files with 251 additions and 81 deletions.
1 change: 0 additions & 1 deletion Copilot for Xcode/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct CopilotForXcodeApp: App {
.onAppear {
UserDefaults.setupDefaultSettings()
}
.environment(\.updateChecker, UpdateChecker(hostBundle: Bundle.main))
.copilotIntroSheet()
}
}
Expand Down
54 changes: 28 additions & 26 deletions Copilot-for-Xcode-Info.plist
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key></key>
<string>$(AppIdentifierPrefix)</string>
<key>APPLICATION_SUPPORT_FOLDER</key>
<string>$(APPLICATION_SUPPORT_FOLDER)</string>
<key>BUNDLE_IDENTIFIER_BASE</key>
<string>$(BUNDLE_IDENTIFIER_BASE)</string>
<key>EXTENSION_BUNDLE_NAME</key>
<string>$(EXTENSION_BUNDLE_NAME)</string>
<key>HOST_APP_NAME</key>
<string>$(HOST_APP_NAME)</string>
<key>LANGUAGE_SERVER_PATH</key>
<string>$(LANGUAGE_SERVER_PATH)</string>
<key>NODE_PATH</key>
<string>$(NODE_PATH)</string>
<key>SUEnableAutomaticChecks</key>
<string>YES</string>
<key>SUEnableJavaScript</key>
<string>NO</string>
<key>SUFeedURL</key>
<string>$(SPARKLE_FEED_URL)</string>
<key>SUPublicEDKey</key>
<string>$(SPARKLE_PUBLIC_KEY)</string>
<key>TEAM_ID_PREFIX</key>
<string>$(TeamIdentifierPrefix)</string>
</dict>
<dict>
<key></key>
<string>$(AppIdentifierPrefix)</string>
<key>APPLICATION_SUPPORT_FOLDER</key>
<string>$(APPLICATION_SUPPORT_FOLDER)</string>
<key>BUNDLE_IDENTIFIER_BASE</key>
<string>$(BUNDLE_IDENTIFIER_BASE)</string>
<key>EXTENSION_BUNDLE_NAME</key>
<string>$(EXTENSION_BUNDLE_NAME)</string>
<key>HOST_APP_NAME</key>
<string>$(HOST_APP_NAME)</string>
<key>LANGUAGE_SERVER_PATH</key>
<string>$(LANGUAGE_SERVER_PATH)</string>
<key>NODE_PATH</key>
<string>$(NODE_PATH)</string>
<key>SUEnableAutomaticChecks</key>
<string>YES</string>
<key>SUScheduledCheckInterval</key>
<string>3600</string>
<key>SUEnableJavaScript</key>
<string>NO</string>
<key>SUFeedURL</key>
<string>$(SPARKLE_FEED_URL)</string>
<key>SUPublicEDKey</key>
<string>$(SPARKLE_PUBLIC_KEY)</string>
<key>TEAM_ID_PREFIX</key>
<string>$(TeamIdentifierPrefix)</string>
</dict>
</plist>
63 changes: 63 additions & 0 deletions Core/Sources/HostApp/FeatureSettings/LoggingSettingsView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import AppKit
import Logger
import Preferences
import SwiftUI

struct LoggingSettingsView: View {
@AppStorage(\.verboseLoggingEnabled) var verboseLoggingEnabled: Bool
@State private var shouldPresentRestartAlert = false

var body: some View {
VStack(alignment: .leading) {
Text("Logging")
.bold()
.padding(.leading, 8)
VStack(spacing: .zero) {
HStack(alignment: .center) {
Text("Verbose Logging")
.padding(.horizontal, 8)
Spacer()
Toggle(isOn: $verboseLoggingEnabled) {
}
.toggleStyle(.switch)
.padding(.horizontal, 8)
}
.padding(.vertical, 8)
.onChange(of: verboseLoggingEnabled) { _ in
shouldPresentRestartAlert = true
}

Divider()

HStack {
Text("Open Copilot Log Folder")
.font(.body)
Spacer()
Image(systemName: "chevron.right")
}
.onTapGesture {
NSWorkspace.shared.open(URL(fileURLWithPath: FileLoggingLocation.path.string, isDirectory: true))
}
.foregroundStyle(.primary)
.padding(.horizontal, 8)
.padding(.vertical, 10)
}
.background(Color.gray.opacity(0.1))
.cornerRadius(8)
}
.padding(.horizontal, 20)
.alert(isPresented: $shouldPresentRestartAlert) {
Alert(
title: Text("Quit And Restart Xcode"),
message: Text(
"""
Logging level changes will take effect the next time Copilot \
for Xcode is started. To update logging now, please quit \
Copilot for Xcode and restart Xcode.
"""
),
dismissButton: .default(Text("OK"))
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,112 @@ import Toast
import Client

struct SuggesionSettingProxyView: View {

class Settings: ObservableObject {
@AppStorage("username") var username: String = ""
@AppStorage(\.gitHubCopilotProxyUrl) var gitHubCopilotProxyUrl
@AppStorage(\.gitHubCopilotProxyUsername) var gitHubCopilotProxyUsername
@AppStorage(\.gitHubCopilotProxyPassword) var gitHubCopilotProxyPassword
@AppStorage(\.gitHubCopilotUseStrictSSL) var gitHubCopilotUseStrictSSL
@AppStorage(\.gitHubCopilotEnterpriseURI) var gitHubCopilotEnterpriseURI

init() {}
}

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

var body: some View {
VStack(alignment: .leading) {
SettingsDivider("Enterprise")
Text(StringConstants.enterprise)
.bold()
.padding(.leading, 8)

Form {
TextField(
text: $settings.gitHubCopilotEnterpriseURI,
prompt: Text("Leave it blank if none is available.")
prompt: Text(StringConstants.leaveBlankPrompt)
) {
Text("Auth provider URL")
Text(StringConstants.authProviderURL)
}
.textFieldStyle(PlainTextFieldStyle())
.multilineTextAlignment(.trailing)
}
.padding(8)
.background(Color.gray.opacity(0.1))
.cornerRadius(6)
.padding(.bottom, 16)

SettingsDivider("Proxy")
Text(StringConstants.proxy)
.bold()
.padding(.leading, 8)

Form {
TextField(
text: $settings.gitHubCopilotProxyUrl,
prompt: Text("http://host:port")
) {
Text("Proxy URL")
VStack(spacing: 0) {
Form {
TextField(
text: $settings.gitHubCopilotProxyUrl,
prompt: Text(StringConstants.proxyURLPrompt)
) {
Text(StringConstants.proxyURL)
}
.textFieldStyle(PlainTextFieldStyle())
.multilineTextAlignment(.trailing)
}
TextField(text: $settings.gitHubCopilotProxyUsername) {
Text("Proxy username")
.padding(.horizontal, 16)
.padding(.vertical, 8)

Divider()

Form {
TextField(text: $settings.gitHubCopilotProxyUsername, prompt: Text(StringConstants.proxyUsernamePrompt)) {
Text(StringConstants.proxyUsername)
}
.textFieldStyle(PlainTextFieldStyle())
.multilineTextAlignment(.trailing)
}
SecureField(text: $settings.gitHubCopilotProxyPassword) {
Text("Proxy password")
.padding(.horizontal, 16)
.padding(.vertical, 8)

Divider()

Form {
SecureField(text: $settings.gitHubCopilotProxyPassword, prompt: Text(StringConstants.proxyPasswordPrompt)) {
Text(StringConstants.proxyPassword)
}
.textFieldStyle(PlainTextFieldStyle())
.multilineTextAlignment(.trailing)
}
Toggle("Proxy strict SSL", isOn: $settings.gitHubCopilotUseStrictSSL)
.padding(.horizontal, 16)
.padding(.vertical, 8)

Divider()

Button("Refresh configurations") {
HStack {
Text(StringConstants.proxyStrictSSL)
Spacer()
Toggle("", isOn: $settings.gitHubCopilotUseStrictSSL)
.toggleStyle(.switch)
}
.padding(.horizontal, 16)
.padding(.vertical, 8)
}
.background(Color.gray.opacity(0.1))
.cornerRadius(6)
.padding(.bottom, 8)

HStack {
Spacer()
Button(StringConstants.refreshConfigurations) {
refreshConfiguration()
}.padding(.top, 6)
}
}
.padding(.horizontal, 16)
Spacer()
}
.textFieldStyle(.roundedBorder)
.padding(16)
}

func refreshConfiguration() {
NotificationCenter.default.post(
name: .gitHubCopilotShouldRefreshEditorInformation,
object: nil
)

Task {
let service = try getService()
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,62 @@ import XPCShared

struct SuggestionSettingsGeneralSectionView: View {
final class Settings: ObservableObject {
@AppStorage(\.realtimeSuggestionToggle)
var realtimeSuggestionToggle
@AppStorage(\.suggestionFeatureEnabledProjectList)
var suggestionFeatureEnabledProjectList
@AppStorage(\.acceptSuggestionWithTab)
var acceptSuggestionWithTab
@AppStorage(\.realtimeSuggestionToggle) var realtimeSuggestionToggle
@AppStorage(\.suggestionFeatureEnabledProjectList) var suggestionFeatureEnabledProjectList
@AppStorage(\.acceptSuggestionWithTab) var acceptSuggestionWithTab
}

@StateObject var settings = Settings()
@State var isSuggestionFeatureDisabledLanguageListViewOpen = false

var body: some View {
Form {
Toggle(isOn: $settings.realtimeSuggestionToggle) {
Text("Request suggestions in real-time")
}
VStack(alignment: .leading) {
Text(StringConstants.suggestionSettings)
.bold()
.padding(.leading, 8)

VStack(spacing: .zero) {
HStack(alignment: .center) {
Text(StringConstants.requestSuggestionsInRealTime)
.padding(.horizontal, 8)
Spacer()
Toggle(isOn: $settings.realtimeSuggestionToggle) {
}
.toggleStyle(SwitchToggleStyle(tint: .blue))
.padding(.horizontal, 8)
}
.padding(.vertical, 8)

Toggle(isOn: $settings.acceptSuggestionWithTab) {
HStack {
Text("Accept suggestions with Tab")
Divider()

HStack(alignment: .center) {
Text(StringConstants.acceptSuggestionsWithTab)
.padding(.horizontal, 8)
Spacer()
Toggle(isOn: $settings.acceptSuggestionWithTab) {
}
.toggleStyle(SwitchToggleStyle(tint: .blue))
.padding(.horizontal, 8)
}
.padding(.vertical, 8)
}
.background(Color.gray.opacity(0.1))
.cornerRadius(6)
.padding(.bottom, 8)

HStack {
Button("Disabled language list") {
Spacer()
Button(StringConstants.disabledLanguageList) {
isSuggestionFeatureDisabledLanguageListViewOpen = true
}
}.sheet(isPresented: $isSuggestionFeatureDisabledLanguageListViewOpen) {
SuggestionFeatureDisabledLanguageListView(
isOpen: $isSuggestionFeatureDisabledLanguageListViewOpen
)
}
.padding(.horizontal)
.sheet(isPresented: $isSuggestionFeatureDisabledLanguageListViewOpen) {
SuggestionFeatureDisabledLanguageListView(isOpen: $isSuggestionFeatureDisabledLanguageListViewOpen)
}
Spacer()
}
.padding(16)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ struct SuggestionSettingsView: View {
ScrollView {
SuggestionSettingsGeneralSectionView()
SuggesionSettingProxyView()
LoggingSettingsView()
}.padding()
}
}
Expand Down
21 changes: 21 additions & 0 deletions Core/Sources/HostApp/StringConstants.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
struct StringConstants {
// General Tab Strings
static let rightsReserved = "GitHub. All rights reserved."
static let appName = "GitHub Copilot for Xcode"
static let languageServerVersion = "Language Server Version:"
Expand Down Expand Up @@ -28,4 +29,24 @@ struct StringConstants {
static let copilotDocumentation = "View Copilot Documentation"
static let copilotFeedbackForum = "View Copilot Feedback Forum"
static let loading = "Loading.."

// Feature Tab Settings Strings
static let suggestionSettings = "Suggestion Settings"
static let requestSuggestionsInRealTime = "Request suggestions in real-time"
static let acceptSuggestionsWithTab = "Accept suggestions with Tab"
static let disabledLanguageList = "Disabled language list"

// Proxy String
static let enterprise = "Enterprise"
static let leaveBlankPrompt = "Leave it blank if none is available."
static let authProviderURL = "Auth provider URL"
static let proxy = "Proxy"
static let proxyURLPrompt = "http://host:port"
static let proxyURL = "Proxy URL"
static let proxyUsernamePrompt = "username"
static let proxyUsername = "Proxy username"
static let proxyPasswordPrompt = "password"
static let proxyPassword = "Proxy password"
static let proxyStrictSSL = "Proxy strict SSL"
static let refreshConfigurations = "Refresh configurations"
}
Loading

0 comments on commit 69d18ad

Please sign in to comment.