mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 18:11:19 +00:00
[CodeComplete] Only show lambda completions if patterns are requested
This is a trivial follow-up to r361461, so sending without review. llvm-svn: 361510
This commit is contained in:
parent
27b3b5d952
commit
fd11a5f47d
@ -4134,6 +4134,8 @@ static const FunctionProtoType *TryDeconstructFunctionLike(QualType T) {
|
||||
static void AddLambdaCompletion(ResultBuilder &Results,
|
||||
llvm::ArrayRef<QualType> Parameters,
|
||||
const LangOptions &LangOpts) {
|
||||
if (!Results.includeCodePatterns())
|
||||
return;
|
||||
CodeCompletionBuilder Completion(Results.getAllocator(),
|
||||
Results.getCodeCompletionTUInfo());
|
||||
// [](<parameters>) {}
|
||||
|
@ -51,3 +51,12 @@ void test4() {
|
||||
// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:50:35 %s -o - | FileCheck -check-prefix=CHECK-6 %s
|
||||
// CHECK-6-NOT: COMPLETION: Pattern : [<#=
|
||||
}
|
||||
|
||||
void test5() {
|
||||
// Completions are only added when -code-completion-patterns are enabled.
|
||||
function<void()> b = {};
|
||||
// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:57:24 %s -o - | FileCheck -check-prefix=CHECK-7 %s
|
||||
// CHECK-7: COMPLETION: Pattern : [<#=
|
||||
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:57:24 %s -o - | FileCheck -check-prefix=CHECK-8 %s
|
||||
// CHECK-8-NOT: COMPLETION: Pattern : [<#=
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user