<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/98852>98852</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clangd] IWYU pragma only works on top-level includes
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yshui
</td>
</tr>
</table>
<pre>
This works:
```c++
#include "unused.h" // IWYU pragma: keep
```
But this doesn't:
```c++
namespace N {
#include "unused.h" // IWYU pragma: keep
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykkkGL5C4QxT9N5SIdTCXG5OBhmibwv_xPuyx71KQ2ccdoiNpDf_sl6Vl2mNPCQqGgWO_ne6VjtLMnUiCuIG6FzmkJu3rEJdvChOmhviw2srewv0aoX4DfgP9eW_6sEfB61PMUa-tHlydigJh9jjSVCyAywAFwYP99-_6VbbueVw31C3sl2j71-yhyzYmlg2AKFD2gTH9F4fVKcdMjsf8ZyH9Hk7dPasWk6qmve12QqiRWnHeir4pFjYZMJ1scaTRcNr2R3NS8FQ3vBK9-9IVVyLHhshK8Em1dlT0ao00tGzFNsm16aDit2rrSuftahn0ubIyZVN91AgunDbl4xoXo6Y2dl4B4pLer483F5DlCw52NKf7pkmxyZ86j036eQNw-fpgF7x7PnFnwLIXt4uhOjr1bFou8O7WktJ1zcBo227RkU45hBRwOnfftsu3hJ40JcDjpIuDwpL8r_BUAAP__1Ym2PA">