aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorKadir Cetinkaya <kadircet@google.com>2020-06-26 10:31:13 +0200
committerKadir Cetinkaya <kadircet@google.com>2020-06-26 10:32:12 +0200
commit834c71829cc2e22841bf75e86b988c46252c70dc (patch)
tree9cac196fdd0d850c41a519d7d9775c3abbd95f59 /clang/lib
parent1a30eab413cefb18e733ef6aec42dc04a4a76592 (diff)
downloadllvm-834c71829cc2e22841bf75e86b988c46252c70dc.zip
llvm-834c71829cc2e22841bf75e86b988c46252c70dc.tar.gz
llvm-834c71829cc2e22841bf75e86b988c46252c70dc.tar.bz2
[CodeComplete] Tweak code completion for `typename`.
Summary: Currently, clangd always completes `typename` as `typename qualifier::name`, I think the current behavior is not useful when the code completion is triggered in `template <>`. So I tweak it to `typename identifier`. Patch by @lh123 ! Reviewers: sammccall, kadircet Reviewed By: kadircet Subscribers: ilya-biryukov, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D82373
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 913c438..8835ecc 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -1687,11 +1687,9 @@ static void AddTypeSpecifierResults(const LangOptions &LangOpts,
Results.AddResult(Result("class", CCP_Type));
Results.AddResult(Result("wchar_t", CCP_Type));
- // typename qualified-id
+ // typename name
Builder.AddTypedTextChunk("typename");
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
- Builder.AddPlaceholderChunk("qualifier");
- Builder.AddTextChunk("::");
Builder.AddPlaceholderChunk("name");
Results.AddResult(Result(Builder.TakeString()));