Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 512733

Summary: [organize imports] Provide an option to sort static Imports in pure ASCII order and not container first order (default behaviour)
Product: [Eclipse Project] JDT Reporter: David Ostrovsky <d.ostrovsky>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: artem.golubev+eclipse, jfrantzius, nobeh5
Version: 4.7   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard: stalebug

Description David Ostrovsky CLA 2017-02-26 00:48:47 EST
As pointed out in this comment: [1], other tooling and other style guides: [2]
don't have container first oder notation for sorting static imports. Instead
static imports are sorted in pure ASCII order.

Many projects rely on this tool chains for formatting and organize imports
features for static and non static imports.

In Eclipse the users would like to have the macthing behaviour for this
requirement.

The feature request aims to provide support for those project and thus offer
great experience for having the same behaviour in the hole tool chain, including
the IDE as well.

Design: add a checkbox to organize imports dialog:

[] Sort static imports in ASCII order

Or, if all other options fail, offer a system property, that could be set in
eclipse.ini file: SortStaticImportsInAsciiOrder=true.

Needless to say: it's very annoying to have inconsistent behaviour across
the tool chain, so that I hope you can feel our pain. If this feature is
going to be accepted, but there is a problem with developer resources,
please let me know and I will add it myself.

* [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=473629#c8
* [2] https://google.github.io/styleguide/javaguide.html#s3.3.3-import-ordering-and-spacing
Comment 1 Artem Eclipse Gol CLA 2017-07-17 23:39:42 EDT
Google coding style guidelines are the most well-known and widely used style guidelines. As David indicated they demand straight ASCII ordering. Which is also how it is checked by checkstyle http://checkstyle.sourceforge.net/config_imports.html#ImportOrder
Comment 2 Eclipse Genie CLA 2019-08-31 13:26:49 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.