<div dir="ltr">Yeah naming is a bit unfortunate, but this is also used in the logic for generating include header strings in clangd, see <a href="https://github.com/llvm-mirror/clang-tools-extra/blob/master/clangd/Headers.cpp#L196" class="cremed">https://github.com/llvm-mirror/clang-tools-extra/blob/master/clangd/Headers.cpp#L196</a>.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 4, 2019 at 9:29 AM Ilya Biryukov <<a href="mailto:ibiryukov@google.com">ibiryukov@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Stefan,<div><br></div><div>Thanks for reporting this. I don't think any of the active clangd developers run on Windows, so bugs like this can easily go unnoticed.</div><div>To add to what Kadir was requesting, could you point to a particular point in code that does the string comparison? If some of the strings come from user input (e.g. flags to the compiler), we should definitely normalize them before comparisons. </div><div><br></div><div><a class="gmail_plusreply" id="gmail-m_-2165536630058018329plusReplyChip-3" href="mailto:kadircet@google.com" target="_blank">@Kadir Çetinkaya</a>, does your change also cover non-diagnostic use-cases? The function name looks very diagnostic-specific</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 3, 2019 at 8:20 PM Stefan Lietzau via clangd-dev <<a href="mailto:clangd-dev@lists.llvm.org" target="_blank">clangd-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="DE"><div class="gmail-m_-2165536630058018329gmail-m_-7453554225128921951WordSection1"><p class="MsoNormal">Hi there,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="EN-US">I’m using clangd with vscode on windows with the option to add includes when autocompleting symbols. However the inserted include is always absolute, even if the file is present in the include path (compile-commands.json generated by CMake). I tracked the problem down to a path comparison where one path coming from the compilation database contains forward slashes and the other path (header where the symbol definition was found) contains backslashes. Since this is a simple string comparison it fails and determines the header is not part of the include directories.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">I don’t think the best fix would be to convert the paths before comparison or use a better comparison. Instead I think this is something that needs to be fixed deep inside clang tooling. That means I think the paths returned by the compilation database should be in a predictable format.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">What do you guys think?<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Kind regards<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:10pt;font-family:Arial,sans-serif">Stefan</span></b><span lang="EN-US" style="font-size:9pt;font-family:Arial,sans-serif;color:gray"><u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p></div></div>_______________________________________________<br>
clangd-dev mailing list<br>
<a href="mailto:clangd-dev@lists.llvm.org" target="_blank">clangd-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-2165536630058018329gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Ilya Biryukov</div></div></div></div></div>
</blockquote></div>