Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 4 additions & 3 deletions Sources/SemanticIndex/PreparationTaskDescription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ package struct PreparationTaskDescription: IndexTaskDescription {
targetsToPrepare: [BuildTargetIdentifier],
buildSystemManager: BuildSystemManager,
preparationUpToDateTracker: UpToDateTracker<BuildTargetIdentifier, DummySecondaryKey>,
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
Expand Down
7 changes: 4 additions & 3 deletions Sources/SemanticIndex/SemanticIndexManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ package final actor SemanticIndexManager {
updateIndexStoreTimeout: Duration,
hooks: IndexHooks,
indexTaskScheduler: TaskScheduler<AnyIndexTaskDescription>,
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
) {
Expand Down
7 changes: 4 additions & 3 deletions Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ package struct UpdateIndexStoreTaskDescription: IndexTaskDescription {
index: UncheckedIndex,
indexStoreUpToDateTracker: UpToDateTracker<DocumentURI, BuildTargetIdentifier>,
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
) {
Expand Down
7 changes: 4 additions & 3 deletions Sources/SourceKitLSP/SourceKitLSPServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,10 @@ package actor SourceKitLSPServer {

private func handleRequest<RequestType: TextDocumentRequest>(
for request: RequestAndReply<RequestType>,
requestHandler: @Sendable @escaping (
RequestType, Workspace, LanguageService
) async throws ->
requestHandler:
@Sendable @escaping (
RequestType, Workspace, LanguageService
) async throws ->
RequestType.Response
) async {
await request.reply {
Expand Down
32 changes: 32 additions & 0 deletions Tests/SourceKitLSPTests/SemanticTokensTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: """
Expand Down