Fixed class method links in PlantUML diagrams
This commit is contained in:
@@ -1268,6 +1268,9 @@ void translation_unit_visitor::process_method(
|
||||
|
||||
process_comment(mf, method);
|
||||
|
||||
// Register the source location of the field declaration
|
||||
set_source_location(mf, method);
|
||||
|
||||
if (method.skip())
|
||||
return;
|
||||
|
||||
|
||||
@@ -71,6 +71,20 @@ TEST_CASE("t00002", "[test-case][class]")
|
||||
clanguml::util::get_git_commit()),
|
||||
"This is class B"));
|
||||
|
||||
REQUIRE_THAT(puml,
|
||||
HasMemberLink("+foo_a() : void",
|
||||
fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/"
|
||||
"t00002/t00002.cc#L18",
|
||||
clanguml::util::get_git_commit()),
|
||||
"foo_a"));
|
||||
|
||||
REQUIRE_THAT(puml,
|
||||
HasMemberLink("-as : std::vector<A *>",
|
||||
fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/"
|
||||
"t00002/t00002.cc#L83",
|
||||
clanguml::util::get_git_commit()),
|
||||
"as"));
|
||||
|
||||
save_puml(
|
||||
config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||
}
|
||||
|
||||
@@ -515,6 +515,15 @@ ContainsMatcher HasLink(std::string const &alias, std::string const &link,
|
||||
fmt::format("{} [[{}{{{}}}]]", alias, link, tooltip), caseSensitivity));
|
||||
}
|
||||
|
||||
ContainsMatcher HasMemberLink(std::string const &method,
|
||||
std::string const &link, std::string const &tooltip,
|
||||
CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes)
|
||||
{
|
||||
return ContainsMatcher(
|
||||
CasedString(fmt::format("{} [[[{}{{{}}}]]]", method, link, tooltip),
|
||||
caseSensitivity));
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
ContainsMatcher IsMethod(std::string const &name,
|
||||
std::string const &type = "void", std::string const ¶ms = "",
|
||||
|
||||
Reference in New Issue
Block a user