================ @@ -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("")))); ---------------- HighCommander4 wrote:
We will want `snippetSuffix` to be `(${1:A self}, ${2: int arg})`, right (since the user will need to write both arguments in this scenario)? Given that, would it be fair to say that `signature` being `(int arg)` is also wrong (it should probably be consistent with the snippet suffix)? (Maybe just amend the TODO comment to talk about both?) 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