telescope.nvim
telescope.nvim copied to clipboard
Unsure of how we got this failure
Description
Hello, there are some errors with copilot.vim, "Unsure of how we got this failure".
Neovim version
NVIM v0.8.0-dev+313-g7b952793d
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=malloc -Wsuggest-attribute=cold -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az220-948
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/share/nvim"
Run :checkhealth for more info
Operating system and version
arch linux
checkhealth telescope
telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
- OK: plenary installed.
- WARNING: nvim-treesitter not found.
## Checking external dependencies
- OK: rg: found ripgrep 12.1.1
- WARNING: fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities
## ===== Installed extensions =====
Steps to reproduce
-
nvim -nu minimal.lua
- (I have also configed
copilot.vim
, so skip this step ) -
:Telescope
- enter <esc> to quit the telescope window
- press 'o' to create new row
- input any character and press tab after the character quickly, error will occured
Expected behavior
no error message
Actual behavior
Minimal config
vim.g.do_filetype_lua = 1
vim.g.did_load_filetypes = 0
local fn = vim.fn
local cmd = vim.cmd
local packer_boot_strap = false
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packer_boot_strap = fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
if packer_boot_strap then
cmd [[packadd packer.nvim]]
else
return
end
end
require('packer').startup({ function(use)
use { 'wbthomason/packer.nvim' }
use { 'github/copilot.vim',
event = 'InsertEnter',
config = function()
vim.cmd[[
let g:copilot_filetypes = {
\ 'TelescopeResults': v:false,
\ 'TelescopePrompt': v:false,
\ }
]]
end
}
use { 'nvim-telescope/telescope.nvim',
config = function()
require('telescope').setup()
end,
requires = {
{ 'nvim-lua/plenary.nvim' },
},
cmd = { 'Telescope' },
}
-- packer auto install if packer is installed for the first time
if packer_boot_strap then
require('packer').sync()
end
end,
config = { -- packer using float window
display = {
open_fn = function()
return require('packer.util').float({ border = 'single' })
end
}
}
})
Did you try to disable all of Telescopes filetypes for copilot? TelescopePrompt
and TelescopeResults
?
https://github.com/github/copilot.vim/blob/ad102c7a58356414f18680f60c2298246e41ccea/doc/copilot.txt#L43-L59
Or even better only enable copilot for filetypes you need. Maybe that helps, if not i would install copilot and try it out myself
Yes, the problem still exists. I have changed the minimal config with 'g:copilot_filetypes'.
Hmm okay i can reproduce. Its weird, i dont know why you can trigger a telescope mapping even thought we already closed that buffer. My only assumption right now is that these mappings are not yet cleaned fully cleaned up. I can remove that error message, but that only gonna "eat" the <Tab>
keypress. Calling :mapclear <buffer>
prior to deleting the buffer also didn't help
I need to investigate more, on what going wrong here.
I'm getting the exact same error message, but I'm using coc instead of copilot
i found out that <Tab> keymap was overrided by this
Resolved this issue by removing event = "InsertEnter
, then the key binding for <Tab>
works as expected.
Suppose it is due to Copilot is forced to load before Telescope
my solution is using copilot.lua
I'm also getting this error. Tried installing copilot.lua but also having the same error.
For the time being, I have just remapped tab to behave as usual.
@paulochoi If you are using Lazy.nvim for your package manager, this may help.
https://github.com/mskelton/dotfiles/commit/6cebc2d8b8d13eb622ba4054df49d9b05ae57ecf
The issue for me was that I was loading copilot after Telescope which caused issues with the mappings. Using VimEnter
as the event for copilot ensured that it would load before Telescope with my config and then everything worked as normal.
Hope that helps!
Thanks for that, you are right. Looks like copilot is loading after telescope here. I typically launch neovim with telescope find_files as a command and looks like when I do that, telescope is the first thing that loads and it is causing the problem.
Edit: For anyone coming accross from here, remapping tab according to this comment did it for me: https://github.com/LunarVim/LunarVim/issues/1856#issuecomment-954224770
Can someone retest this. we actually might have fixed this issue, because we rewrote our mappings (latest master) and it might have fixed that issue because we no longer have a couple of hacks for mappings and the "Unsure of how we got this failure" code also no longer exists.
I have reverted my workaround and can confirm that the error no longer occurs. Thanks @Conni2461 and team!
Thanks for retesting. If this issues comes back, feel free to reopen
This is fixed for me as well, thanks so much I really appreciate it!