Bug 502784 - C# classes outside namespace-block are ignored.
Summary: C# classes outside namespace-block are ignored.
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: importer (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-14 09:46 UTC by andy
Modified: 2025-04-19 13:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andy 2025-04-14 09:46:58 UTC
BUG: Importing C# code from a straight from a directory and also using the import-wizard finds no classes.

AS-IS: The importer ignores all classes which are not under the "namespace" block, i.e. 99% of the classes, as the C# since a few years doesn't require the "namespace Xy { .... }" syntax.
EXPECTED: The importer should find classes also in the case the namespace is written in the form: "namespace Xy;" i.e. without the "{ }" block segment.

Like this, the tool is fully useless, as with any real code-base it's unable to import the model - the architect is required to write all the class names and their props+behaviors manually again within your tool.

Please notice, that the "namespace Xy;" syntax was introduced in C#10 - we are currently at C#13 and your tool asks me if I wish to use also the C#11 syntax, so this should definitely work.

Thank you very much :-),
Andrej
Comment 1 Oliver Kellogg 2025-04-19 13:27:42 UTC
Apparently this is fixed as a side effect of fixing bug 502785.
Tested using test/import/csharp/*.cs from umbrello master.