Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors on file-not-found #532

Open
briot opened this issue Jun 22, 2020 · 1 comment
Open

errors on file-not-found #532

briot opened this issue Jun 22, 2020 · 1 comment
Assignees

Comments

@briot
Copy link

briot commented Jun 22, 2020

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

@raph-amiard raph-amiard self-assigned this Jun 22, 2020
@raph-amiard
Copy link
Member

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants