You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the context of a code generator, I am analyzing existing Ada package via python scripts, using libadalang.
The Context is built via UnitProvider.for_project()
It happens that users feed non-compiling Ada units to the code generator (because the generator runs before the compiler). One case of error is a with clause that points to an Ada package not found in the loaded project (missing a with clause in the project itself for instance).
In this case, libadalang reports no error that I can see, and soldiers on with whatever semantic analysis it can perform despite this missing file. This is a nice behavior in some contexts (an IDE), but not for a code generator. As a result, I end up with None types in the generator, and have to handle all such cases explicitly.
It would be much better if I could get an error (or a callback that let's me handle those errors and decide) when a with clause cannot be resolved.
Did I miss something in the API ?
If not, can this be added as an enhancement request please ?
Thanks
The text was updated successfully, but these errors were encountered:
@briot You didn't miss something, it's indeed an undesirable behavior, even for us and for IDEs, in many situations. We have an internal issue related to this, and we want to fix this. I'll keep you updated of the progress!
In the context of a code generator, I am analyzing existing Ada package via python scripts, using libadalang.
The Context is built via
UnitProvider.for_project()
It happens that users feed non-compiling Ada units to the code generator (because the generator runs before the compiler). One case of error is a with clause that points to an Ada package not found in the loaded project (missing a with clause in the project itself for instance).
In this case, libadalang reports no error that I can see, and soldiers on with whatever semantic analysis it can perform despite this missing file. This is a nice behavior in some contexts (an IDE), but not for a code generator. As a result, I end up with
None
types in the generator, and have to handle all such cases explicitly.It would be much better if I could get an error (or a callback that let's me handle those errors and decide) when a with clause cannot be resolved.
Did I miss something in the API ?
If not, can this be added as an enhancement request please ?
Thanks
The text was updated successfully, but these errors were encountered: