[clangd] Wire up compilation for style blocks
Differential Revision: https://reviews.llvm.org/D127749
This commit is contained in:
parent
9096a52566
commit
3ecfeb4c2f
@ -197,6 +197,7 @@ struct FragmentCompiler {
|
||||
compile(std::move(F.Completion));
|
||||
compile(std::move(F.Hover));
|
||||
compile(std::move(F.InlayHints));
|
||||
compile(std::move(F.Style));
|
||||
}
|
||||
|
||||
void compile(Fragment::IfBlock &&F) {
|
||||
|
||||
@ -536,6 +536,14 @@ TEST_F(ConfigCompileTests, AllScopes) {
|
||||
EXPECT_TRUE(compileAndApply());
|
||||
EXPECT_TRUE(Conf.Completion.AllScopes);
|
||||
}
|
||||
|
||||
TEST_F(ConfigCompileTests, Style) {
|
||||
Frag = {};
|
||||
Frag.Style.FullyQualifiedNamespaces.push_back(std::string("foo"));
|
||||
Frag.Style.FullyQualifiedNamespaces.push_back(std::string("bar"));
|
||||
EXPECT_TRUE(compileAndApply());
|
||||
EXPECT_THAT(Conf.Style.FullyQualifiedNamespaces, ElementsAre("foo", "bar"));
|
||||
}
|
||||
} // namespace
|
||||
} // namespace config
|
||||
} // namespace clangd
|
||||
|
||||
@ -261,6 +261,19 @@ Diagnostics:
|
||||
EXPECT_THAT(Results[0].Diagnostics.Includes.IgnoreHeader,
|
||||
ElementsAre(val("foo"), val("bar")));
|
||||
}
|
||||
|
||||
TEST(ParseYAML, Style) {
|
||||
CapturedDiags Diags;
|
||||
Annotations YAML(R"yaml(
|
||||
Style:
|
||||
FullyQualifiedNamespaces: [foo, bar])yaml");
|
||||
auto Results =
|
||||
Fragment::parseYAML(YAML.code(), "config.yaml", Diags.callback());
|
||||
ASSERT_THAT(Diags.Diagnostics, IsEmpty());
|
||||
ASSERT_EQ(Results.size(), 1u);
|
||||
EXPECT_THAT(Results[0].Style.FullyQualifiedNamespaces,
|
||||
ElementsAre(val("foo"), val("bar")));
|
||||
}
|
||||
} // namespace
|
||||
} // namespace config
|
||||
} // namespace clangd
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user