-
Hi im trying a hack like this to decorate text of each lsp entry by hooking into regex_filter that (apparently ?) is only available in lsp provider and there I access item.text and mutate it. It allows me customize entries while using all sorts of baked in nifties like jump1, ignore_current_line, file_ignore_patterns and miltiline that come with fzf lsp handlers. I tried to manually parse initially with vim.lsp.buf.references etc... but then I am left too much missing functionality. My question is is there a better way to achieve what I am trying to achieve while maintaining all those features without having to mutate entry items via regex_filter? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Use a formatter, take a look at how fzf-lua/lua/fzf-lua/defaults.lua Line 236 in 3d43421 Symbols formatter (probably better suited here since you need it for LSP which isn’t fzf-lua/lua/fzf-lua/defaults.lua Lines 902 to 918 in 3d43421 |
Beta Was this translation helpful? Give feedback.
Ok fair enough. I kind of figured it out in the meantime. Formatter is not suited for what I originally asked because it only has access to filename and doesn't have access to item.text so whatever I append to the end becomes a prefix for :lnum:col: text.
So I used the inversion and chose a prefix approach which worked well.So I had to go with prefix approach to make it work with formatter.
So for those who are stuck with the same request here is my take: https://github.com/kapral18/dotfiles/blob/main/home/dot_config/exact_nvim/exact_lua/exact_plugins/fzf-filters-lsp.lua#L15-L65
So basically from what I understand:
engage
is for decorating opts before they are passed into fzf_to
is fo…