Commit c3d0407d15

c3d0407d15423d8648d7d2e439b62a651bd6cfd7

parent: d3b4c6a386

Unsigned

cmc <hello@cleberg.net> · 2026-08-07 22:11 UTC

Fix Swift 6-mode isolation and attribute warnings

Under SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor these are warnings in Swift 5
mode and errors in Swift 6 mode:

- Drop @retroactive from 'extension LookupType: AppEnum'; LookupType is
  declared in this module, so the attribute never applied.
- Mark SyntaxHighlightTheme and SyntaxHighlighter nonisolated. They were
  inferred @MainActor but are built and used from the nonisolated markdown
  renderers in Task.detached; nonisolated makes the off-main confinement
  correct (Highlightr's JSContext was being driven off the main actor).

Layout: unified · split

Hutch/App/HutchIntents.swift +1 −1
@@ -337,7 +337,7 @@ struct CheckBuildsIntent: AppIntent {
337 337
338// MARK: - Search Type 338// MARK: - Search Type
339 339
340extension LookupType: @retroactive AppEnum { 340extension LookupType: AppEnum {
341 public nonisolated static var typeDisplayRepresentation: TypeDisplayRepresentation { 341 public nonisolated static var typeDisplayRepresentation: TypeDisplayRepresentation {
342 TypeDisplayRepresentation(name: "Search Type") 342 TypeDisplayRepresentation(name: "Search Type")
343 } 343 }
Hutch/Views/Repositories/SyntaxHighlighter.swift +2 −2
@@ -3,7 +3,7 @@ import Highlightr
3import SwiftUI 3import SwiftUI
4import UIKit 4import UIKit
5 5
6enum SyntaxHighlightTheme { 6nonisolated enum SyntaxHighlightTheme {
7 case light 7 case light
8 case dark 8 case dark
9 9
@@ -31,7 +31,7 @@ enum SyntaxHighlightTheme {
31/// instance must stay on the thread/task that created it. Callers that fail to 31/// instance must stay on the thread/task that created it. Callers that fail to
32/// resolve a language — or hit an unavailable engine — get `nil` and should 32/// resolve a language — or hit an unavailable engine — get `nil` and should
33/// fall back to plain, escaped text. 33/// fall back to plain, escaped text.
34final class SyntaxHighlighter { 34nonisolated final class SyntaxHighlighter {
35 private let highlightr: Highlightr? 35 private let highlightr: Highlightr?
36 private let supportedLanguages: Set<String> 36 private let supportedLanguages: Set<String>
37 37