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

Empty array is always assumed to be a Flat in DocumentSymbolResponse #275

Open
tonyxty opened this issue Dec 29, 2023 · 0 comments
Open

Comments

@tonyxty
Copy link

tonyxty commented Dec 29, 2023

An empty array in DocumentSymbolResponse is always interpreted as Flat([]). When the server is known to always return a Nested result, this makes it inconvenient to handle the result. A similar situation happens with GotoDefinitionResponse, where an empty array is always assumed to be an array of Locations instead of LocationLinks.

Would it be worthwhile to provide an option to control which variant an empty array deserializes as? It can be implemented by declaring an alternative enum with different ordering of variants, but that seems a bit boilerplate.

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

1 participant