[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE325523: [clangd] Fixes for #include insertion. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D43462?vs=134947=134952#toc Repository: rL LLVM

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL325523: [clangd] Fixes for #include insertion. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D43462 Files:

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 134947. ioeric added a comment. - assert in the very beginning! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43462 Files: clangd/ClangdServer.cpp clangd/Headers.cpp clangd/Headers.h clangd/index/CanonicalIncludes.cpp

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 134944. ioeric marked 2 inline comments as done. ioeric added a comment. - added a comment about thread safety Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43462 Files: clangd/ClangdServer.cpp clangd/Headers.cpp clangd/Headers.h

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric marked 5 inline comments as done. ioeric added inline comments. Comment at: clangd/Headers.cpp:60 Argv.push_back(S.c_str()); IgnoringDiagConsumer IgnoreDiags; auto CI = clang::createInvocationFromCommandLine( ilya-biryukov wrote: > Not related

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 134943. ioeric marked 3 inline comments as done. ioeric added a comment. - addressed comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43462 Files: clangd/ClangdServer.cpp clangd/Headers.cpp clangd/Headers.h

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/index/CanonicalIncludes.cpp:21 llvm::StringRef CanonicalPath) { addRegexMapping((llvm::Twine("^") + llvm::Regex::escape(Path) + "$").str(), CanonicalPath);

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/Headers.cpp:60 Argv.push_back(S.c_str()); IgnoringDiagConsumer IgnoreDiags; auto CI = clang::createInvocationFromCommandLine( Not related to this patch, but just noticed that we don't call

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/Headers.h:26 /// /// \param Header is an absolute file path. +/// \return A quoted "path" or . This returns an empty string if: File also needs to be absolute. (May want to add asserts for this at the start

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 134932. ioeric marked 6 inline comments as done. ioeric added a comment. - Stop indexing main files in dynamic index; addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43462 Files: clangd/ClangdServer.cpp

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Headers.cpp:45 +bool hasHeaderExtension(PathRef Path) { + constexpr static const char *HeaderExtensions[] = {".h", ".hpp", ".hh", + ".hxx"}; ilya-biryukov

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/Headers.cpp:42-43 }; +/// Returns true if \p Path has header extensions like .h and .hpp etc. +bool hasHeaderExtension(PathRef Path) { As discussed offline, this seems dubious. - this is probably the

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/Headers.cpp:45 +bool hasHeaderExtension(PathRef Path) { + constexpr static const char *HeaderExtensions[] = {".h", ".hpp", ".hh", + ".hxx"}; There is

[PATCH] D43462: [clangd] Fixes for #include insertion.

2018-02-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: sammccall, ilya-biryukov. Herald added subscribers: cfe-commits, jkorous-apple, klimek. o Avoid inserting a header include into the header itself. o Avoid inserting non-header files. o Canonicalize include paths for symbols in dynamic index.