Telescope configuration in the README does not work
As far as I can tell, the Telescope configuration suggested in the README of this repo doesn't work.
local actions = require("telescope.actions")
local trouble = require("trouble.providers.telescope")
require('telescope').setup {
defaults = {
-- Default configuration for telescope goes here:
mappings = {
i = { ["<c-e>"] = trouble.open_with_trouble },
n = { ["<c-e>"] = trouble.open_with_trouble },
}
-- remaining config
}
}
It also differs markedly from other Telescope extensions which require something like require('telescope').load_extension("dap"), for instance.
Is this work for you?
["<C-e>"] = function(prompt_bufnr, _mode)
require("trouble.providers.telescope").open_with_trouble(prompt_bufnr, _mode)
end,
On a side note, I don't really understand what the configs do. I don't think it's supposed to open the diagnostics in Telescope, but any Telescope panel inside Trouble's?
@baggiponte you can open search results from Telescope in Trouble.
Like live-grep in Telescope, hit <c-t> and you have all the resulsts in trouble
I'm also running into this issue, I would try to debug but when I try to open telescope results with trouble it appears to just hang, until I hit ctrl-c
EDIT: This is the error I get when trying to open in trouble:
Logs...
ï™™ Error 12:48:36 msg_show.lua_error E5108: Error executing lua Vim(append):Error executing lua callback: ...brew/Cellar/neovim/0.8.0/share/nvim/runtime/filetype.lua:22: Error executing lua: ...brew/Cellar/neovim/0.8.0/share/nvim/runtime/filetype.lua:23: Keyboard interrupt
stack traceback:
[C]: in function 'nvim_cmd'
...brew/Cellar/neovim/0.8.0/share/nvim/runtime/filetype.lua:23: in function <...brew/Cellar/neovim/0.8.0/share/nvim/runtime/filetype.lua:22>
[C]: in function 'nvim_buf_call'
...brew/Cellar/neovim/0.8.0/share/nvim/runtime/filetype.lua:22: in function <...brew/Cellar/neovim/0.8.0/share/nvim/runtime/filetype.lua:11>
[C]: in function 'bufload'
...site/pack/packer/start/trouble.nvim/lua/trouble/util.lua:153: in function 'item_to_result'
...r/start/trouble.nvim/lua/trouble/providers/telescope.lua:39: in function 'open_with_trouble'
[string "..."]: in function 'key_func'
...k/packer/start/telescope.nvim/lua/telescope/mappings.lua:352: in function 'execute_keymap'
[string ":lua"]:1: in main chunk
stack traceback:
[C]: in function 'nvim_buf_call'
...brew/Cellar/neovim/0.8.0/share/nvim/runtime/filetype.lua:22: in function <...brew/Cellar/neovim/0.8.0/share/nvim/runtime/filetype.lua:11>
[C]: in function 'bufload'
...site/pack/packer/start/trouble.nvim/lua/trouble/util.lua:153: in function 'item_to_result'
...r/start/trouble.nvim/lua/trouble/providers/telescope.lua:39: in function 'open_with_trouble'
[string "..."]: in function 'key_func'
...k/packer/start/telescope.nvim/lua/telescope/mappings.lua:352: in function 'execute_keymap'
[string ":lua"]:1: in main chunk
stack traceback:
[C]: in function 'bufload'
...site/pack/packer/start/trouble.nvim/lua/trouble/util.lua:153: in function 'item_to_result'
...r/start/trouble.nvim/lua/trouble/providers/telescope.lua:39: in function 'open_with_trouble'
[string "..."]: in function 'key_func'
...k/packer/start/telescope.nvim/lua/telescope/mappings.lua:352: in function 'execute_keymap'
[string ":lua"]:1: in main chunk
The error I get seems to sometimes come almost always during this method
Anyone figured it out ?
Unfortunately no @pythops , still happening :/ such a bummer 'cause I love trouble and telescope. A smidge difficult to debug without knowing both well though
I have encountered this issue too.
Anyone got it working? Seems like it still hangs when trying to send the telescope results to trouble...
This solution works for me, I use nvchad , so lazy.nvim.
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
},
config = function(_, opts)
local actions = require("telescope.actions")
local trouble = require("trouble.providers.telescope")
opts.defaults.mappings = {
i = { ["<c-o>"] = trouble.open_with_trouble },
n = { ["<c-o>"] = trouble.open_with_trouble },
}
require("telescope").setup(opts)
end,
}
Development on the main branch is EOL.
Trouble has been rewritten and will be merged in main soon.
This issue/feature either no longer exists or has been implemented on dev.
For more info, see https://github.com/folke/trouble.nvim/tree/dev