rossluk opened a new pull request, #5681:
URL: https://github.com/apache/netbeans/pull/5681

   This PR fixes next issues:
   
   1. Incorrect navigator view when you have bracketed default namespace or 
multiple default namespaces in file:
   
   -- before fix it shows classes without namespace, and USE from second 
default namespace is showed as first one
   <img width="799" alt="navigator_view" 
src="https://user-images.githubusercontent.com/7629403/226182462-81b134fb-4711-4493-8ac8-a18a431804a7.png";>
   
   -- after fix
   <img width="785" alt="navigator_view_fix" 
src="https://user-images.githubusercontent.com/7629403/226182479-d0c49789-38c5-493d-874a-b34d9c1dc04d.png";>
   
   2. Incorrect fix imports when there are multiple default namespaces and some 
of them has imported USES:
   
   -- initial state
   <img width="426" alt="getns_from_other" 
src="https://user-images.githubusercontent.com/7629403/226182578-513a2136-bb58-4b0c-9c18-0aa72671ff29.png";>
   
   -- before fix, it gets all uses from all default namespaces and inserts it 
in the first one
   <img width="340" alt="get_ns_from_other_after" 
src="https://user-images.githubusercontent.com/7629403/226182669-bad33e1c-eca7-4802-8b8c-4205d041144d.png";>
   -- after fix 
   <img width="365" alt="getns_from_other_fix" 
src="https://user-images.githubusercontent.com/7629403/226182592-18b1d855-fd89-4458-8a85-b35c21e6d1d4.png";>
   
   3. File state change after each fix import when there is no changes
   
   -- before fix before fix import action (see tab)
   <img width="323" alt="file_change" 
src="https://user-images.githubusercontent.com/7629403/226182840-455f378e-0880-46ec-b37f-02f4efa992cd.png";>
   
   -- before fix after fix import action (see tab)
   <img width="347" alt="file_change_after" 
src="https://user-images.githubusercontent.com/7629403/226182791-863160d3-ec32-4668-8176-17bb5bff446e.png";>
   
   Also with the fixes I've changed Fix Imports logic. Previously when you use 
Fix Imports outside bracketed namespace it was changing first available 
namespace uses, but now if you in global scope it fixes all the file, see below:
   
   -- initial state
   <img width="399" alt="Screen Shot 2023-03-19 at 15 40 04" 
src="https://user-images.githubusercontent.com/7629403/226183366-0c9870da-4206-455e-bfdc-266b4a7c6463.png";>
   -- after Fix Imports
   <img width="445" alt="Screen Shot 2023-03-19 at 13 08 23" 
src="https://user-images.githubusercontent.com/7629403/226183434-75d82458-eca2-4e7f-be0e-a7f34ddc251b.png";>
   
   To have Fix Imports working for the whole file I had to add scope to 
UsedNamesCollector's names and it also affected some tests, because for now it 
is important that DataItems from ImportDataCreator were paired with Selections, 
but previously Selection could be imported without real DataItem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to