Skip to content

Commit 1b60d25

Browse files
committed
issue #10766 C# cref or \ref doesn't work without full namespace, 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.
1 parent eb11063 commit 1b60d25

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/docnode.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,9 @@ DocRef::DocRef(DocParser *parser,DocNodeVariant *parent,const QCString &target,c
731731
// qPrint(m_text),qPrint(m_ref),qPrint(m_file),m_refType);
732732
return;
733733
}
734-
else if (resolveLink(context,target,TRUE,&compound,anchor,parser->context.prefix))
734+
else if (resolveLink(context,target,true,&compound,anchor,parser->context.prefix) ||
735+
resolveLink(substitute(context,".","::"),target,true,&compound,anchor,parser->context.prefix)
736+
)
735737
{
736738
bool isFile = compound ?
737739
(compound->definitionType()==Definition::TypeFile ||
@@ -911,7 +913,9 @@ DocLink::DocLink(DocParser *parser,DocNodeVariant *parent,const QCString &target
911913
{
912914
m_refText = m_refText.right(m_refText.length()-1);
913915
}
914-
if (resolveLink(parser->context.context,stripKnownExtensions(target),parser->context.inSeeBlock,&compound,anchor,parser->context.prefix))
916+
if (resolveLink(parser->context.context,stripKnownExtensions(target),parser->context.inSeeBlock,&compound,anchor,parser->context.prefix) ||
917+
resolveLink(substitute(parser->context.context,".","::"),stripKnownExtensions(target),parser->context.inSeeBlock,&compound,anchor,parser->context.prefix)
918+
)
915919
{
916920
m_anchor = anchor;
917921
if (compound && compound->isLinkable())

src/docparser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ void DocParser::handleLinkedWord(DocNodeVariant *parent,DocNodeList &children,bo
791791
//printf("handleLinkedWord(%s) context.context=%s\n",qPrint(context.token->name),qPrint(context.context));
792792
if (!context.insideHtmlLink &&
793793
(resolveRef(context.context,context.token->name,context.inSeeBlock,&compound,&member,TRUE,fd,TRUE)
794+
|| resolveRef(substitute(context.context,".","::"),context.token->name,context.inSeeBlock,&compound,&member,TRUE,fd,TRUE)
794795
|| (!context.context.isEmpty() && // also try with global scope
795796
resolveRef("",context.token->name,context.inSeeBlock,&compound,&member,FALSE,nullptr,TRUE))
796797
)

0 commit comments

Comments
 (0)