[clangd-dev] Automatically adding includes always inserts the full path on windows
Kadir Çetinkaya via clangd-dev
clangd-dev at lists.llvm.org
Tue Jun 4 00:26:31 PDT 2019
Hi Stefan,
What is the version of clangd you are using? I believe this issue should be
fixed with https://reviews.llvm.org/D60995 which wasn't included in
clangd-8 release, so you should get a new clangd build.
If you are already using a clangd built from top of the head, could you
share the compile command for the file and full path for the header you are
including?
Have a nice day!
On Mon, Jun 3, 2019 at 8:20 PM Stefan Lietzau via clangd-dev <
clangd-dev at lists.llvm.org> wrote:
> Hi there,
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> What do you guys think?
>
>
>
> Kind regards
>
>
>
> *Stefan*
>
>
> _______________________________________________
> clangd-dev mailing list
> clangd-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20190604/9f37fc20/attachment.html>
More information about the clangd-dev
mailing list