[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-19 Thread Sam McCall via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rCTE322945: [clangd] Merge index-provided completions with those from Sema. (authored by sammccall, committed by ). Changed

[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-19 Thread Sam McCall via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. sammccall marked an inline comment as done. Closed by commit rL322945: [clangd] Merge index-provided completions with those from Sema. (autho

[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-19 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 2 inline comments as done. sammccall added inline comments. Comment at: clangd/CodeComplete.cpp:308 +return None; + } +} hokein wrote: > add `return None` to make compiler happier? I think it might trigger > -Wreturn-type warning. added llv

[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-19 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Oops, I forgot to submit comments with my last update. I don't think there's anything surprising so I'll land this, but let me know if you want any changes! Comment at: clangd/CodeComplete.cpp:339 + std::vector Results; + CodeCompletionContext CCCo

[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. looks good to me too, just a few nits. Comment at: clangd/CodeComplete.cpp:308 +return None; + } +} add `return None` to make compiler happier? I think it might trigger -Wreturn-type warning. Comment at: clangd/C

[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. LGTM Comment at: clangd/CodeComplete.cpp:743 + int NSema = 0, NIndex = 0, NBoth = 0; // Counters for logging. + bool Incomplete = false; + llvm::Optional Filter; // Initialized once Sema runs. `InComplete` can probably be output varia

[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 130440. sammccall added a comment. Converted the big codeComplete function to a CodeCompleteFlow class Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D42181 Files: clangd/CodeComplete.cpp clangd/FuzzyMatch.h unittests/clangd/CodeComp

[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 130417. sammccall marked 7 inline comments as done. sammccall added a comment. Addressed review comments, except for "refactor into class" which is still todo. Added explicit check of code completion context kind. Added tests (mostly updating existing ones).

[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Herald added a reviewer: jkorous-apple. Overall looks good! Some ideas about code structure inlined. Comment at: clangd/CodeComplete.cpp:327 +// The CompletionRecorder captures Sema code-complete output, including context. +// It filters out ignored res

[PATCH] D42181: [clangd] Merge index-provided completions with those from Sema.

2018-01-17 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: ioeric. Herald added subscribers: cfe-commits, mgrang, ilya-biryukov, klimek. - we match on USR, and do a field-by-field merge if both have results - scoring is post-merge, with both sets of information available (for now, sema priority