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

When importing a package, don't use the micro version #401

Closed
laeubi opened this issue Nov 14, 2022 · 4 comments · Fixed by #1007
Closed

When importing a package, don't use the micro version #401

laeubi opened this issue Nov 14, 2022 · 4 comments · Fixed by #1007

Comments

@laeubi
Copy link
Contributor

laeubi commented Nov 14, 2022

Currently in PDE when a package is missing, the Quickfix suggest to import the package and then automatically adds the exact version of that package from the target. As micro version should not change anything, it should not be part of the import, so if the package is of version 1.2.3 , the import should have a lower bound of 1.2

@alshamams
Copy link
Contributor

Hi @laeubi ,
I want to take this up. I was trying to reproduce the problem, but could not.

  • The quickfix list for missing imports in the source does not include package import suggestion. Can you point me to the workflow of the quickfix that you are referring to?
  • Adding an import package in the UI results in insertion of the package in the manifest but doesn't involve quick fix.( Shouldn't the same change be implemented here as well?) Or is this what you intend?

@laeubi
Copy link
Contributor Author

laeubi commented Dec 1, 2023

You can use an existing plugin, then remove one of the require bundles / packages and then go to the place where the type is missing, if you then open quickfix you should find suggestion to import a package (maybe a bit down the list even though IMO it should be the first item).

@alshamams
Copy link
Contributor

alshamams commented Dec 7, 2023

Hi, @laeubi
I tried recreating the issue as per your suggestion using an existing plugin project creation template and removed a required bundle. I have added the screenshot of possible quick fix suggestions that came up, since I did not see an option to import the missing package in the list.
Steps followed:

  • Created a plugin project using "Hello World, Command" template with "Generate an activator" option enabled.
  • Removed org.eclipse.ui bundle from Require Bundle header in the Manifest, and saved the changes.
  • Selected Quick fix option for the error "The import org.eclipse.ui cannot be resolved".
Quick Fix

@laeubi
Copy link
Contributor Author

laeubi commented Dec 7, 2023

The following is for org.eclipse.equinox.frameworkadmin bundle of P2 repository:

  1. go to the manifest and remove org.eclipse.osgi.util package import
  2. Now you should get an error marker in the Utils class
    grafik
  3. the Quickfix (STRG+1) should suggest to import the package again
    grafik

To see what is described here, one needs to change that version of the package export of bundle org.eclipse.osgi for example from 1.1.0 in 1.1.1 in wich case the import will be after apply the quick-fix 1.1.1 while ist should be still 1.1.0 as the micro version is not important.

alshamams added a commit to alshamams/eclipse.pde that referenced this issue Dec 14, 2023

This commit resets the micro-version to ‘0’ while importing packages as
part of quick fix, as it is not relevant.
Fixes:
eclipse-pde#401
alshamams added a commit to alshamams/eclipse.pde that referenced this issue Dec 18, 2023

This commit resets the micro-version to ‘0’ while importing packages as
part of quick fix, as it is not relevant.
Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>


Fixes:eclipse-pde#401
HannesWell pushed a commit to alshamams/eclipse.pde that referenced this issue Dec 21, 2023

This commit resets the micro-version to ‘0’ while importing packages as
part of quick fix, as it is not relevant.
Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>


Fixes:eclipse-pde#401
HannesWell added a commit to alshamams/eclipse.pde that referenced this issue Dec 21, 2023
This commit resets the micro-version to '0' while importing packages as
part of quick fix, as it is not relevant.

Fixes eclipse-pde#401

Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
HannesWell added a commit to alshamams/eclipse.pde that referenced this issue Dec 22, 2023
This commit resets the micro-version to '0' while importing packages as
part of quick fix, as it is not relevant.
Additionally it specifies the next major version as exclusive upper
bound to support semantic versioning.

Fixes eclipse-pde#401

Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
HannesWell added a commit that referenced this issue Dec 22, 2023
This commit resets the micro-version to '0' while importing packages as
part of quick fix, as it is not relevant.
Additionally it specifies the next major version as exclusive upper
bound to support semantic versioning.

Fixes #401

Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants