Skip to content

Commit b5a2e2a

Browse files
committed
Remove some warnings
1 parent 9e2a109 commit b5a2e2a

File tree

11 files changed

+70
-23
lines changed

11 files changed

+70
-23
lines changed

Core/Sources/ChatGPTChatTab/Chat.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ struct Chat {
129129
var body: some ReducerOf<Self> {
130130
BindingReducer()
131131

132-
Scope(state: \.chatMenu, action: /Action.chatMenu) {
132+
Scope(state: \.chatMenu, action: \.chatMenu) {
133133
ChatMenu(service: service)
134134
}
135135

Core/Sources/ChatGPTChatTab/CodeBlockHighlighter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct AsyncCodeBlockView: View {
4141
let content = view.content
4242
let language = view.fenceInfo ?? ""
4343
let brightMode = view.colorScheme != .dark
44-
let font = view.font
44+
let font = CodeHighlighting.SendableFont(font: view.font)
4545
highlightTask = Task {
4646
let string = await withUnsafeContinuation { continuation in
4747
Self.queue.async {
@@ -50,7 +50,7 @@ struct AsyncCodeBlockView: View {
5050
language: language,
5151
scenario: "chat",
5252
brightMode: brightMode,
53-
font: font
53+
font:font
5454
)
5555
continuation.resume(returning: AttributedString(content))
5656
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct SuggestionSettingsGeneralSectionView: View {
6868
refreshExtensionSuggestionFeatureProviders()
6969
}
7070
refreshExtensionSuggestionFeatureProvidersTask = Task { [weak self] in
71-
let sequence = await NotificationCenter.default
71+
let sequence = NotificationCenter.default
7272
.notifications(named: NSApplication.didBecomeActiveNotification)
7373
for await _ in sequence {
7474
guard let self else { return }

Core/Sources/HostApp/HostApp.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ struct HostApp {
3434
}
3535

3636
var body: some ReducerOf<Self> {
37-
Scope(state: \.general, action: /Action.general) {
37+
Scope(state: \.general, action: \.general) {
3838
General()
3939
}
4040

41-
Scope(state: \.chatModelManagement, action: /Action.chatModelManagement) {
41+
Scope(state: \.chatModelManagement, action: \.chatModelManagement) {
4242
ChatModelManagement()
4343
}
4444

45-
Scope(state: \.embeddingModelManagement, action: /Action.embeddingModelManagement) {
45+
Scope(state: \.embeddingModelManagement, action: \.embeddingModelManagement) {
4646
EmbeddingModelManagement()
4747
}
4848

Core/Sources/HostApp/SharedComponents/CodeHighlightThemePicker.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public struct CodeHighlightThemePicker: View {
6565
}
6666

6767
#Preview {
68-
@State var sync = false
69-
return CodeHighlightThemePicker.SyncToggle(sync: $sync)
68+
CodeHighlightThemePicker.SyncToggle(sync: .constant(true))
69+
CodeHighlightThemePicker.SyncToggle(sync: .constant(false))
7070
}
7171

Core/Sources/Service/XPCService.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,13 @@ public class XPCService: NSObject, XPCServiceProtocol {
210210
requestBody: Data,
211211
reply: @escaping (Data?, Error?) -> Void
212212
) {
213-
Service.shared.handleXPCServiceRequests(
214-
endpoint: endpoint,
215-
requestBody: requestBody,
216-
reply: reply
217-
)
213+
Task {
214+
await Service.shared.handleXPCServiceRequests(
215+
endpoint: endpoint,
216+
requestBody: requestBody,
217+
reply: reply
218+
)
219+
}
218220
}
219221
}
220222

Core/Sources/SuggestionWidget/WidgetWindowsController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ actor WidgetWindowsController: NSObject {
1717
let userDefaultsObservers = WidgetUserDefaultsObservers()
1818
var xcodeInspector: XcodeInspector { .shared }
1919
20-
let windows: WidgetWindows
20+
nonisolated let windows: WidgetWindows
2121
let store: StoreOf<Widget>
2222
let chatTabPool: ChatTabPool
2323

ExtensionService/AppDelegate+Menu.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,13 @@ private extension AppDelegate {
240240
@objc func openExtensionManager() {
241241
guard let data = try? JSONEncoder().encode(ExtensionServiceRequests.OpenExtensionManager())
242242
else { return }
243-
service.handleXPCServiceRequests(
244-
endpoint: ExtensionServiceRequests.OpenExtensionManager.endpoint,
245-
requestBody: data,
246-
reply: { _, _ in }
247-
)
243+
Task {
244+
await service.handleXPCServiceRequests(
245+
endpoint: ExtensionServiceRequests.OpenExtensionManager.endpoint,
246+
requestBody: data,
247+
reply: { _, _ in }
248+
)
249+
}
248250
}
249251
}
250252

Tool/Sources/AXExtension/AXUIElement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,5 +320,5 @@ public extension AXUIElement {
320320
}
321321
}
322322

323-
extension AXError: Error {}
323+
extension AXError: @retroactive Error {}
324324

Tool/Sources/SharedUIComponents/AsyncCodeBlock.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public struct AsyncCodeBlock: View { // chat: hid
134134
// MARK: - Storage
135135

136136
extension AsyncCodeBlock {
137-
static let queue = DispatchQueue(
137+
nonisolated static let queue = DispatchQueue(
138138
label: "code-block-highlight",
139139
qos: .userInteractive,
140140
attributes: .concurrent
@@ -409,6 +409,7 @@ extension AsyncCodeBlock {
409409
let scenario = view.scenario
410410
let brightMode = view.colorScheme != .dark
411411
let droppingLeadingSpaces = view.droppingLeadingSpaces
412+
let font = CodeHighlighting.SendableFont(font: view.font)
412413
foregroundColor = view.foregroundColor
413414

414415
if highlightedCode.isEmpty {
@@ -427,7 +428,6 @@ extension AsyncCodeBlock {
427428
highlightTask = Task {
428429
let result = await withUnsafeContinuation { continuation in
429430
AsyncCodeBlock.queue.async {
430-
let font = view.font
431431
let content = CodeHighlighting.highlighted(
432432
code: code,
433433
language: language,

0 commit comments

Comments
 (0)