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

Improve error message for Import-Package resulution failure due to missing mandatory attributes and provide a quick-fix #578

Open
HannesWell opened this issue Apr 15, 2023 · 0 comments · May be fixed by #678

Comments

@HannesWell
Copy link
Member

If one imports a package that is exported with mandatory attributes the error message in the manifest should show an enhanced error message indicating that the mandatory attribute is missing and should provide a quick-fix to add the mandatory attributes with the value from the provider.

A Minimal example MANIFEST.MFs:

  • Provider:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: foo.provider
Bundle-Version: 1.0.0.qualifier
Export-Package: org.foo;attr=val;mandatory:=attr
  • Consumer:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: foo.consumer
Bundle-Version: 1.0.0.qualifier
Import-Package: org.foo

A quick-fix should change the package import to Import-Package: org.foo;attr=val.

IIRC the PDE-state provides information why a required capability failed to resolve so this hopefully reveals. If that information is not available, in case of a unresolved Import-Package we could check the state for providers of that package and see if they have mandatory attributes.
The case of multiple providers with different mandatory attributes or different attribute values should be handled too. The best would then probably be to provide a error resolution for each possible change that should fix the resolution error (maybe limiting the number of possible resolutions).

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