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

Tree open state lost on restore completion when package disappears #1320

Closed
333fred opened this issue Jan 23, 2017 · 6 comments
Closed

Tree open state lost on restore completion when package disappears #1320

333fred opened this issue Jan 23, 2017 · 6 comments
Assignees
Milestone

Comments

@333fred
Copy link
Member

333fred commented Jan 23, 2017

Steps:

  1. Create a new .NET Core App of some kind (I used a class library)
  2. Expand the Dependencies->NuGet elements to see the NuGet dependencies. Select a dependency (I selected .NET Core App). Like this:
    image
  3. Edit the csproj to change TFM to netstandard1.4. Save.
  4. On restore completion, the tree will refresh.

Expected:
The NuGet tree is expanded, showing the new dependency, like this:
image

Actual:
NuGet tree is collapsed:
image

@333fred
Copy link
Member Author

333fred commented Jan 23, 2017

/cc @abpiskunov

@abpiskunov
Copy link
Contributor

hm .. that is out of control we send changes to CPS remove and re-add in one requesdt and it does this thing. I will open a bug on their side to see if they could get us option to show some node after tree updates..

@davkean
Copy link
Member

davkean commented Jan 23, 2017

Agreed, ran into this a few times. It's annoying.

@jviau
Copy link
Contributor

jviau commented Jan 26, 2017

A couple things:

  1. IProjectTree is VS-agnostic and has no concept of selection. I am not sold on introducing something like that there.

  2. You are performing a Remove -> Add, so CPS does not try to maintain the same expanded state. If you perform a Rename I think CPS will try to maintain the same selection state. I know for the physical tree it should, not sure about virtual trees.

You can always manually re-expand the NuGet node by using IVsUIHierarchyWindow.ExpandItem.

@abpiskunov
Copy link
Contributor

Fixed for most cases by #1880 . Notice that in case when dependency supports lower hierarchies and it existed in the tree, when we update it and change it state from unresolved to resolved we have to remove it and readd. If we don't do that and just update in place like we do everytime now, GraphProvider would not be updated by CPS and would not know that node has children now. I will open a CPS issue for that, but from roslyn project system i did change to update tree nodes instead of removing them everytime.

@abpiskunov
Copy link
Contributor

CPS bug opened 405833

@drewnoakes drewnoakes removed the Bug label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants