[clang-tools-extra] Add clangd-index-server support for cross platform indexes (PR #207202)

Aleksandr Platonov via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 8 23:55:33 PDT 2026


================
@@ -449,6 +449,39 @@ TEST(RemoteMarshallingTest, URIToRelativePathTranslation) {
   llvm::consumeError(RelativePath.takeError());
 }
 
+TEST(RemoteMarshallingTest, CrossPlatformPathsRoundTrip) {
+  llvm::BumpPtrAllocator Arena;
+  llvm::UniqueStringSaver Strings(Arena);
+
+  // Simulate a Windows-built index
+  Marshaller ProtobufMarshaller("C:/remote/project/",
----------------
ArcsinX wrote:

Maybe we can use backslash separator in Windows path to make sure everything works as expected with native Windows paths?

Also, I think it's better to put remote index path into a variable and reuse it in URI construction (i.e. `URI::createFile(RemoteIndexPath) + "lib/File.cpp"` instead of `"file:///C:/remote/project/lib/File.cpp"

https://github.com/llvm/llvm-project/pull/207202


More information about the cfe-commits mailing list