Added alias resolution in include diagrams
This commit is contained in:
@@ -61,7 +61,19 @@ std::string diagram::to_alias(const std::string &full_name) const
|
||||
{
|
||||
LOG_DBG("Looking for alias for {}", full_name);
|
||||
|
||||
return full_name;
|
||||
auto path = common::model::filesystem_path{full_name};
|
||||
|
||||
if (path.is_empty())
|
||||
throw error::uml_alias_missing(
|
||||
fmt::format("Missing alias for '{}'", path.to_string()));
|
||||
|
||||
auto source_file = get_element<common::model::source_file>(path);
|
||||
|
||||
if (!source_file)
|
||||
throw error::uml_alias_missing(
|
||||
fmt::format("Missing alias for '{}'", path.to_string()));
|
||||
|
||||
return source_file.value().alias();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,4 +16,7 @@ diagrams:
|
||||
- ../../tests/t40001
|
||||
plantuml:
|
||||
before:
|
||||
- "' t40001 test include diagram"
|
||||
- "' t40001 test include diagram"
|
||||
after:
|
||||
- 'note right of {{ alias("include/lib1") }}: This is a lib1 include dir'
|
||||
- 'note right of {{ alias("include/t40001_include1.h") }}: This is a t40001_include1.h include file'
|
||||
Reference in New Issue
Block a user