mbeddr.core icon indicating copy to clipboard operation
mbeddr.core copied to clipboard

Provide organize imports function for modules and build configurations

Open stephaneberle9 opened this issue 11 years ago • 7 comments

When having worked in an mbeddr project for a while a lot of stuff in gets accumulated in "imports" section of modules and "included modules" section of build configuration. It'd be cool if mbeddr would do some automatic housekeeping here and throw away included modules that are no longer needed.

stephaneberle9 avatar May 27 '13 16:05 stephaneberle9

Some more details about this: I actually don't want to have to edit the module import list at all. What I want is that mbeddr automatically inserts the necessary imports as I start using new types in a module. The import list should also be sorted alphabetically to keep it easier to oversee.

As a consequence, the code completion behavior must be enhanced in the following way:

  • When I'm about to use a type that comes from the modules that are already imported it should work as now, i.e., its scope is equal to the union of the imported modules

stephaneberle9 avatar Jul 09 '13 15:07 stephaneberle9

I think your second option is currently not possible (with reasonable effort)

bkolb avatar Jul 09 '13 18:07 bkolb

moved the second requirement to another feature request: https://github.com/mbeddr/mbeddr.core/issues/717

DomenikP avatar Jul 15 '13 19:07 DomenikP

There's still a bug with imported units: when organizing the imports, modules that only provide units are removed from the list of import. This behavior leads to an inconsistent build configuration and a failing code generation.

DomenikP avatar Jul 15 '13 19:07 DomenikP

Modules can contain "main function" abstractions, therefore the import organizer should not check for functions with name "main", but for instances of type IActAsMainFunction.

DomenikP avatar Jul 24 '13 13:07 DomenikP

is this finished? can we close that?

bkolb avatar Aug 25 '13 16:08 bkolb

When I tried to use it a month ago, it messed up the imports of a great number of modules in my project.

So, we should schedule a thorough test session, ideally on smart meter, to be sure that there are no side effects before closing this bug.

stephaneberle9 avatar Aug 26 '13 09:08 stephaneberle9