[clangd-dev] Completion of #include statements

Sam McCall via clangd-dev clangd-dev at lists.llvm.org
Fri Sep 14 13:33:58 PDT 2018


Ok so I seem to have tricked myself into trying it, when I really should
have been doing something else.

https://reviews.llvm.org/D52076 in case anyone's interested, feedback
welcome. (No clangd changes required)

On Thu, Sep 13, 2018, 22:41 Doug Schaefer via clangd-dev <
clangd-dev at lists.llvm.org> wrote:

> Eclipse CDT does that, actually one of the features I miss when using
> clangd.
>
>
>
> CDT keeps it pretty simple. It searches each directory in the include
> path, including “.” for quoted includes. It uses Java’s File.listFiles()
> which I’m pretty sure is a readdir. Performs well.
>
>
>
> Unfortunately, I don’t know clang well enough at this point to know how it
> should be done though.
>
>
>
> Doug.
>
>
>
>
>
> *From:* clangd-dev <clangd-dev-bounces at lists.llvm.org> * On Behalf Of *Sam
> McCall via clangd-dev
> *Sent:* Thursday, September 13, 2018 7:18 AM
> *To:* clangd-dev at lists.llvm.org
> *Subject:* [clangd-dev] Completion of #include statements
>
>
>
> I was reminded by https://reviews.llvm.org/D51333 that I'd been meaning
> to look at adding completion of filenames inside #include directives.
>
> I won't have time soon sadly :-(
>
>
>
> I don't think there's anything clangd-specific here, so it should probably
> come through the SemaCodeComplete API. I don't have much of a clue about
> the sema/PP interaction required though.
>
>
>
> It requires listing all the include dirs, don't know if that would be
> prohibitively slow. I'd guess not: today it requires stat()ing every file
> on unix, but after https://reviews.llvm.org/D51921 it should just be
> readdir().
>
>
>
> Anyone want to pick this up, or have ideas/guidance about the
> implementation?
>
>
>
> Cheers, Sam
> _______________________________________________
> clangd-dev mailing list
> clangd-dev at lists.llvm.org
> http://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/20180914/c175e6ee/attachment.html>


More information about the clangd-dev mailing list