Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make things Sendable
  • Loading branch information
intitni committed Oct 20, 2025
commit 3cae3be6691e8c777bc63e993d492c3138f89b07
2 changes: 1 addition & 1 deletion Tool/Sources/ChatBasic/ChatGPTFunction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public protocol ChatGPTFunction {
typealias NoArguments = NoChatGPTFunctionArguments
associatedtype Arguments: Decodable
associatedtype Result: ChatGPTFunctionResult
typealias ReportProgress = (String) async -> Void
typealias ReportProgress = @Sendable (String) async -> Void

/// The name of this function.
/// May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
Expand Down
4 changes: 2 additions & 2 deletions Tool/Sources/ChatContextCollector/ChatContextCollector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import OpenAIService
import Parsing

public struct ChatContext {
public enum Scope: String, Equatable, CaseIterable, Codable {
public enum Scope: String, Equatable, CaseIterable, Codable, Sendable {
case file
case code
case sense
case project
case web
}

public struct RetrievedContent {
public struct RetrievedContent: Sendable {
public var document: ChatMessage.Reference
public var priority: Int

Expand Down
6 changes: 3 additions & 3 deletions Tool/Sources/FocusedCodeFinder/ActiveDocumentContext.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import SuggestionBasic

public struct ActiveDocumentContext {
public struct ActiveDocumentContext: Sendable {
public var documentURL: URL
public var relativePath: String
public var language: CodeLanguage
Expand All @@ -13,8 +13,8 @@ public struct ActiveDocumentContext {
public var imports: [String]
public var includes: [String]

public struct FocusedContext {
public struct Context: Equatable {
public struct FocusedContext: Sendable {
public struct Context: Equatable, Sendable {
public var signature: String
public var name: String
public var range: CursorRange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public protocol ChatGPTFunctionProvider {
var functionCallStrategy: FunctionCallStrategy? { get }
}

extension ChatGPTFunctionProvider {
public extension ChatGPTFunctionProvider {
func function(named: String) -> (any ChatGPTFunction)? {
functions.first(where: { $0.name == named })
}
Expand Down
6 changes: 3 additions & 3 deletions Tool/Sources/SuggestionBasic/EditorInformation.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import Foundation
import Parsing

public struct EditorInformation {
public struct LineAnnotation {
public struct EditorInformation: Sendable {
public struct LineAnnotation: Sendable {
public var type: String
public var line: Int
public var message: String
}

public struct SourceEditorContent {
public struct SourceEditorContent: Sendable {
/// The content of the source editor.
public var content: String
/// The content of the source editor in lines. Every line should ends with `\n`.
Expand Down
2 changes: 1 addition & 1 deletion Tool/Sources/SuggestionBasic/ExportedFromLSP.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import LanguageServerProtocol
@preconcurrency import LanguageServerProtocol

/// Line starts at 0.
public typealias CursorPosition = LanguageServerProtocol.Position
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import LanguageServerProtocol
@preconcurrency import LanguageServerProtocol

public enum CodeLanguage: RawRepresentable, Codable, CaseIterable, Hashable {
public enum CodeLanguage: RawRepresentable, Codable, CaseIterable, Hashable, Sendable {
case builtIn(LanguageIdentifier)
case plaintext
case other(String)
Expand Down
2 changes: 1 addition & 1 deletion Tool/Sources/Workspace/Filespace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public struct FilespaceCodeMetadata: Equatable {
}

@dynamicMemberLookup
public final class Filespace {
public final class Filespace: @unchecked Sendable {
struct GitIgnoreStatus {
var isIgnored: Bool
var checkTime: Date
Expand Down
2 changes: 1 addition & 1 deletion Tool/Sources/Workspace/Workspace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ open class WorkspacePlugin {
}

@dynamicMemberLookup
public final class Workspace {
public final class Workspace: @unchecked Sendable {
public struct UnsupportedFileError: Error, LocalizedError {
public var extensionName: String
public var errorDescription: String? {
Expand Down