Skip to content

Commit

Permalink
issue doxygen#10766 C# cref or \ref doesn't work without full namespa…
Browse files Browse the repository at this point in the history
…ce, even for classes in same namespace

Also check against the case that we have a `.` as separator (i.e. C# or Java) in the context name.
  • Loading branch information
albert-github committed Apr 13, 2024
1 parent eb11063 commit 1b60d25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/docnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,9 @@ DocRef::DocRef(DocParser *parser,DocNodeVariant *parent,const QCString &target,c
// qPrint(m_text),qPrint(m_ref),qPrint(m_file),m_refType);
return;
}
else if (resolveLink(context,target,TRUE,&compound,anchor,parser->context.prefix))
else if (resolveLink(context,target,true,&compound,anchor,parser->context.prefix) ||
resolveLink(substitute(context,".","::"),target,true,&compound,anchor,parser->context.prefix)
)
{
bool isFile = compound ?
(compound->definitionType()==Definition::TypeFile ||
Expand Down Expand Up @@ -911,7 +913,9 @@ DocLink::DocLink(DocParser *parser,DocNodeVariant *parent,const QCString &target
{
m_refText = m_refText.right(m_refText.length()-1);
}
if (resolveLink(parser->context.context,stripKnownExtensions(target),parser->context.inSeeBlock,&compound,anchor,parser->context.prefix))
if (resolveLink(parser->context.context,stripKnownExtensions(target),parser->context.inSeeBlock,&compound,anchor,parser->context.prefix) ||
resolveLink(substitute(parser->context.context,".","::"),stripKnownExtensions(target),parser->context.inSeeBlock,&compound,anchor,parser->context.prefix)
)
{
m_anchor = anchor;
if (compound && compound->isLinkable())
Expand Down
1 change: 1 addition & 0 deletions src/docparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ void DocParser::handleLinkedWord(DocNodeVariant *parent,DocNodeList &children,bo
//printf("handleLinkedWord(%s) context.context=%s\n",qPrint(context.token->name),qPrint(context.context));
if (!context.insideHtmlLink &&
(resolveRef(context.context,context.token->name,context.inSeeBlock,&compound,&member,TRUE,fd,TRUE)
|| resolveRef(substitute(context.context,".","::"),context.token->name,context.inSeeBlock,&compound,&member,TRUE,fd,TRUE)
|| (!context.context.isEmpty() && // also try with global scope
resolveRef("",context.token->name,context.inSeeBlock,&compound,&member,FALSE,nullptr,TRUE))
)
Expand Down

0 comments on commit 1b60d25

Please sign in to comment.