Bug 519064 - Organize use statements removes statements which are used.
Summary: Organize use statements removes statements which are used.
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 558630
Blocks:
  Show dependency tree
 
Reported: 2017-07-01 08:15 EDT by gossi CLA
Modified: 2020-05-14 13:13 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gossi CLA 2017-07-01 08:15:45 EDT
The new "organize use statements" introduced in pdt 5.0.0 actually removes "too much".

It removes use statements which are only used in phpdoc (e.g. to document return statements). From the perspective of bare php code execution this won't be a problem, however tools like phpdocumentor or sami aren't able to find the required types anymore. Also pdt editor itself warns, it cannot resolve to a type.
Comment 1 Thierry BLIND CLA 2017-09-08 04:52:23 EDT
Yes, and there is also work to do to correct the import validator and the use statement injector (for the "organize use statements" feature), specially to support group use declarations and mixed use declarations. It will hopefully be done in the 5.2 release.

Thierry.
Comment 2 Christian Kraft CLA 2018-12-03 16:45:47 EST
What is the status here?

Currently there is version 6.1 and the error still exists.
Comment 3 Thierry BLIND CLA 2018-12-07 06:35:07 EST
Hi Christian,
I made some work in this area some months ago, so the state should be better, but not resolved.
I think it would be nice to update this bug report with some examples, based on latest PDT snapshots, and see what still need to be done (and what is already fixed).
Also I'm quite busy lately, so it will take me some time to look deeply in this bug report again, sorry :(

Thierry.
Comment 4 Thierry BLIND CLA 2019-12-27 15:55:28 EST
Hi,
finally, after more work, this bug should be fixed.
If there are still cases where use statements are wrongly removed, please fill another bug report ;)

Thierry.