-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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 - no tree navigator #64793
Comments
Can you elaborate? |
Please look at how the outline uses the navigator API today |
This is the only thing I could find: https://github.com/Microsoft/vscode/blob/dbb6f6d807f63429c0eb6913e86885f431b3832b/src/vs/editor/contrib/documentSymbols/outlineTree.ts#L271 We already discussed that you'd get expansion state preservation for free... So, I'm guessing there's another place...? |
yes, outlinepanel.ts |
So, let me elaborate this for myself:
There are already Is the another situation? |
Yes, that would work for that usage in the outline panel. Tho, looking at how |
I am trying to reimplement the navigator (outside of the tree) but I don't think it's possible to tell whether an element is filtered out or not, is it? |
🤞 we aren't all doing this. @roblourens do you build your navigator for re-use please? then I can use it for breadcrumbs. |
Since I think I haven't laid out my argument against a tree navigator, here it is: it inverts the model-view pattern by exposing a view as a model. Data flow ceases to be one directional and things become harder to reason about. Because of being against it, I've been trying to be helpful in understanding each use case for it and attempting to provide alternatives, like I've done for outline: #64793 (comment). I'm pretty sure the same could be done for all current usages of the tree navigator, and would be willing to expose tree API to make it so. At the same time, I feel I'm wasting my time in dealing with unhelpful comments like:
So I basically stopped caring. I've pushed a You can use it in the @roblourens Sorry if you wasted time on this attempting to create a navigator using |
No worries, thanks for making one. I understand your argument and I'm not opposed to getting rid of it in the future. Search is a very heavy user of it (more than I realized originally) and since I'm making lots of changes already, it's much easier to work with the same interface and not have to figure out how to refactor around it. |
@jrieken note that this navigator doesn't update its indexes if the list view is modified, so be careful if you are expanding/collapsing nodes while navigating. Search can work around it by recreating the navigator from a certain element. |
Yeah, I forgot the necessary warning: do not use it across tree modifications, it will definitely break. |
Not looping and navigating but missing that fact that the old navigator could start at any element. It seems I now have to fast forward till the anchor element and then go bwd/fwd to the actual element |
I added that to the navigator yesterday @jrieken |
Oh I guess it's only in my branch. I can put it in master. |
blocks #64727
the outline uses the tree navigator to select previous/next elements when having searched. this will be a lot more cumbersome using
getNode
API and navigation APIsThe text was updated successfully, but these errors were encountered: