What is the rationale behind having the textDocument/documentSymbol result being an array of either SymbolInformation or DocumentSymbol types?
SymbolInformation is easier to implement. So it's easier to get something out the door. But prefer DocumentSymbol as clients can use the extra structure for a better presentation.
The real answer is backward compatibility. DocumentSymbol was added in v3.10.0. If DocumentSymbolClientCapabilities.hierarchicalDocumentSymbolSupport is not true, then you must provide SymbolInformation. If it is true, you should prefer DocumentSymbol.
@KamasamaK thanks for jumping in.
Most helpful comment
The real answer is backward compatibility.
DocumentSymbolwas added in v3.10.0. IfDocumentSymbolClientCapabilities.hierarchicalDocumentSymbolSupportis nottrue, then you must provideSymbolInformation. If it istrue, you should preferDocumentSymbol.