<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/148370>148370</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clangd] clangd doesn't work with some file names with --experimental-modules-support option
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
FSK-idk
</td>
</tr>
</table>
<pre>
Here I have an example repo: https://github.com/FSK-idk/clangd-test
When I build the project and look at the file `somefile.cppm` in particular, I don't see any clangd info:
<img width="1332" height="306" alt="Image" src="https://github.com/user-attachments/assets/4c239d9c-95cf-4970-930b-62a59affeb72" />
However, if I do one of the following, the info will come back:
- comment `import std;` in the file `types.cppm`
- rename the file `somefile.cppm`, for example, to `asd.cppm` (or to some other name, but there is a chance that clangd will not work with the new name either)
- add a new file `asd.cppm` with the content `export module asd;` (same here, maybe some other name)
- remove `--experimental-modules-support` option (but then module info won't be available, but at least highlight will work)
Here is what it looks like if I rename `somefile.cppm` to `asd.cppm`:
<img width="1331" height="310" alt="Image" src="https://github.com/user-attachments/assets/544df3f1-65bd-4836-94d9-e56a712c1291" />
Versions
```
❯ clangd --version
clangd version 20.1.7
Features: linux
Platform: x86_64-pc-linux-gnu
❯ clang --version
clang version 20.1.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
I also tested it with 21.0.0git version I built today and got the same result.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VcFu4zYQ_Rr6MpBBUZZkHXzwbtbYoJcCXbTHghJHEhuKFEjKTv6-GEpOFk3rW4EAsR7JmTeP84YyBD1YxBMrv7DyaSeXODp_uvz2S6bVy6516u30HT3CM4zyiiAt4KucZoPgcXasOMMY4xxYcWbiwsRl0HFc2n3nJiYuWxgmLp2RdlBZxBAZPzN-_mNEC8_QLtooiCPC7N1f2EWQVoFx7gVkTHivDQKreHAT0u99N88Tqzh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