Skip to content

Commit

Permalink
Pre-release 0.25.85
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 17, 2024
1 parent 69d18ad commit 8a7a4fe
Show file tree
Hide file tree
Showing 41 changed files with 827 additions and 1,115 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve GitHub Copilot for Xcode
---

<!-- Please search existing issues to avoid creating duplicates -->

**Describe the bug**
<!-- A clear and concise description of what the bug is. -->

**Versions**
- Copilot for Xcode: [e.g. 0.25.0]
- Xcode: [e.g. 16.0]
- macOS: [e.g. 14.6.1]

**Steps to reproduce**
1.
2.

**Screenshots**
<!-- Add screenshots or screen recordings to help explain your problem. -->

**Logs**
<!-- Attach relevant logs from `~/Library/Logs/GitHubCopilot/` -->

**Additional context**
<!-- Add any other context about the problem here. -->
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Feature request
about: Suggest an idea for GitHub Copilot for Xcode
---

<!-- Please search existing issues to avoid creating duplicates -->

<!-- Describe the feature you'd like. -->
2 changes: 2 additions & 0 deletions CommunicationBridge/main.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import AppKit
import Foundation
import Logger

class AppDelegate: NSObject, NSApplicationDelegate {}

Expand All @@ -15,5 +16,6 @@ listener.delegate = delegate
listener.resume()
let app = NSApplication.shared
app.delegate = appDelegate
Logger.communicationBridge.info("Communication bridge started")
app.run()

2 changes: 1 addition & 1 deletion Copilot-for-Xcode-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!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>
<key>APP_ID_PREFIX</key>
<string>$(AppIdentifierPrefix)</string>
<key>APPLICATION_SUPPORT_FOLDER</key>
<string>$(APPLICATION_SUPPORT_FOLDER)</string>
Expand Down
7 changes: 6 additions & 1 deletion Core/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,12 @@ let package = Package(
// MARK: - Helpers

.target(name: "FileChangeChecker"),
.target(name: "LaunchAgentManager"),
.target(
name: "LaunchAgentManager",
dependencies: [
.product(name: "Logger", package: "Tool"),
]
),
.target(
name: "UpdateChecker",
dependencies: [
Expand Down
20 changes: 20 additions & 0 deletions Core/Sources/HostApp/AdvancedSettings/AdvancedSettings.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import SwiftUI

struct AdvancedSettings: View {
var body: some View {
ScrollView {
VStack(alignment: .leading, spacing: 30) {
SuggestionSection()
EnterpriseSection()
ProxySection()
LoggingSection()
}
.padding(20)
}
}
}

#Preview {
AdvancedSettings()
.frame(width: 800, height: 600)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extension List {
}
}

struct SuggestionFeatureDisabledLanguageListView: View {
struct DisabledLanguageList: View {
final class Settings: ObservableObject {
@AppStorage(\.suggestionFeatureDisabledLanguageList)
var suggestionFeatureDisabledLanguageList: [String]
Expand Down Expand Up @@ -100,16 +100,15 @@ struct SuggestionFeatureDisabledLanguageListView: View {
}
}

struct SuggestionFeatureDisabledLanguageListView_Preview: PreviewProvider {
static var previews: some View {
SuggestionFeatureDisabledLanguageListView(
isOpen: .constant(true),
settings: .init(suggestionFeatureDisabledLanguageList: .init(wrappedValue: [
"hello/2",
"hello/3",
"hello/4",
], "SuggestionFeatureDisabledLanguageListView_Preview"))
)
}
#Preview {
DisabledLanguageList(
isOpen: .constant(true),
settings: .init(suggestionFeatureDisabledLanguageList: .init(wrappedValue: [
"hello/2",
"hello/3",
"hello/4",
], "SuggestionFeatureDisabledLanguageListView_Preview"))
)
}


19 changes: 19 additions & 0 deletions Core/Sources/HostApp/AdvancedSettings/EnterpriseSection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import SwiftUI

struct EnterpriseSection: View {
@AppStorage(\.gitHubCopilotEnterpriseURI) var gitHubCopilotEnterpriseURI

var body: some View {
SettingsSection(title: "Enterprise") {
SettingsTextField(
title: "Auth provider URL",
prompt: "Leave it blank if none is available.",
text: $gitHubCopilotEnterpriseURI
)
}
}
}

#Preview {
EnterpriseSection()
}
52 changes: 52 additions & 0 deletions Core/Sources/HostApp/AdvancedSettings/LoggingSection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import Logger
import SwiftUI

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

var verboseLoggingBinding: Binding<Bool> {
Binding(
get: { verboseLoggingEnabled },
set: {
verboseLoggingEnabled = $0
shouldPresentRestartAlert = $0
}
)
}

var body: some View {
SettingsSection(title: "Logging") {
SettingsToggle(
title: "Verbose Logging",
isOn: verboseLoggingBinding
)
Divider()
SettingsLink(
URL(fileURLWithPath: FileLoggingLocation.path.string),
title: "Open Copilot Log Folder"
)
.environment(\.openURL, OpenURLAction { url in
NSWorkspace.shared.open(url)
return .handled
})
}
.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"))
)
}
}
}

#Preview {
LoggingSection()
}
65 changes: 65 additions & 0 deletions Core/Sources/HostApp/AdvancedSettings/ProxySection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import Client
import SwiftUI
import Toast

struct ProxySection: View {
@AppStorage(\.gitHubCopilotProxyUrl) var gitHubCopilotProxyUrl
@AppStorage(\.gitHubCopilotProxyUsername) var gitHubCopilotProxyUsername
@AppStorage(\.gitHubCopilotProxyPassword) var gitHubCopilotProxyPassword
@AppStorage(\.gitHubCopilotUseStrictSSL) var gitHubCopilotUseStrictSSL

@Environment(\.toast) var toast

var body: some View {
SettingsSection(title: "Proxy") {
SettingsTextField(
title: "Proxy URL",
prompt: "http://host:port",
text: $gitHubCopilotProxyUrl
)
SettingsTextField(
title: "Proxy username",
prompt: "username",
text: $gitHubCopilotProxyUsername
)
SettingsSecureField(
title: "Proxy password",
prompt: "password",
text: $gitHubCopilotProxyPassword
)
SettingsToggle(
title: "Proxy strict SSL",
isOn: $gitHubCopilotUseStrictSSL
)
} footer: {
HStack {
Spacer()
Button("Refresh configurations") {
refreshConfiguration()
}
}
}
}

func refreshConfiguration() {
NotificationCenter.default.post(
name: .gitHubCopilotShouldRefreshEditorInformation,
object: nil
)
Task {
let service = try getService()
do {
try await service.postNotification(
name: Notification.Name
.gitHubCopilotShouldRefreshEditorInformation.rawValue
)
} catch {
toast(error.localizedDescription, .error)
}
}
}
}

#Preview {
ProxySection()
}
62 changes: 62 additions & 0 deletions Core/Sources/HostApp/AdvancedSettings/SuggestionSection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import SwiftUI

struct SuggestionSection: View {
@AppStorage(\.realtimeSuggestionToggle) var realtimeSuggestionToggle
@AppStorage(\.suggestionFeatureEnabledProjectList) var suggestionFeatureEnabledProjectList
@AppStorage(\.acceptSuggestionWithTab) var acceptSuggestionWithTab
@State var isSuggestionFeatureDisabledLanguageListViewOpen = false
@State private var shouldPresentTurnoffSheet = false

var realtimeSuggestionBinding : Binding<Bool> {
Binding(
get: { realtimeSuggestionToggle },
set: {
if !$0 {
shouldPresentTurnoffSheet = true
} else {
realtimeSuggestionToggle = $0
}
}
)
}

var body: some View {
SettingsSection(title: "Suggestion Settings") {
SettingsToggle(
title: "Request suggestions while typing",
isOn: realtimeSuggestionBinding
)
Divider()
SettingsToggle(
title: "Accept suggestions with Tab",
isOn: $acceptSuggestionWithTab
)
} footer: {
HStack {
Spacer()
Button("Disabled language list") {
isSuggestionFeatureDisabledLanguageListViewOpen = true
}
}
}
.sheet(isPresented: $isSuggestionFeatureDisabledLanguageListViewOpen) {
DisabledLanguageList(isOpen: $isSuggestionFeatureDisabledLanguageListViewOpen)
}
.alert(
"Disable suggestions while typing",
isPresented: $shouldPresentTurnoffSheet
) {
Button("Disable") { realtimeSuggestionToggle = false }
Button("Cancel", role: .cancel, action: {})
} message: {
Text("""
If you disable requesting suggestions while typing, you will \
not see any suggestions until requested manually.
""")
}
}
}

#Preview {
SuggestionSection()
}
63 changes: 0 additions & 63 deletions Core/Sources/HostApp/FeatureSettings/LoggingSettingsView.swift

This file was deleted.

Loading

0 comments on commit 8a7a4fe

Please sign in to comment.