Skip to content

How can I control the ordering of explorer trees? #45053

Closed

Description

@DanTup

I have an extension that contributes some trees in the explorer, some of which are much more important than others. I can't find a way to force the ordering of these - the "important" one always seems to come last.

I tried registering them in a different order but it didn't help. I tried hiding/showing one (using contexts) to see if that would force it to the bottom, but it didn't.

In my case, the "important" tree that I want above the others is hidden/shown based on some criteria, so I need to be able to hide it and then show it later without it having to be last.

Activity

  1. added
    tree-views
    under-discussion
    on Mar 6, 2018
  2. sandy081 commented on Mar 6, 2018

    @sandy081
    Member

    Danny Tuppeny (@DanTup) A user can change the order by drag and drop. Currently there is no way for extension author to specify the order. They should come in the order they are registered. Let me know if you do not see this?

  3. DanTup commented on Mar 6, 2018

    @DanTup
    ContributorAuthor

    Sandeep Somavarapu (@sandy081) Ah, didn't know the user could change them. When you say registered - you mean in Code and not in the package.json? I'll test again and let you know.

  4. DanTup commented on Mar 6, 2018

    @DanTup
    ContributorAuthor

    Registration order in code doesn't seem to do it:

    Ordering

    Though note that I use context values to toggle visibility of them (so dependencies was visible to the user before the outline).

  5. sandy081 commented on Mar 6, 2018

    @sandy081
    Member

    When you say registered - you mean in Code and not in the package.json?

    In Package.json

  6. DanTup commented on Mar 6, 2018

    @DanTup
    ContributorAuthor

    Sandeep Somavarapu (@sandy081) The Flutter Outline view is already the first one in my packages.json:

    "views": {
    	"explorer": [
    		{
    			"id": "dartFlutterOutline",
    			"name": "Flutter Outline",
    			"when": "dart-code:flutterProjectLoaded && dart-code:showFlutterOutline"
    		},
    		{
    			"id": "dartPackages",
    			"name": "Dependencies",
    			"when": "dart-code:dartProjectLoaded && !dart-code:hidePackageTree"
    		}
    	]
    },
  7. sandy081 commented on Mar 6, 2018

    @sandy081
    Member

    Ok, I will accept this as a bug to show the views in the order they are registered.

  8. added
    bug
    and removed
    under-discussion
    on Mar 6, 2018
  9. DanTup commented on Mar 19, 2018

    @DanTup
    ContributorAuthor

    Sandeep Somavarapu (@sandy081) Still seeing this the wrong way in Insiders dated today. Any ideas?

    bad

  10. sandy081 commented on Mar 19, 2018

    @sandy081
    Member

    Danny Tuppeny (@DanTup) Can you please do following:

    • uninstall/disable the extension
    • Refresh VS Code to have explorer without those views
    • Refresh VS Code again which will override the local storage
    • Install/Enable the extension
    • Check if the views are in the right order
  11. DanTup commented on Mar 19, 2018

    @DanTup
    ContributorAuthor

    Sandeep Somavarapu (@sandy081) The extension isn't installed in my Insiders build, and the windows I tested in is the dev host. I tried:

    • Closing all instances of Code
    • Re-opened Insiders
    • Confirmed the extension is not installed
    • Opened extension source Code
    • Pressed F5 to launch the dev host running the dev build of extension
    • Verified order is still bad

    Note: I'm registering and displaying the trees in the opposite order, but I wanted the Flutter Outline (shown later) to still appear above the dep tree (which is rendered early).

  12. sandy081 commented on Mar 19, 2018

    @sandy081
    Member

    I'm registering and displaying the trees in the opposite order, but I wanted the Flutter Outline (shown later) to still appear above the dep tree (which is rendered early)

    Order of the trees depend on how to register them in package.json. It does not matter when they are displayed.

    Danny Tuppeny (@DanTup) Can you please try it on insiders by installing the extension?

  13. DanTup commented on Mar 20, 2018

    @DanTup
    ContributorAuthor

    Sandeep Somavarapu (@sandy081) Aha, installing from VSIX it worked!

    installed

    Why does it behave different when running in the extension dev host?

  14. sandy081 commented on Mar 20, 2018

    @sandy081
    Member

    Danny Tuppeny (@DanTup) I guess the local storage cached the order. May be clearing the local storage will help.

  15. DanTup commented on Mar 20, 2018

    @DanTup
    ContributorAuthor

    Sandeep Somavarapu (@sandy081) Actually, looks correct now since I installed/uninstalled, so maybe that cleared something. Thanks for the help!

  16. added
    verified
    on Mar 30, 2018
  17. locked and limited conversation to collaborators on Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugtree-viewsverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions