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
2 changes: 1 addition & 1 deletion llvm/lib/Support/LSP/Transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool MessageHandler::onReply(llvm::json::Value Id,
// mapping and erase it.
ResponseHandlerTy ResponseHandler;
{
std::lock_guard<std::mutex> responseHandlersLock(ResponseHandlerTy);
std::lock_guard<std::mutex> responseHandlersLock(ResponseHandlersMutex);
auto It = ResponseHandlers.find(debugString(Id));
if (It != ResponseHandlers.end()) {
ResponseHandler = std::move(It->second);
Expand Down
6 changes: 3 additions & 3 deletions llvm/unittests/Support/LSP/Transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ TEST_F(TransportInputTest, OutgoingRequest) {

TEST_F(TransportInputTest, OutgoingRequestJSONParseFailure) {
// Make an outgoing request that expects a failure response.
bool responseCallbackInvoked = false;
unsigned responseCallbackInvoked = 0;
auto callFn = getMessageHandler().outgoingRequest<CompletionList, Position>(
"outgoing-request-json-parse-failure",
[&responseCallbackInvoked](const llvm::json::Value &id,
Expand All @@ -190,7 +190,7 @@ TEST_F(TransportInputTest, OutgoingRequestJSONParseFailure) {
responseCallbackInvoked += 1;
});
callFn({}, 109);
EXPECT_EQ(responseCallbackInvoked, 0);
EXPECT_EQ(responseCallbackInvoked, 0u);

// The request receives multiple responses, but only the first one triggers
// the response callback. The first response has erroneous JSON that causes a
Expand All @@ -200,6 +200,6 @@ TEST_F(TransportInputTest, OutgoingRequestJSONParseFailure) {
"{\"jsonrpc\":\"2.0\",\"id\":109,\"result\":{\"line\":3,"
"\"character\":2}}\n");
runTransport();
EXPECT_EQ(responseCallbackInvoked, 1);
EXPECT_EQ(responseCallbackInvoked, 1u);
}
} // namespace