[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344688: [clangd] Support scope proximity in code completion. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D53131 Files:

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169983. ioeric added a comment. - rebase Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/AST.cpp clangd/AST.h clangd/CodeComplete.cpp clangd/FileDistance.cpp clangd/FileDistance.h clangd/Quality.cpp clangd/Qu

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169982. ioeric marked an inline comment as done. ioeric added a comment. - address comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/AST.cpp clangd/AST.h clangd/CodeComplete.cpp clangd/FileDistance.cpp cla

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Awesome! Just nits. Comment at: clangd/CodeComplete.cpp:1224 std::vector QueryScopes; // Initialized once Sema runs. + // Initialized once QueryScopes is initialize

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169962. ioeric marked 18 inline comments as done. ioeric added a comment. - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/AST.cpp clangd/AST.h clangd/CodeComplete.cpp clangd/FileDistanc

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the suggestions! After taking a closer look at boosting factors for other signals, I think I was being too conservative about boosting preferred scopes and penalizing non-preferred ones. I have tuned the parameters to make these more aggressive now according t

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/AST.cpp:77 + for (const auto *Ctx = &DC; Ctx != nullptr; Ctx = Ctx->getParent()) +if (const auto *NS = dyn_cast(Ctx)) + if (!NS->isAnonymousNamespace() && !NS->isInlineNamespace()) It would be nice to

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169814. ioeric marked 3 inline comments as done. ioeric added a comment. - refactor to use FileDistance and address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/AST.cpp clangd/AST.h clangd/CodeCom

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. (BTW I wouldn't expect to see improvements on eval here, as Comment at: clangd/CodeComplete.cpp:558 +if (const auto *NS = dyn_cast(Ctx)) + return NS->getQualifiedNameAsString() + "::"; + return llvm::None; ioeric wrote: > sa

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/CodeComplete.cpp:558 +if (const auto *NS = dyn_cast(Ctx)) + return NS->getQualifiedNameAsString() + "::"; + return llvm::None; sammccall wrote: > does this do the right thing if it's anonymous or inline,

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 169231. ioeric marked 2 inline comments as done. ioeric added a comment. - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53131 Files: clangd/CodeComplete.cpp clangd/Quality.cpp clangd/Quality.h unittests/clan

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-11 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/CodeComplete.cpp:558 +if (const auto *NS = dyn_cast(Ctx)) + return NS->getQualifiedNameAsString() + "::"; + return llvm::None; does this do the right thing if it's anonymous or inline, or a parent is?

[PATCH] D53131: [clangd] Support scope proximity in code completion.

2018-10-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. This should make all-scope completion more usable. Scope proximity for indexes will be added in followup patch. Measurements showed a slig