gfanto / fzf-lsp.nvim

Enable the power of fzf fuzzy search for the neovim built in lsp
MIT License
223 stars 11 forks source link

Sort document/workspace symbols by type #10

Open whitebyte opened 3 years ago

whitebyte commented 3 years ago

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

gfanto commented 3 years ago

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!