[clangd] Add support for hierarchical documentSymbol
Changes PlannedPublic

Authored by ilya-biryukov on Sep 20 2018, 9:11 AM.

Details

ilya-biryukov created this revision.Sep 20 2018, 9:11 AM
ilya-biryukov planned changes to this revision.Sep 20 2018, 9:14 AM

Posted to make sure it's visible that I've started doing this.
Still need to update the tests and check for the capability from the client (and fallback to SymbolInformation if client does not support the new implementation).

Nevertheless, it works and looks really good in VSCode.

Will update the thread when the code is ready for review.

Ohh awesome, I didn't know the LSP supported that. I'll try it it Theia when I have time.

simark added a comment.Thu, Oct 4, 2:38 PM

I just tried this, this looks very promising! It should help build our outline view in a much more robust way than we do currently.

A nit for the final patch, I would suggest omitting the fields that are optional, like children (when the list is empty) and deprecated.

In vscode, is there a way to get a tree representation of this data? When I look at "Go to symbol in File..." (ctrl-shift-o) or the outline view at the bottom of the file explorer, they are both a flat list. What difference does this patch make in how vscode shows the data?

I just tried this, this looks very promising! It should help build our outline view in a much more robust way than we do currently.
A nit for the final patch, I would suggest omitting the fields that are optional, like children (when the list is empty) and deprecated.

SG, will do.

In vscode, is there a way to get a tree representation of this data? When I look at "Go to symbol in File..." (ctrl-shift-o) or the outline view at the bottom of the file explorer, they are both a flat list. What difference does this patch make in how vscode shows the data?

There's an outline view that shows the tree after this patch.
IIRC, the "Go to symbol in File..." also shows the tree view now without the lack of functionality like filtering by name, etc.
Overall, the experience with a tree seemed strictly better in all scenarios for me.