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

Package Explorer and Git Repository View use different sortorder #2295

Open
jukzi opened this issue Aug 28, 2024 · 4 comments
Open

Package Explorer and Git Repository View use different sortorder #2295

jukzi opened this issue Aug 28, 2024 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jukzi
Copy link
Contributor

jukzi commented Aug 28, 2024

package explorer:
image
image
windows:
image

personally i prefer the order where numbers are treated as numbers i.e. package explorer should be adapted.

@jukzi jukzi added the bug Something isn't working label Aug 28, 2024
@akurtakov
Copy link
Member

Please note that Package explorer is JDT feature so there might be part to fix there too. "Project explorer" on the other side is Platform thing.

@jukzi
Copy link
Contributor Author

jukzi commented Aug 28, 2024

@Bananeweizen
Copy link
Contributor

Bananeweizen commented Sep 2, 2024

It's actually rather simple from the idea, it's only complicated for a performant implementation taking care of all corner cases:

  • Split the input string into consecutive sequences of either digits or non-digits.
  • Compare these sequences in order (with the digits part using integer comparison), until they are different.
    So from your example above, it just compares sequences like ["Snippet", "123"] with the respective other ones. You can better see that by looking at early versions of the class, which was later "tuned" a lot.

There are other implementations out there which even honour separator characters like "." and ":", e.g. https://github.com/616slayer616/natorder

@jukzi jukzi added good first issue Good for newcomers help wanted Extra attention is needed labels Sep 18, 2024
@jukzi
Copy link
Contributor Author

jukzi commented Sep 18, 2024

Would be good to have a common Comparator in platform to be used in egit/JDT

@jukzi jukzi transferred this issue from eclipse-platform/.github Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants