diff --git a/Sources/SemanticIndex/PreparationTaskDescription.swift b/Sources/SemanticIndex/PreparationTaskDescription.swift index 841c81bf1..b4262d7b7 100644 --- a/Sources/SemanticIndex/PreparationTaskDescription.swift +++ b/Sources/SemanticIndex/PreparationTaskDescription.swift @@ -63,9 +63,10 @@ package struct PreparationTaskDescription: IndexTaskDescription { targetsToPrepare: [BuildTargetIdentifier], buildSystemManager: BuildSystemManager, preparationUpToDateTracker: UpToDateTracker, - logMessageToIndexLog: @escaping @Sendable ( - _ message: String, _ type: WindowMessageType, _ structure: StructuredLogKind - ) -> Void, + logMessageToIndexLog: + @escaping @Sendable ( + _ message: String, _ type: WindowMessageType, _ structure: StructuredLogKind + ) -> Void, hooks: IndexHooks ) { self.targetsToPrepare = targetsToPrepare diff --git a/Sources/SemanticIndex/SemanticIndexManager.swift b/Sources/SemanticIndex/SemanticIndexManager.swift index 9699a480f..67257cd2f 100644 --- a/Sources/SemanticIndex/SemanticIndexManager.swift +++ b/Sources/SemanticIndex/SemanticIndexManager.swift @@ -261,9 +261,10 @@ package final actor SemanticIndexManager { updateIndexStoreTimeout: Duration, hooks: IndexHooks, indexTaskScheduler: TaskScheduler, - logMessageToIndexLog: @escaping @Sendable ( - _ message: String, _ type: WindowMessageType, _ structure: StructuredLogKind - ) -> Void, + logMessageToIndexLog: + @escaping @Sendable ( + _ message: String, _ type: WindowMessageType, _ structure: StructuredLogKind + ) -> Void, indexTasksWereScheduled: @escaping @Sendable (Int) -> Void, indexProgressStatusDidChange: @escaping @Sendable () -> Void ) { diff --git a/Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift b/Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift index 319341b71..7bd2362c9 100644 --- a/Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift +++ b/Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift @@ -146,9 +146,10 @@ package struct UpdateIndexStoreTaskDescription: IndexTaskDescription { index: UncheckedIndex, indexStoreUpToDateTracker: UpToDateTracker, indexFilesWithUpToDateUnit: Bool, - logMessageToIndexLog: @escaping @Sendable ( - _ message: String, _ type: WindowMessageType, _ structure: StructuredLogKind - ) -> Void, + logMessageToIndexLog: + @escaping @Sendable ( + _ message: String, _ type: WindowMessageType, _ structure: StructuredLogKind + ) -> Void, timeout: Duration, hooks: IndexHooks ) { diff --git a/Sources/SourceKitLSP/SourceKitLSPServer.swift b/Sources/SourceKitLSP/SourceKitLSPServer.swift index e21bffc95..1dd4aee1b 100644 --- a/Sources/SourceKitLSP/SourceKitLSPServer.swift +++ b/Sources/SourceKitLSP/SourceKitLSPServer.swift @@ -390,9 +390,10 @@ package actor SourceKitLSPServer { private func handleRequest( for request: RequestAndReply, - requestHandler: @Sendable @escaping ( - RequestType, Workspace, LanguageService - ) async throws -> + requestHandler: + @Sendable @escaping ( + RequestType, Workspace, LanguageService + ) async throws -> RequestType.Response ) async { await request.reply { diff --git a/Tests/SourceKitLSPTests/SemanticTokensTests.swift b/Tests/SourceKitLSPTests/SemanticTokensTests.swift index 8d56723ac..6740196d1 100644 --- a/Tests/SourceKitLSPTests/SemanticTokensTests.swift +++ b/Tests/SourceKitLSPTests/SemanticTokensTests.swift @@ -881,6 +881,38 @@ final class SemanticTokensTests: XCTestCase { ) } + func testRawIdentifier() async throws { + try await assertSemanticTokens( + markedContents: """ + 1️⃣func 2️⃣`square returns x * x`() {} + 3️⃣`square returns x * x`() + """, + expected: [ + TokenSpec(marker: "1️⃣", length: 4, kind: .keyword), + TokenSpec(marker: "2️⃣", length: 22, kind: .identifier), + TokenSpec(marker: "3️⃣", length: 22, kind: .function), + ] + ) + try await assertSemanticTokens( + markedContents: """ + 1️⃣struct 2️⃣S { + 3️⃣static 4️⃣var 5️⃣`foo bar` = 6️⃣0 + } + 7️⃣S.8️⃣`foo bar` + """, + expected: [ + TokenSpec(marker: "1️⃣", length: 6, kind: .keyword), + TokenSpec(marker: "2️⃣", length: 1, kind: .identifier), + TokenSpec(marker: "3️⃣", length: 6, kind: .keyword), + TokenSpec(marker: "4️⃣", length: 3, kind: .keyword), + TokenSpec(marker: "5️⃣", length: 9, kind: .identifier), + TokenSpec(marker: "6️⃣", length: 1, kind: .number), + TokenSpec(marker: "7️⃣", length: 1, kind: .struct), + TokenSpec(marker: "8️⃣", length: 9, kind: .property), + ] + ) + } + func testClang() async throws { try await assertSemanticTokens( markedContents: """