Skip to content

Commit 1853739

Browse files
committed
ref warnings include qualified documented symbol
#improvement
1 parent 67fc569 commit 1853739

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

src/lib/Metadata/Finalizers/ReferenceFinalizer.cpp

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,36 @@ finalize(NameInfo& name)
221221
});
222222
}
223223

224+
namespace {
225+
void
226+
qualifiedName(InfoSet& info, Info const& I, std::string& result)
227+
{
228+
if (I.Parent &&
229+
I.Parent != SymbolID::global)
230+
{
231+
Info const& PI = *info.find(I.Parent)->get();
232+
qualifiedName(info, PI, result);
233+
result += "::";
234+
}
235+
if (!I.Name.empty())
236+
{
237+
result += I.Name;
238+
}
239+
else
240+
{
241+
result += "<anonymous>";
242+
}
243+
}
244+
245+
std::string
246+
qualifiedName(InfoSet& info, Info const& I)
247+
{
248+
std::string res;
249+
qualifiedName(info, I, res);
250+
return res;
251+
}
252+
} // (anonymous)
253+
224254
void
225255
ReferenceFinalizer::
226256
finalize(doc::Node& node)
@@ -237,10 +267,11 @@ finalize(doc::Node& node)
237267
if (!resolveReference(N) &&
238268
!warned_.contains({N.string, current_->Name}))
239269
{
270+
MRDOCS_ASSERT(current_);
240271
report::warn(
241-
"Failed to resolve reference to '{}' from '{}'",
242-
N.string,
243-
current_->Name);
272+
"{}: Failed to resolve reference to '{}'",
273+
qualifiedName(info_, *current_),
274+
N.string);
244275
warned_.insert({N.string, current_->Name});
245276
}
246277
}

0 commit comments

Comments
 (0)