autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 273 forks source link

Document symbol container name #1234

Open ANtlord opened 3 years ago

ANtlord commented 3 years ago

This is rather a proposal within demo than a pull request. It adds containerName into the text which is shown in a document symbols list. It improves user experience as one can see where a symbol from. In the screenshots you can see that a couple structures can have the same function just implementing one trait. The similar experience is writing Python. A couple of class can have __init__ method so in symbols you can't see which class the selected constructor for.

I'm not sure about where to place containerName in a symbol list's item, so I'm open to suggestions. Currently I decided to add it as a prefix with :: as a divisor. I didn't find a convinient way to make it as an option in settings.

Take a look at the screenshots.

before after