Doraku / DefaultDocumentation

Create a simple markdown documentation from the Visual Studio xml one.
MIT No Attribution
157 stars 26 forks source link

Invalid character replacement: nullable vs array #96

Closed IdkGoodName closed 2 years ago

IdkGoodName commented 2 years ago

Based on commit aa4bc16, it seems like ? will be replaced with invalid character replacement that can be set in config.

Here comes the problem

Let's say we have 2 classes:

class X<T> { ... }
class X { ... }

And we have 2 methods:

A B(X x, Y? y)
A B(X<Y> x)

Wouldn't both be generated as

..._B(X_Y_)
..._B(X_Y_)

? One could use NameAndMd5Mix, but it could still be an overlooked issue regardless which user may not notice.

Doraku commented 2 years ago

The ? was actually already part of the invalid chars, this changed was made to allow you to give actual path to create a folder hierarchy for your pages. Before this change GetInvalidFileNameChars was used which contains ? so it should behave as before. Also the two methods you give wouldn't have the same name, I think nullable struct would appear as Nullable<Y>. And if it is c#8 nullable annotation, those should not be part of the actual method declaration.

IdkGoodName commented 2 years ago

image

Doraku commented 2 years ago

Damn I guess ? is not an invalid char for linux, and the nullable annotations leak into the file name >_> I will see what I can do.

Doraku commented 2 years ago

, (among other char [, ], .) is no longer considered invalid (what was I even thinking >_>), this should remove a lot of corner cases with risk of collision, and I removed the ? annotation from the parameters (it will still be visible in the code definition) since it is not part of the member id.