Skip to content

Commit dbd4194

Browse files
committed
Merge branch 'release/0.35.3'
2 parents 2ab65a5 + de2250c commit dbd4194

File tree

7 files changed

+38
-20
lines changed

7 files changed

+38
-20
lines changed

Core/Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ let package = Package(
3939
.package(path: "../Tool"),
4040
.package(path: "../ChatPlugins"),
4141
.package(url: "https://github.com/apple/swift-async-algorithms", from: "1.0.0"),
42-
.package(url: "https://github.com/gonzalezreal/swift-markdown-ui", from: "2.1.0"),
42+
.package(url: "https://github.com/gonzalezreal/swift-markdown-ui", from: "2.4.1"),
4343
.package(url: "https://github.com/sparkle-project/Sparkle", from: "2.0.0"),
4444
.package(url: "https://github.com/pointfreeco/swift-parsing", from: "0.12.1"),
4545
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.0.0"),
4646
.package(
4747
url: "https://github.com/pointfreeco/swift-composable-architecture",
48-
exact: "1.15.0"
48+
exact: "1.16.1"
4949
),
5050
// quick hack to support custom UserDefaults
5151
// https://github.com/sindresorhus/KeyboardShortcuts

Tool/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ let package = Package(
7272
.package(url: "https://github.com/intitni/Highlightr", branch: "master"),
7373
.package(
7474
url: "https://github.com/pointfreeco/swift-composable-architecture",
75-
exact: "1.15.0"
75+
exact: "1.16.1"
7676
),
7777
.package(url: "https://github.com/apple/swift-syntax.git", from: "600.0.0"),
7878
.package(url: "https://github.com/GottaGetSwifty/CodableWrappers", from: "2.0.7"),

Tool/Sources/AppActivator/AppActivator.swift

+18-7
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ public extension NSWorkspace {
1616
if activated { return }
1717

1818
// Fallback solution
19-
20-
let axApplication = AXUIElementCreateApplication(ProcessInfo.processInfo.processIdentifier)
21-
axApplication.isFrontmost = true
19+
20+
let axApplication = AXUIElementCreateApplication(
21+
ProcessInfo.processInfo.processIdentifier
22+
)
23+
activateAppElement(axApplication)
2224
//
2325
// let appleScript = """
2426
// tell application "System Events"
@@ -35,19 +37,28 @@ public extension NSWorkspace {
3537
guard let app = await XcodeInspector.shared.safe.previousActiveApplication
3638
else { return }
3739
try await Task.sleep(nanoseconds: UInt64(delay * 1_000_000_000))
38-
app.appElement.isFrontmost = true
39-
// _ = app.activate()
40+
activateApp(app)
4041
}
4142
}
4243

4344
static func activatePreviousActiveXcode(delay: TimeInterval = 0.2) {
4445
Task { @MainActor in
4546
guard let app = await XcodeInspector.shared.safe.latestActiveXcode else { return }
4647
try await Task.sleep(nanoseconds: UInt64(delay * 1_000_000_000))
47-
app.appElement.isFrontmost = true
48-
// _ = app.activate()
48+
activateApp(app)
49+
}
50+
}
51+
52+
static func activateApp(_ app: AppInstanceInspector) {
53+
// we prefer `.activate()` because it only brings the active window to the front
54+
if !app.activate() {
55+
activateAppElement(app.appElement)
4956
}
5057
}
58+
59+
static func activateAppElement(_ appElement: AXUIElement) {
60+
appElement.isFrontmost = true
61+
}
5162
}
5263

5364
struct ActivateThisAppDependencyKey: DependencyKey {

Tool/Sources/GitHubCopilotService/LanguageServer/GitHubCopilotRequest.swift

+1
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ enum GitHubCopilotRequest {
376376

377377
var source: GitHubCopilotChatSource? // inline or panel
378378
var workspaceFolder: String?
379+
var userLanguage: String?
379380
}
380381

381382
let requestBody: RequestBody

Tool/Sources/GitHubCopilotService/Services/GitHubCopilotChatService.swift

+8-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ public final class GitHubCopilotChatService: BuiltinExtensionChatServiceType {
4343
capabilities: .init(allSkills: false, skills: []),
4444
doc: doc,
4545
source: .panel,
46-
workspaceFolder: workspace.projectURL.path
46+
workspaceFolder: workspace.projectURL.path,
47+
userLanguage: {
48+
let language = UserDefaults.shared.value(for: \.chatGPTLanguage)
49+
if language.isEmpty {
50+
return "Auto Detected"
51+
}
52+
return language
53+
}()
4754
))
4855

4956
let stream = AsyncThrowingStream<String, Error> { continuation in

Tool/Sources/XcodeInspector/XcodeInspector+TriggerCommand.swift

+6-7
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ public extension AppInstanceInspector {
3030
guard path.count >= 2 else { throw cantRunCommand("Path too short.") }
3131

3232
if activateApp {
33-
appElement.isFrontmost = true
34-
// if !runningApplication.activate() {
35-
// Logger.service.error("""
36-
// Trigger menu item \(sourcePath): \
37-
// Xcode not activated.
38-
// """)
39-
// }
33+
if !runningApplication.isActive {
34+
// we prefer `.activate()` because it only brings the active window to the front
35+
if !activate() {
36+
appElement.isFrontmost = true
37+
}
38+
}
4039
} else {
4140
if !runningApplication.isActive {
4241
Logger.service.error("""

Version.xcconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
APP_VERSION = 0.35.2
2-
APP_BUILD = 429
1+
APP_VERSION = 0.35.3
2+
APP_BUILD = 430

0 commit comments

Comments
 (0)