-
Notifications
You must be signed in to change notification settings - Fork 223
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
Arrays of objects are not split up in the yaml outline #106
Comments
The only way to get the behavior I think you're wanting is to wrap the object document symbols in an object symbol with name Object[0] ... Object[N] though currently the results are consistent with the JSON language server. |
Okay so the underlying parser for this project and that site I linked are different? It doesn't have the ability to tell which values are grouped together in an array? |
It does; thats not the problem. The outline view in VSCode is just getting the document symbols and showing them in a hierarchical way. Its just the only way to achieve this result (as far as I know) is returning a symbol information node that would be the root of the object but I can look into it more. |
okay, so since there isn't like a strictly defined object name for each element, it's just smashing each object's values together. In order to get what I'm looking for I'd have to make some kind of dummy object for each element of the array to get it represented in the hierarchy. that seems a bit wasteful, and I don't think I'd change my code just to get it to display prettier there. I feel like just having the object symbol with no name and a dropdown would be a fine workaround and still be pretty clear. But not sure what would be best. |
That would have to be done on this extensions side not on your side.
Perhaps that could work. Though i'm not entirely sure if the language server protocol states whether or not the text should be empty strings or not. Additionally, the regular document symbols (ctrl+shift+o for me on VSCode i'm not sure if thats the default or not though) would just have an empty text field for those objects which wouldn't be really helpful. I'll play around with it and see. |
This should work now as we've implemented hierarchical document symbols. |
Here is an example image: https://cl.ly/0d3J3r3R202l
The text:
instances
just appearing as an array with a bunch of duplicate values. http://yaml-online-parser.appspot.com/ seems to correctly parse this as:The text was updated successfully, but these errors were encountered: