Bug 502785

Summary: Importing classes from C# ignores the namespaces
Product: [Applications] umbrello Reporter: andy
Component: importerAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal CC: okellogg
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 25.07.70
Sentry Crash Report:

Description andy 2025-04-14 10:00:05 UTC
BUG: Importing classes from a folder ignores the classes' namespaces.

AS-IS: The imported classes are all put into the root-package, as the namespace of the class is fully ignored. This results in a useless repository mess, as everything is put into the root package.
EXPECTED: The imported class should be placed into the real namespace as defined by the found classes in the .cs files under real namespaces.

This BUG can be related to the other BUG I was posting: the importer seems to have quite low support on finding (not finding the classes: see my other BUG#502784) and not-using the namespaces.

Please notice, that in my hard effort to use your tool, I've patched all my code-base to use the "namespace { }" C# syntax, so your tool is able to find the classes. Now it finds them, but ignores that namespace, which lefts me with tons of classes under the root package, which is fully unusable like this.

Thank you,
Andrej
Comment 1 andy 2025-04-14 10:10:58 UTC
(In reply to andy from comment #0)
> EXPECTED: The imported class should be placed into the real namespace as
> defined by the found classes in the .cs files under real namespaces.

Placing the classes into their real namespaces means: there should be created a "Package" under which the class is placed.
Comment 2 Oliver Kellogg 2025-04-18 08:16:22 UTC
umbrello/codeimport/csvalaimportbase.cpp : Adopted improvements from javaimport.cpp which happened since 2012.