[PATCH] D62298: [CodeComplete] Filter override completions by function name
Phabricator via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 24 03:18:44 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE361623: [CodeComplete] Filter override completions by function name (authored by ibiryukov, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D62298?vs=201168&id=201178#toc
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62298/new/
https://reviews.llvm.org/D62298
Files:
clangd/unittests/CodeCompleteTests.cpp
Index: clangd/unittests/CodeCompleteTests.cpp
===================================================================
--- clangd/unittests/CodeCompleteTests.cpp
+++ clangd/unittests/CodeCompleteTests.cpp
@@ -49,6 +49,9 @@
// GMock helpers for matching completion items.
MATCHER_P(Named, Name, "") { return arg.Name == Name; }
+MATCHER_P(NameStartsWith, Prefix, "") {
+ return llvm::StringRef(arg.Name).startswith(Prefix);
+}
MATCHER_P(Scope, S, "") { return arg.Scope == S; }
MATCHER_P(Qualifier, Q, "") { return arg.RequiredQualifier == Q; }
MATCHER_P(Labeled, Label, "") {
@@ -1946,10 +1949,13 @@
};
)cpp");
const auto Results = completions(Text);
- EXPECT_THAT(Results.Completions,
- AllOf(Contains(Labeled("void vfunc(bool param, int p) override")),
- Contains(Labeled("void ttt(bool param) const override")),
- Not(Contains(Labeled("void vfunc(bool param) override")))));
+ EXPECT_THAT(
+ Results.Completions,
+ AllOf(Contains(AllOf(Labeled("void vfunc(bool param, int p) override"),
+ NameStartsWith("vfunc"))),
+ Contains(AllOf(Labeled("void ttt(bool param) const override"),
+ NameStartsWith("ttt"))),
+ Not(Contains(Labeled("void vfunc(bool param) override")))));
}
TEST(CompletionTest, OverridesNonIdentName) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62298.201178.patch
Type: text/x-patch
Size: 1375 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190524/71dab487/attachment.bin>
More information about the cfe-commits
mailing list