Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Results are not sorted #64

Closed
Closed

Description

@kevinsawicki

Results for files under node_modules are not sorted by their folder, jasmine-focused, then underscore-plus, then grunt. Would have expected the results from the grunt folder be first.

screen shot 2013-10-31 at 10 29 18 am
.

Activity

  1. benogle commented on Oct 31, 2013

    @benogle
    Contributor

    Yeah, the paths arent sorted by scandal and they are rendered as they come back. If we want to sort them, Maybe the best place is in the ResultsModel?

  2. kevinsawicki commented on Oct 31, 2013

    @kevinsawicki
    ContributorAuthor

    Sounds good, although I would have thought that scandal results would be ordered since it readdir returns things in order.

  3. benogle commented on Oct 31, 2013

    @benogle
    Contributor

    Yeah, but there are async things going on. I assume it is hard to keep order when things are processed and displayed as they become available.

    Honestly, I'd like to avoid sorting for performance and complexity if possible. Did it not being sorted throw you off?

  4. kevinsawicki commented on Oct 31, 2013

    @kevinsawicki
    ContributorAuthor

    It did throw me off, I expected it to be ordered like the tree-view and fuzzy-finder.

  5. mcolyer commented on Oct 31, 2013

    @mcolyer
    Contributor

    I remember having this discussion about performance and sorting. If we have to sort than we can't iteratively return results which will have a dramatic perceived impact on large codebases (no results until the last result is found and sorted).

  6. benogle commented on Oct 31, 2013

    @benogle
    Contributor

    We could maybe sort them as they are rendered? Or as they enter the model? Binary search -> insert. Shouldnt be crazy bad. But I still dont want to do it :p

  7. kevinsawicki commented on Oct 31, 2013

    @kevinsawicki
    ContributorAuthor

    How is performance improved by not being sorted?

    If I run find . it returns results really fast sorted.

  8. mcolyer commented on Oct 31, 2013

    @mcolyer
    Contributor

    After talking to @kevinsawicki for a second, I realized I was confusing streaming/sorting. @benogle if you switched scandal to use readDirSync instead of readDir (https://github.com/atom/scandal/blob/e599f22af6296e04499f879dc3aba681a3ded35e/src/path-scanner.coffee#L23) is there a large performance impact?

  9. benogle commented on Oct 31, 2013

    @benogle
    Contributor

    I'm not sure. My main concern is complexity.

    In any case, the task breaks them up into chunks of paths. And as the paths are searched, it emits results. So there might have to be something in the scandal task that doesnt emit a result until all the other previous paths have been searched.

    There are async parts throughout, and at any point, they can become unsorted. I think the best place to do this would be in the ResultsModel and sort as they come in. But then the results view's partial rendering becomes more complex, and results might pop into view.

  10. probablycorey commented on Nov 4, 2013

    @probablycorey

    I don't mind giving this a shot. I think it might make things less complex
    if we use ReadDirSync, the tradeoff is that results will probably come in
    slower.

    On Thu, Oct 31, 2013 at 12:05 PM, Ben Ogle [email protected] wrote:

    I'm not sure. My main concern is complexity.

    In any case, the task breaks them up into chunks of paths. And as the
    paths are searched, it emits results. So there might have to be something
    in the scandal task that doesnt emit a result until all the other previous
    paths have been searched.

    There are async parts throughout, and at any point, they can become
    unsorted. I think the best place to do this would be in the ResultsModel
    and sort as they come in. But then the results view's partial rendering
    becomes more complex, and results might pop into view.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/64#issuecomment-27515778
    .

  11. tmornini commented on Apr 25, 2014

    @tmornini

    Yes, please! :-)

    I would definitely prefer sorted results. So much so that this very issue caused me to switch back to Sublime 3 after giving Atom a go and liking a ton of what I saw.

    Simplest way to explain why it's preferable: I love to know whether the results are under lib/ or spec/, for instance...

  12. muan commented on May 19, 2014

    @muan
    Contributor

    Would really love to see this. + 💯

    I have a rails app with precompiled assets, and when I search, the precompiled css files always come first(public/assets/*), the scss files I want to edit are always at the bottom(app/assets/*)(or even not shown sometimes), which makes it unbearable. I hacked together a way to sort the results in ResultsModel but it had to wait til after all the search is done to sort, and then render. It obviously takes ages which is far from ideal, but still better than the not sorted results for me.

    EDIT I started ignoring results from public/assets, but in those situations I'd still prefer to have results from app/assets come before app/views.

  13. bronson commented on May 24, 2015

    @bronson

    Yes, the results are ALMOST sorted on my system, which is worse than being completely random. It really looks like all results in /lib are grouped together, and all results in /spec are grouped together so, even though I know they're not, I'll often miss a result when it ends up in the middle of something else.

    I'd take slowness over bizarre sort any day. If speed is an issue, shelling out to a native program is an option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions