diff --git a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp --- a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp +++ b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp @@ -51,7 +51,11 @@ clangd::FuzzyFindRequest Marshaller::fromProtobuf(const FuzzyFindRequest *Request) { +<<<<<<< HEAD assert(RemoteIndexRoot); +======= + assert(LocalIndexRoot); +>>>>>>> 529b83e6cf3... [clangd] Don't send invalid messages from remote index clangd::FuzzyFindRequest Result; Result.Query = Request->query(); for (const auto &Scope : Request->scopes()) @@ -61,7 +65,11 @@ Result.Limit = Request->limit(); Result.RestrictForCodeCompletion = Request->restricted_for_code_completion(); for (const auto &Path : Request->proximity_paths()) { +<<<<<<< HEAD llvm::SmallString<256> LocalPath = llvm::StringRef(*RemoteIndexRoot); +======= + llvm::SmallString<256> LocalPath = llvm::StringRef(*LocalIndexRoot); +>>>>>>> 529b83e6cf3... [clangd] Don't send invalid messages from remote index llvm::sys::path::append(LocalPath, Path); Result.ProximityPaths.push_back(std::string(LocalPath)); } @@ -146,7 +154,11 @@ } FuzzyFindRequest Marshaller::toProtobuf(const clangd::FuzzyFindRequest &From) { +<<<<<<< HEAD assert(LocalIndexRoot); +======= + assert(RemoteIndexRoot); +>>>>>>> 529b83e6cf3... [clangd] Don't send invalid messages from remote index FuzzyFindRequest RPCRequest; RPCRequest.set_query(From.Query); for (const auto &Scope : From.Scopes) @@ -157,7 +169,11 @@ RPCRequest.set_restricted_for_code_completion(From.RestrictForCodeCompletion); for (const auto &Path : From.ProximityPaths) { llvm::SmallString<256> RelativePath = llvm::StringRef(Path); +<<<<<<< HEAD if (llvm::sys::path::replace_path_prefix(RelativePath, *LocalIndexRoot, +======= + if (llvm::sys::path::replace_path_prefix(RelativePath, *RemoteIndexRoot, +>>>>>>> 529b83e6cf3... [clangd] Don't send invalid messages from remote index "")) RPCRequest.add_proximity_paths(llvm::sys::path::convert_to_slash( RelativePath, llvm::sys::path::Style::posix)); diff --git a/clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp b/clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp --- a/clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp +++ b/clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp @@ -282,10 +282,17 @@ TEST(RemoteMarshallingTest, FuzzyFindRequestSerialization) { clangd::FuzzyFindRequest Request; +<<<<<<< HEAD Request.ProximityPaths = {testPath("local/Header.h"), testPath("local/subdir/OtherHeader.h"), testPath("remote/File.h"), "Not a Path."}; Marshaller ProtobufMarshaller(testPath("remote/"), testPath("local/")); +======= + Request.ProximityPaths = {testPath("remote/Header.h"), + testPath("remote/subdir/OtherHeader.h"), + testPath("notremote/File.h"), "Not a Path."}; + Marshaller ProtobufMarshaller(testPath("remote/"), testPath("home/")); +>>>>>>> 529b83e6cf3... [clangd] Don't send invalid messages from remote index auto Serialized = ProtobufMarshaller.toProtobuf(Request); EXPECT_EQ(Serialized.proximity_paths_size(), 2); auto Deserialized = ProtobufMarshaller.fromProtobuf(&Serialized);