[clang] Implement Override Suggestions in Sema.
authorKadir Cetinkaya <kadircet@google.com>
Tue, 2 Oct 2018 09:42:31 +0000 (09:42 +0000)
committerKadir Cetinkaya <kadircet@google.com>
Tue, 2 Oct 2018 09:42:31 +0000 (09:42 +0000)
commitae45d0a4fd772a01aeacc3d25891c4ead8acbc9a
treeabe2302ea73af66242836af758ce6c790c741dd0
parentb15b8dce3979651e6bfe2697ef78da68c4d35c36
[clang] Implement Override Suggestions in Sema.

Summary:
In clangd we had a new type of completion suggestions for cpp
class/struct/unions that will show override signatures for virtual methods in
base classes. This patch implements it in sema because it is hard to deduce more
info about completion token outside of Sema and handle itchy cases.

See the patch D50898 for more info on the functionality.

In addition to above patch this one also converts the suggestion into a
CK_Pattern with whole insertion text as the name of the suggestion and factors
out CodeCompletionString generation for declerations so that it can be re-used
by others.

Reviewers: ioeric, ilya-biryukov

Reviewed By: ioeric

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D52225

llvm-svn: 343568
clang/include/clang/Sema/CodeCompleteConsumer.h
clang/lib/Sema/SemaCodeComplete.cpp
clang/test/CodeCompletion/overrides.cpp [new file with mode: 0644]