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#] Records not recognized when generating documentation #10087

Open
ThatKoshevoy opened this issue May 25, 2023 · 8 comments
Open

[C#] Records not recognized when generating documentation #10087

ThatKoshevoy opened this issue May 25, 2023 · 8 comments
Labels
C# enhancement a request to enhance doxygen, not a bug

Comments

@ThatKoshevoy
Copy link

ThatKoshevoy commented May 25, 2023

Describe the bug
C# Records not recognized when generating documentation

Expected behavior
C# Records are recognized when generating documentation

Version
1.9.8

@ThatKoshevoy ThatKoshevoy changed the title [C#] Record not recognized when generating documentation [C#] Records not recognized when generating documentation May 25, 2023
@albert-github albert-github added needinfo reported bug is incomplete, please add additional info C# labels May 25, 2023
@albert-github
Copy link
Collaborator

  • 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.
  • Please also specify the full doxygen version used (doxygen -v). (Just 1.9.8 is not sufficient as it is currently the master version and thus a moving target)

@ThatKoshevoy
Copy link
Author

ThatKoshevoy commented May 25, 2023

doxygen -v = 1.9.8 (0ea6a23)
doxygen-record-example.tar.gz
image
In project there are two files Class and Record.
image
But when doxygen is generated it shows only class but no record.

@albert-github albert-github added enhancement a request to enhance doxygen, not a bug and removed needinfo reported bug is incomplete, please add additional info labels May 25, 2023
@albert-github
Copy link
Collaborator

It looks like record class and record struct do work (by accident?).
From https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record:

Beginning with C# 9, you use the record keyword to define a reference type that provides built-in functionality for encapsulating data. C# 10 allows the record class syntax as a synonym to clarify a reference type, and record struct to define a value type with similar functionality.

So looks like:

  • record should properly be recognized for class and struct as well
  • in case of just record this should be treated as record class.

@ThatKoshevoy
Copy link
Author

I tried record class but it doesn't work neither. Hope you'll make it the future.

@albert-github
Copy link
Collaborator

The following did work for me (it shows the Point_class and the Point_struct, the Point_bare is a problem as indicated before):
aa.cs

public record struct Point_struct
{
    public double X_struct { get; set; }
}
public record class Point_class
{
    public double X_class { get; set; }
}
public record Point_bare
{
    public double X { get; set; }_bare
}

Doxyfile

QUIET = YES
EXTRACT_ALL = YES

Example: example.tar.gz

@ThatKoshevoy
Copy link
Author

ThatKoshevoy commented May 25, 2023

Found that it works only for record class that initialized with curly braces.

public record class TestRecord1
{
	public int A;
	public int B;
};

public record class TestRecord2(int A, int B);

doxygen-record-example.tar.gz

@albert-github
Copy link
Collaborator

Thanks for the extra info, the public record class TestRecord2(int A, int B); is seen as a function prototype:

image

@ThatKoshevoy
Copy link
Author

Glad we found the problem, waiting for update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# enhancement a request to enhance doxygen, not a bug
Projects
None yet
Development

No branches or pull requests

2 participants