kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, 
ilya-biryukov.
Herald added a project: clang.
kadircet added a child revision: D60873: [clang][HeaderSuggestion] Handle the 
case of dotdot with an absolute path.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60995

Files:
  clang-tools-extra/clangd/Headers.cpp


Index: clang-tools-extra/clangd/Headers.cpp
===================================================================
--- clang-tools-extra/clangd/Headers.cpp
+++ clang-tools-extra/clangd/Headers.cpp
@@ -193,8 +193,10 @@
   bool IsSystem = false;
   if (!HeaderSearchInfo)
     return "\"" + InsertedHeader.File + "\"";
-  std::string Suggested = HeaderSearchInfo->suggestPathToFileForDiagnostics(
-      InsertedHeader.File, BuildDir, &IsSystem);
+  // Suggest path might contain back slashes on windows.
+  std::string Suggested = llvm::sys::path::convert_to_slash(
+      HeaderSearchInfo->suggestPathToFileForDiagnostics(InsertedHeader.File,
+                                                        BuildDir, &IsSystem));
   if (IsSystem)
     Suggested = "<" + Suggested + ">";
   else


Index: clang-tools-extra/clangd/Headers.cpp
===================================================================
--- clang-tools-extra/clangd/Headers.cpp
+++ clang-tools-extra/clangd/Headers.cpp
@@ -193,8 +193,10 @@
   bool IsSystem = false;
   if (!HeaderSearchInfo)
     return "\"" + InsertedHeader.File + "\"";
-  std::string Suggested = HeaderSearchInfo->suggestPathToFileForDiagnostics(
-      InsertedHeader.File, BuildDir, &IsSystem);
+  // Suggest path might contain back slashes on windows.
+  std::string Suggested = llvm::sys::path::convert_to_slash(
+      HeaderSearchInfo->suggestPathToFileForDiagnostics(InsertedHeader.File,
+                                                        BuildDir, &IsSystem));
   if (IsSystem)
     Suggested = "<" + Suggested + ">";
   else
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to