[clang-tools-extra] [clangd] Header not found error message now contains file path (PR #136096)

2025-04-17 Thread Tongsheng Wu via cfe-commits

https://github.com/tongshengw updated 
https://github.com/llvm/llvm-project/pull/136096

>From fa866721e59707060165d588d3797acd49792837 Mon Sep 17 00:00:00 2001
From: Tongsheng Wu 
Date: Thu, 17 Apr 2025 03:25:36 -0400
Subject: [PATCH] [clangd] Header not found error message now contains file
 path

---
 clang-tools-extra/clangd/IncludeCleaner.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/clang-tools-extra/clangd/IncludeCleaner.cpp 
b/clang-tools-extra/clangd/IncludeCleaner.cpp
index e34706172f0bf..dc4c8fc498b1f 100644
--- a/clang-tools-extra/clangd/IncludeCleaner.cpp
+++ b/clang-tools-extra/clangd/IncludeCleaner.cpp
@@ -345,8 +345,9 @@ include_cleaner::Includes convertIncludes(const ParsedAST 
&AST) {
 // which is based on FileManager::getCanonicalName(ParentDir).
 auto FE = SM.getFileManager().getFileRef(Inc.Resolved);
 if (!FE) {
-  elog("IncludeCleaner: Failed to get an entry for resolved path {0}: {1}",
-   Inc.Resolved, FE.takeError());
+  elog("IncludeCleaner: Failed to get an entry for resolved path '{0}' "
+   "from include {1} : {2}",
+   Inc.Resolved, Inc.Written, FE.takeError());
   continue;
 }
 TransformedInc.Resolved = *FE;

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clangd] Header not found error message now contains file path (PR #136096)

2025-04-17 Thread Tongsheng Wu via cfe-commits

https://github.com/tongshengw closed 
https://github.com/llvm/llvm-project/pull/136096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clangd] IncludeCleaner include not found error now contains path (PR #136237)

2025-04-17 Thread Tongsheng Wu via cfe-commits

https://github.com/tongshengw created 
https://github.com/llvm/llvm-project/pull/136237

IncludeCleaner header not found messages now show file path.

[https://github.com/clangd/clangd/issues/2334](https://github.com/clangd/clangd/issues/2334)

New error messages:
```
E[03:32:43.219] IncludeCleaner: Failed to get an entry for resolved path '' 
from include  : No such file or directory
E[03:32:43.219] IncludeCleaner: Failed to get an entry for resolved path '' 
from include "doesntexist.hpp" : No such file or directory
E[03:32:43.219] IncludeCleaner: Failed to get an entry for resolved path '' 
from include "/path/doesnt/exist" : No such file or directory
```
Old error messages:
```
E[03:34:47.752] IncludeCleaner: Failed to get an entry for resolved path : No 
such file or directory
```

>From f7ad18d99f42f303a8b298433f2e993cfe90f8ca Mon Sep 17 00:00:00 2001
From: Tongsheng Wu 
Date: Thu, 17 Apr 2025 21:39:27 -0400
Subject: [PATCH] [clangd] IncludeCleaner include not found error now contains
 path

---
 clang-tools-extra/clangd/IncludeCleaner.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/clang-tools-extra/clangd/IncludeCleaner.cpp 
b/clang-tools-extra/clangd/IncludeCleaner.cpp
index e34706172f0bf..dc4c8fc498b1f 100644
--- a/clang-tools-extra/clangd/IncludeCleaner.cpp
+++ b/clang-tools-extra/clangd/IncludeCleaner.cpp
@@ -345,8 +345,9 @@ include_cleaner::Includes convertIncludes(const ParsedAST 
&AST) {
 // which is based on FileManager::getCanonicalName(ParentDir).
 auto FE = SM.getFileManager().getFileRef(Inc.Resolved);
 if (!FE) {
-  elog("IncludeCleaner: Failed to get an entry for resolved path {0}: {1}",
-   Inc.Resolved, FE.takeError());
+  elog("IncludeCleaner: Failed to get an entry for resolved path '{0}' "
+   "from include {1} : {2}",
+   Inc.Resolved, Inc.Written, FE.takeError());
   continue;
 }
 TransformedInc.Resolved = *FE;

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clangd] Header not found error message now contains file path (PR #136096)

2025-04-17 Thread Tongsheng Wu via cfe-commits

https://github.com/tongshengw created 
https://github.com/llvm/llvm-project/pull/136096

IncludeCleaner header not found messages now show file path.

[https://github.com/clangd/clangd/issues/2334](https://github.com/clangd/clangd/issues/2334)

New error messages:
```
E[03:32:43.219] IncludeCleaner: Failed to get an entry for resolved path '' 
from include  : No such file or directory
E[03:32:43.219] IncludeCleaner: Failed to get an entry for resolved path '' 
from include "doesntexist.hpp" : No such file or directory
E[03:32:43.219] IncludeCleaner: Failed to get an entry for resolved path '' 
from include "/path/doesnt/exist" : No such file or directory
```
Old error messages:
```
E[03:34:47.752] IncludeCleaner: Failed to get an entry for resolved path : No 
such file or directory
```

>From fa866721e59707060165d588d3797acd49792837 Mon Sep 17 00:00:00 2001
From: Tongsheng Wu 
Date: Thu, 17 Apr 2025 03:25:36 -0400
Subject: [PATCH] [clangd] Header not found error message now contains file
 path

---
 clang-tools-extra/clangd/IncludeCleaner.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/clang-tools-extra/clangd/IncludeCleaner.cpp 
b/clang-tools-extra/clangd/IncludeCleaner.cpp
index e34706172f0bf..dc4c8fc498b1f 100644
--- a/clang-tools-extra/clangd/IncludeCleaner.cpp
+++ b/clang-tools-extra/clangd/IncludeCleaner.cpp
@@ -345,8 +345,9 @@ include_cleaner::Includes convertIncludes(const ParsedAST 
&AST) {
 // which is based on FileManager::getCanonicalName(ParentDir).
 auto FE = SM.getFileManager().getFileRef(Inc.Resolved);
 if (!FE) {
-  elog("IncludeCleaner: Failed to get an entry for resolved path {0}: {1}",
-   Inc.Resolved, FE.takeError());
+  elog("IncludeCleaner: Failed to get an entry for resolved path '{0}' "
+   "from include {1} : {2}",
+   Inc.Resolved, Inc.Written, FE.takeError());
   continue;
 }
 TransformedInc.Resolved = *FE;

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits