Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# cref or \ref doesn't work without full namespace, even for classes in same namespace #10766

Closed
runevision opened this issue Mar 23, 2024 · 6 comments

Comments

@runevision
Copy link

runevision commented Mar 23, 2024

Describe the bug
Referencing another class (in this case called TopLayerDependency) in the same namespace with <see cref="TopLayerDependency"/> does not create a link when the class name is not qualified with the (common) namespace. In the output I see
unable to resolve reference to 'TopLayerDependency' for \ref command.

Screenshots

MissingLink

To Reproduce
Default Doxyfile without modifications used to reproduce the issue.

Place these two files in the folder Doxygen is run from:

File GenerationSource.cs

namespace Runevision.LayerGen {
    /// <summary>
    /// Unity component that creates a <see cref="TopLayerDependency"/>. <br/>
    /// Unity component that creates a \ref TopLayerDependency. <br/>
    /// Unity component that creates a <see cref="Runevision.LayerGen.TopLayerDependency"/>. <br/>
    /// Unity component that creates a \ref Runevision.LayerGen.TopLayerDependency.
    /// </summary>
    public class GenerationSource : MonoBehaviour { }
}

File TopLayerDependency.cs

namespace Runevision.LayerGen {
    /// <summary>
    /// All generation starts with one or more top level dependencies at the root.
    /// </summary>
    public class TopLayerDependency { }
}

Expected behavior
I would expect class names in the same namespace to be turned into links without having to specify the namespace.

Version
1.10.0 (GIT-NOTFOUND)
Doxygen installed via brew
macOS 12.5.1

Additional context
None of my other cross references get turned into links either (for example references from one method to another method in the same class). It seems like something is very broken about Doxygen reference resolution for xmldoc and/or C#, but I think this report here is the simplest demonstration, so let's start with that. With any luck, the fix for this will fix the other ones too.

albert-github added a commit to albert-github/doxygen that referenced this issue Apr 13, 2024
…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.
@albert-github
Copy link
Collaborator

I've just pushed a proposed patch, pull request #10795

@zhangzq
Copy link

zhangzq commented Apr 18, 2024

The same problems exist in Python. I need to write whole path, i.e. package.sub_package.file_name.class_name.function_name to resolve the function.

@albert-github
Copy link
Collaborator

@zhangzq The python problem should also be fixed with the patch #10795, did you try it?
Otherwise:

  • Can you please attach a, small, self contained example (source+configuration file in a, compressed, tar or zip file!) that allows us to reproduce the problem? Please don't add external links as they might not be persistent (also references to GitHub repositories are considered non persistent).
  • Please also specify the full doxygen version used (doxygen -v).

@zhangzq
Copy link

zhangzq commented Apr 22, 2024

@zhangzq The python problem should also be fixed with the patch #10795, did you try it? Otherwise:

  • Can you please attach a, small, self contained example (source+configuration file in a, compressed, tar or zip file!) that allows us to reproduce the problem? Please don't add external links as they might not be persistent (also references to GitHub repositories are considered non persistent).
  • Please also specify the full doxygen version used (doxygen -v).

it works. very cool! thanks.

@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label May 7, 2024
@albert-github
Copy link
Collaborator

Code has been integrated in master on GitHub (please don't close the issue as this will be done at the moment of an official release).

As the code has been reworked, can you please retest.

@doxygen
Copy link
Owner

doxygen commented May 20, 2024

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.11.0.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

@doxygen doxygen removed the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label May 20, 2024
@doxygen doxygen closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants