EXPECT_EQ(A.SnippetSuffix, "(${1:int a}, ${2:const double &b})");
}
+TEST(CompletionTest, StructuredBinding) {
+ clangd::CodeCompleteOptions Opts = {};
+
+ auto Results = completions(R"cpp(
+ struct S {
+ using Float = float;
+ int x;
+ Float y;
+ };
+ void function() {
+ const auto &[xxx, yyy] = S{};
+ yyy^
+ }
+ )cpp",
+ {}, Opts);
+
+ ASSERT_EQ(Results.Completions.size(), 1u);
+ const auto &A = Results.Completions.front();
+ EXPECT_EQ(A.Name, "yyy");
+ EXPECT_EQ(A.Kind, CompletionItemKind::Variable);
+ EXPECT_EQ(A.ReturnType, "const Float");
+}
+
TEST(CompletionTest, ObjectiveCMethodNoArguments) {
auto Results = completions(R"objc(
@interface Foo