fzf-lsp.nvim icon indicating copy to clipboard operation
fzf-lsp.nvim copied to clipboard

Sort document/workspace symbols by type

Open whitebyte opened this issue 3 years ago • 1 comments

Hi, thanks for the wonderful plugin! Is it possible to sort document symbols by type? E.g. all properties first, all methods after properties, standalone constants after methods, vars after constants etc

whitebyte avatar Apr 25 '21 10:04 whitebyte

Hi, and thank you! That's a good idea and i had never think about that. Unfortunately this is very language server dependent and the language server protocol doesn't seem to have this option (as far that i know). Maybe i can add a sort function configurable parameter to do the work, and i can even try to make some heuristic assumption, but i have to think about that and make some experiments with various language servers. If you want to try experimenting yourself in the mean time, you can for example override the default vim.lsp.util.symbols_to_items function given by default from neovim, returning the sorted values.

Obviusly if you have any ideas or suggestions, they are always welcome!

gfanto avatar Apr 25 '21 12:04 gfanto