[PATCH] D82626: [CodeComplete] Tweak completion for else.

2020-06-30 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8ba4867c2700: [CodeComplete] Tweak completion for else. (authored by njames93). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82626/new/ https://reviews.llv

[PATCH] D82626: [CodeComplete] Tweak completion for else.

2020-06-30 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. Nice, thanks for doing this! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82626/new/ https://reviews.llvm.org/D82626 _

[PATCH] D82626: [CodeComplete] Tweak completion for else.

2020-06-30 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 274469. njames93 added a comment. Address comments and add tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82626/new/ https://reviews.llvm.org/D82626 Files: clang/include/clang/Sema/Sema.h clang/lib/

[PATCH] D82626: [CodeComplete] Tweak completion for else.

2020-06-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. I like the behavior in this patch - I think multiple options is going to be distracting and crowd out other good results, and the heuristic seems pretty good. This needs a test in e.g. `llvm-project/clang/test/CodeCompletion/patterns.cpp`. Comment

[PATCH] D82626: [CodeComplete] Tweak completion for else.

2020-06-28 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. I'm still unsure what is the best behaviour here. Would suggesting both patterns, but sort them based on what the then branch uses be best Example with: if (...) { // Statements } Suggestions: - else { // Statements } - else if (...) { // Statements } -

[PATCH] D82626: [CodeComplete] Tweak completion for else.

2020-06-26 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: sammccall, kadircet. Herald added a project: clang. Herald added a subscriber: cfe-commits. If an `if` statement uses braces for its `then` block, suggest braces for the `else` and `else if` completion blocks, Otherwise don't suggest them.