Skip to content

Conversation

bretello
Copy link
Contributor

@bretello bretello commented Jul 28, 2025

This (WIP) adds :ALEFindReferences -fzf to list/matches found by the LSP Server using fzf and fzf.vim.

This is a very rough draft, but this is what's working:

  • Listing files matched by the LSP using fzf
  • Showing previews for matches
  • Opening multiple files in splits, tabs (using fzf's ctrl-t/ctrl-x/ctrl-v default keybindings)
  • Populating quickfix with matches seleted in fzf results

What's not done yet:

  • docs
  • tests

Here's what this looks like so far:

asciicast

alefindreferences-fzf

old asciicast

fzf-references

Related: #2252, #3321, #5001

cc @w0rp would love some feedback

bretello added 3 commits July 29, 2025 12:54
…ntents option to configure default behaviour
- add support for opening in splits, tabs and for adding matches quickfix
- add support for -relative
- add fzf preview `--highlight-line` option
- cleanup fzf options
Copy link
Member

@w0rp w0rp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a decent idea to me for fzf users. You could move the fzf specific code to an autoload/ale/fzf.vim script so it's only loaded on demand. You could edit the HandleLSPResponse function back to how it was without the early return as it was fine how it was and we don't need such a big diff.

\)
endfor
function! ale#references#ShowInFzf(item_list, options) abort
let name = "LSP References"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the l: variable prefix for local variables to be consistent with the rest of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants