-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Error because textDocument/documentHighlight isn't supported in the current buffer #1294
Comments
This seems to me to be coming from an auto command making a request to |
Okay, I will explore my config and other plugins! Sorry for the noisy issue. |
Did you find the culprit? We can leave this open until you have a solution, I’m still doubtful it’s fzf-lua but you never know. |
I'm pretty sure the issue is coming from |
Nice find, ty for the update @MariaSolOs! |
Ehhh so after investigating this further it seems to be caused by an autocommand I wrote 😅 Yet I'm quite confused about the error... I have the following in my if client.supports_method(methods.textDocument_documentHighlight) then
local under_cursor_highlights_group =
vim.api.nvim_create_augroup('mariasolos/cursor_highlights', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'InsertLeave', 'BufEnter' }, {
group = under_cursor_highlights_group,
desc = 'Highlight references under the cursor',
buffer = bufnr,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ 'CursorMoved', 'InsertEnter', 'BufLeave' }, {
group = under_cursor_highlights_group,
desc = 'Clear highlight references',
buffer = bufnr,
callback = vim.lsp.buf.clear_references,
})
end And so the error message seems to indicate that somehow there's no client supporting |
Maybe an upstream bug? Can you check which buffer is this failing on? Would be interesting to see if this is triggered by one of your existing buffers or an fzf-lua buffer (although the preview shouldn’t trigger LSP attach). |
Yep I'll try adding extra logging there to have more information when I see the bug. It doesn't always happen, I would say it happen < 5% of the times I use the Files/Recent Files picker. |
Does it happen when you open the picker (most likely from preview) or after selecting the file (I.e. from the edit action)? |
It always happen after selecting the entry, so I don't think it's the preview. |
Than most likely this happens due to the |
RTFM Checklist
man fzf
/ I am well versed in shell fzfOperating system
Fedora 40
Shell
fish
Neovim version (
nvim --version
)v0.11.0-dev-286+g38a1d41ac
Fzf version (
fzf --version
)0.44.1
Output of
:lua print(os.getenv('FZF_DEFAULT_OPTS'))
--color=fg:#f8f8f2,bg:#0e1419,hl:#e11299,fg+:#f8f8f2,bg+:#44475a,hl+:#e11299,info:#f1fa8c,prompt:#5 0fa7b,pointer:#ff79c6,marker:#ff79c6,spinner:#a4ffff,header:#6272a4 --cycle
Is the problem reproducible with
mini.sh
?mini.sh
mini.sh
mini.sh
(not relevant, requires LSP, Windows, etc)Fzf-lua configuration
Describe the bug / steps to reproduce
During the last couple of days I've seen the error below pop up once in a while when using the files picker. It doesn't always happen, but lately I've been working on a simple Rust project.
The text was updated successfully, but these errors were encountered: