File tree 1 file changed +23
-0
lines changed 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2579,6 +2579,29 @@ TEST(CompletionTest, Lambda) {
2579
2579
EXPECT_EQ (A.SnippetSuffix , " (${1:int a}, ${2:const double &b})" );
2580
2580
}
2581
2581
2582
+ TEST (CompletionTest, StructuredBinding) {
2583
+ clangd::CodeCompleteOptions Opts = {};
2584
+
2585
+ auto Results = completions (R"cpp(
2586
+ struct S {
2587
+ using Float = float;
2588
+ int x;
2589
+ Float y;
2590
+ };
2591
+ void function() {
2592
+ const auto &[xxx, yyy] = S{};
2593
+ yyy^
2594
+ }
2595
+ )cpp" ,
2596
+ {}, Opts);
2597
+
2598
+ ASSERT_EQ (Results.Completions .size (), 1u );
2599
+ const auto &A = Results.Completions .front ();
2600
+ EXPECT_EQ (A.Name , " yyy" );
2601
+ EXPECT_EQ (A.Kind , CompletionItemKind::Variable);
2602
+ EXPECT_EQ (A.ReturnType , " const Float" );
2603
+ }
2604
+
2582
2605
TEST (CompletionTest, ObjectiveCMethodNoArguments) {
2583
2606
auto Results = completions (R"objc(
2584
2607
@interface Foo
You can’t perform that action at this time.
0 commit comments