Skip to content

Commit c340e63

Browse files
committed
Fix an issue that caused a precondition to be hit when an unknown request was sent to sourcekit-lsp
When sending an unknonw request to sourcekit-lsp, we directly called back `reply` and never set `replied` to `true` on the `RequestAndReply` object. This caused a preconditon to be hit when the `RequestAndReply` object got destroyed.
1 parent b48a9ca commit c340e63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SourceKitLSP/SourceKitServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ extension SourceKitServer: MessageHandler {
921921
await self.handleRequest(for: request, requestHandler: self.prepareRename)
922922
// IMPORTANT: When adding a new entry to this switch, also add it to the `TaskMetadata` initializer.
923923
default:
924-
reply(.failure(ResponseError.methodNotFound(R.method)))
924+
await request.reply { throw ResponseError.methodNotFound(R.method) }
925925
}
926926
}
927927
}

0 commit comments

Comments
 (0)