Skip to content

Commit 3cae3be

Browse files
committed
Make things Sendable
1 parent 0157221 commit 3cae3be

9 files changed

Lines changed: 15 additions & 15 deletions

File tree

Tool/Sources/ChatBasic/ChatGPTFunction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public protocol ChatGPTFunction {
2121
typealias NoArguments = NoChatGPTFunctionArguments
2222
associatedtype Arguments: Decodable
2323
associatedtype Result: ChatGPTFunctionResult
24-
typealias ReportProgress = (String) async -> Void
24+
typealias ReportProgress = @Sendable (String) async -> Void
2525

2626
/// The name of this function.
2727
/// May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.

Tool/Sources/ChatContextCollector/ChatContextCollector.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import OpenAIService
44
import Parsing
55

66
public struct ChatContext {
7-
public enum Scope: String, Equatable, CaseIterable, Codable {
7+
public enum Scope: String, Equatable, CaseIterable, Codable, Sendable {
88
case file
99
case code
1010
case sense
1111
case project
1212
case web
1313
}
1414

15-
public struct RetrievedContent {
15+
public struct RetrievedContent: Sendable {
1616
public var document: ChatMessage.Reference
1717
public var priority: Int
1818

Tool/Sources/FocusedCodeFinder/ActiveDocumentContext.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import SuggestionBasic
33

4-
public struct ActiveDocumentContext {
4+
public struct ActiveDocumentContext: Sendable {
55
public var documentURL: URL
66
public var relativePath: String
77
public var language: CodeLanguage
@@ -13,8 +13,8 @@ public struct ActiveDocumentContext {
1313
public var imports: [String]
1414
public var includes: [String]
1515

16-
public struct FocusedContext {
17-
public struct Context: Equatable {
16+
public struct FocusedContext: Sendable {
17+
public struct Context: Equatable, Sendable {
1818
public var signature: String
1919
public var name: String
2020
public var range: CursorRange

Tool/Sources/OpenAIService/FucntionCall/ChatGPTFuntionProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public protocol ChatGPTFunctionProvider {
66
var functionCallStrategy: FunctionCallStrategy? { get }
77
}
88

9-
extension ChatGPTFunctionProvider {
9+
public extension ChatGPTFunctionProvider {
1010
func function(named: String) -> (any ChatGPTFunction)? {
1111
functions.first(where: { $0.name == named })
1212
}

Tool/Sources/SuggestionBasic/EditorInformation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import Foundation
22
import Parsing
33

4-
public struct EditorInformation {
5-
public struct LineAnnotation {
4+
public struct EditorInformation: Sendable {
5+
public struct LineAnnotation: Sendable {
66
public var type: String
77
public var line: Int
88
public var message: String
99
}
1010

11-
public struct SourceEditorContent {
11+
public struct SourceEditorContent: Sendable {
1212
/// The content of the source editor.
1313
public var content: String
1414
/// The content of the source editor in lines. Every line should ends with `\n`.

Tool/Sources/SuggestionBasic/ExportedFromLSP.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import LanguageServerProtocol
1+
@preconcurrency import LanguageServerProtocol
22

33
/// Line starts at 0.
44
public typealias CursorPosition = LanguageServerProtocol.Position

Tool/Sources/SuggestionBasic/LanguageIdentifierFromFilePath.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
2-
import LanguageServerProtocol
2+
@preconcurrency import LanguageServerProtocol
33

4-
public enum CodeLanguage: RawRepresentable, Codable, CaseIterable, Hashable {
4+
public enum CodeLanguage: RawRepresentable, Codable, CaseIterable, Hashable, Sendable {
55
case builtIn(LanguageIdentifier)
66
case plaintext
77
case other(String)

Tool/Sources/Workspace/Filespace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public struct FilespaceCodeMetadata: Equatable {
6262
}
6363

6464
@dynamicMemberLookup
65-
public final class Filespace {
65+
public final class Filespace: @unchecked Sendable {
6666
struct GitIgnoreStatus {
6767
var isIgnored: Bool
6868
var checkTime: Date

Tool/Sources/Workspace/Workspace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ open class WorkspacePlugin {
4949
}
5050

5151
@dynamicMemberLookup
52-
public final class Workspace {
52+
public final class Workspace: @unchecked Sendable {
5353
public struct UnsupportedFileError: Error, LocalizedError {
5454
public var extensionName: String
5555
public var errorDescription: String? {

0 commit comments

Comments
 (0)