================
@@ -4386,12 +4430,24 @@ TEST(CompletionTest, SkipExplicitObjectParameter) {
 
   MockFS FS;
   auto Inputs = TU.inputs(FS);
-  auto Result = codeComplete(testPath(TU.Filename), Code.point(),
-                             Preamble.get(), Inputs, Opts);
-
-  EXPECT_THAT(Result.Completions,
-              ElementsAre(AllOf(named("foo"), signature("(int arg)"),
-                                snippetSuffix("(${1:int arg})"))));
+  {
+    auto Result = codeComplete(testPath(TU.Filename), Code.point("c1"),
+                               Preamble.get(), Inputs, Opts);
+
+    EXPECT_THAT(Result.Completions,
+                UnorderedElementsAre(AllOf(named("foo"), signature("(int 
arg)"),
+                                           snippetSuffix("(${1:int arg})")),
+                                     AllOf(named("bar"), signature("(int 
arg)"),
+                                           snippetSuffix("(${1:int arg})"))));
+  }
+  {
+    auto Result = codeComplete(testPath(TU.Filename), Code.point("c2"),
+                               Preamble.get(), Inputs, Opts);
+    // TODO: snippet suffix is empty for c2
+    EXPECT_THAT(Result.Completions,
+                ElementsAre(AllOf(named("bar"), signature("(int arg)"),
+                                  snippetSuffix(""))));
----------------
MythreyaK wrote:

> We will want snippetSuffix to be (${1:A self}, ${2: int arg})
> signature being (int arg) is also wrong

Yep, the snippet suffix is missing, I wasn't sure how to handle this--in this 
PR, or a new one?

I updated the tests to "pass", to sync up with a more recent `main`, but there 
seems to be a regression (I had to update my test in the latest commit, 
[here](https://github.com/llvm/llvm-project/pull/146649/commits/e08005e3a6fbd42e7063cffe27ce1ccdf0c36d1a#diff-4864eebf0abf8b29afb79cfde58b196f40c6baa36e8ad05676325edb08cd577dR4447-R4451),
 [comment 
here](https://github.com/llvm/llvm-project/pull/146649#discussion_r2239265645)).
 Snippet suffix that existed previously is now missing. 

https://github.com/llvm/llvm-project/pull/146649
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to