[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-30 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373197: [clangd] Implement a smart version of HeaderSource switch. (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:113 + auto Best = Candidates.begin(); + for (auto It = Candidates.begin(); It != Candidates.end(); ++It) { +if (It->second > Best->second) kadircet wrote: > nit:

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 222360. hokein marked 3 inline comments as done. hokein added a comment. address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67907/new/ https://reviews.llvm.org/D67907 Files:

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. thanks for formatting test cases, I had it in mind but forgot to mention in last round. LGTM Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:113 + auto

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 222112. hokein added a comment. format the testcases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67907/new/ https://reviews.llvm.org/D67907 Files: clang-tools-extra/clangd/HeaderSourceSwitch.cpp

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:86 + auto AwardTarget = [&](const char *TargetURI) { +if (auto TargetPath = URI::resolve(TargetURI, OriginalFile)) { + if (*TargetPath != OriginalFile) // exclude the original

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 222111. hokein marked 9 inline comments as done. hokein added a comment. address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67907/new/ https://reviews.llvm.org/D67907 Files:

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. mostly LG, a few small comments Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:86 + auto AwardTarget = [&](const char *TargetURI) { +if (auto TargetPath = URI::resolve(TargetURI, OriginalFile)) { + if (*TargetPath !=

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221724. hokein added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67907/new/ https://reviews.llvm.org/D67907 Files: clang-tools-extra/clangd/HeaderSourceSwitch.cpp

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221486. hokein marked 4 inline comments as done. hokein added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67907/new/ https://reviews.llvm.org/D67907 Files:

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:21 +// file. +class CollectIndexableLocalDecls { +public: kadircet wrote: > this class doesn't seem to have any state(apart from saving AST in > constructor and using it

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-23 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:21 +// file. +class CollectIndexableLocalDecls { +public: this class doesn't seem to have any state(apart from saving AST in constructor and using it in call to

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov, mgorny. Herald added a project: clang. hokein updated this revision to Diff 221288. hokein added a comment. Cleanup. This patch implements another

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221288. hokein added a comment. Cleanup. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67907/new/ https://reviews.llvm.org/D67907 Files: clang-tools-extra/clangd/CMakeLists.txt