Closed expoure closed 2 years ago
have you installed the telescope dependencies? ( fd-find and rg )
if yes, then you can try this ( to make sure telescope doesn't index useless files)
lvim.builtin.telescope.defaults.file_ignore_patterns = {
"vendor/*",
"%.lock",
"__pycache__/*",
"%.sqlite3",
"%.ipynb",
"node_modules/*",
"%.jpg",
"%.jpeg",
"%.png",
"%.svg",
"%.otf",
"%.ttf",
".git/",
"%.webp",
".dart_tool/",
".github/",
".gradle/",
".idea/",
".settings/",
".vscode/",
"__pycache__/",
"build/",
"env/",
"gradle/",
"node_modules/",
"target/",
"%.pdb",
"%.dll",
"%.class",
"%.exe",
"%.cache",
"%.ico",
"%.pdf",
"%.dylib",
"%.jar",
"%.docx",
"%.met",
"smalljre_*/*",
".vale/",
"%.burp",
"%.mp4",
"%.mkv",
"%.rar",
"%.zip",
"%.7z",
"%.tar",
"%.bz2",
"%.epub",
"%.flac",
"%.tar.gz",
}
It does not work. The lag happens even when I filter by few files :/
hmm, @kylo252 any ideas what might cause this?
please share the output of :checkhealth telescope
fzf
projects
Looking at that demo again, the project isn't that big, and it seems that only the previewer is slow.
:Telescope find_files previewer=false
:TSUpdate
, restart lvim
and see if there's a difference (in case there was an update to the typescript parser)With no previewer there is no lag. I run TSUpdate, restart lvim and telescope with lvim default config still lagging...
I don't really think there's anything to be done from lunarvim's side to be honest. Seems like a bottleneck somewhere between treesitter and telescope. You have actually installed the parser for typescript, right?
some more things to try
:TSUninstall typescript
then search the issue tracker of either plugin, depending on the outcome of the 2 earlier tests
i mean you can try a couple of things as well
:Telescope find_files preview={timeout=1000}
local previewers = require "telescope.previewers"
lvim.builtin.telescope.file_previewer = previewers.vim_buffer_cat.new --use other ones
--- - previewers.cat
--- - previewers.vimgrep
--- - previewers.qflist
--- - previewers.vim_buffer_cat
--- - previewers.vim_buffer_vimgrep
--- - previewers.vim_buffer_qflist
None of the alternatives worked... what intrigues me is that in nvim works perfectly. I also set this lvim.builtin.telescope.defaults = {}
but it keeps lagging.
None of the alternatives worked... what intrigues me is that in nvim works perfectly. I also set this
lvim.builtin.telescope.defaults = {}
but it keeps lagging.
I actually would love to get to the bottom of this, this probably is caused because of some autocommand/misconfiguration on our part, but I'm not quite sure where to begin debugging it 😅 so I think we should keep this issue open until someone comes up with a solution
I'm experiencing the same issue here
specifically on my case, when the project is new and git hasn't been initialised yet, telescope with preview is incredibly slow. After I initialise git, the delay is gone and the preview works normally again. Adding it here cause it might be a good lead on why.
specifically on my case, when the project is new and git hasn't been initialised yet, telescope with preview is incredibly slow. After I initialise git, the delay is gone and the preview works normally again. Adding it here cause it might be a good lead on why.
Which command is specifically slow? is it :Telescope find_files
? or are you using the mapping <leader>f
because that one is bound to use this function
https://github.com/LunarVim/LunarVim/blob/7712a63e7f1189788fd99be2f0af1159acf54b14/lua/lvim/core/telescope/custom-finders.lua#L87-L95
I'm experiencing lag when trying to use Telescope in a large Rails project. For example, if I want to open the config/test.rb
file, I type test
and see the UI update immediately with bad results. However, a couple of seconds later, the results update again with the correct match.
i just updated nvim to 0.7 and the telescope error disappeared...
I'm experiencing lag when trying to use Telescope in a large Rails project. For example, if I want to open the
config/test.rb
file, I typetest
and see the UI update immediately with bad results. However, a couple of seconds later, the results update again with the correct match.
just a sanity check, but you have installed a treesitter parser for ruby, right? and the performance there is acceptable?
just a sanity check, but you have installed a treesitter parser for ruby, right? and the performance there is acceptable?
Yep (assuming it was installed automatically by LunarVIm). Syntax highlight seems to work without a perceptible lag, so it seems to be working well. The null-ls Rubocop checks take about a second to run, but I think that's normal performance for Rubocop.
I have a gut feeling that this might be related to #2514, specifically, it being slow in projects with a large number of commits. I added a repro case to that PR for a project with a semi-large number of commits, and I noticed a perceptible slowdown for Telescope.
are you sure you're not somehow bottlenecked with your git
version? I can't reproduce this with https://github.com/LandonSchropp/lunar-vim-example-issue either.
Hmm, I don't think so. I'm running 2.35.1
currently, which is fairly up-to-date.
Are you maybe using a more powerful machine than me? Could you try generating another 100,000 commits using the script in that repo and seeing if you still don't have any performance issues?
Hello everyone! I'm current using the Neovim 0.7 and I'm experiencing some lag when trying to use Telescope in some projects, specially in projects with minified JS files.
I'm found this issue on Telescope repository Telescope live_grep freezes nvim sometimes and following this comment I've changed the /.local/share/lunarvim/lvim/lua/lvim/core/telescope.lua
file, adding this (preview.treesitter = false
) on lvim.builtin.telescope.defaults
section (line 16):
-- ...
lvim.builtin.telescope = vim.tbl_extend("force", lvim.builtin.telescope, {
defaults = {
preview = {
treesitter = false,
},
prompt_prefix = "ï‘« ",
-- ...
After this change, the Telescope find and live_grep modes works much more faster here!
I've changed the
/.local/share/lunarvim/lvim/lua/lvim/core/telescope.lua
file, adding this (preview.treesitter = false
) onlvim.builtin.telescope.defaults
section (line 16):
This is more of a hammer fix that isn't really needed
specially in projects with minified JS files.
you've identified the problem here, and so you can achieve the same thing in multiple more flexible ways
turn off treesitter for js until they fix the parser, :TSUninstall javascript typescript
-- remove it from this list
lvim.builtin.treesitter.ensure_installed = { "lua", "c", --[[ ... ]] }
create another telescope function that doesn't use the treesitter previewer which you can use in those projects
local function grep_no_ts()
require("telescope.builtin").live_grep { preview = { treesitter = false }, prompt_title = "no treesitter" }
end
-- add a keybind for it for easier access
vim.keymap.set("n", "<c-f>", grep_no_ts)
if you're still not happy with all of this, simply use your solution like this
lvim.builtin.telescope.defaults.preview = { treesitter = false }
-- I think you can even do this
-- lvim.builtin.telescope.defaults.live_grep.preview = { treesitter = false }
@kylo252 I forgot of this option (alternative 1), it's works much more better, thank you!
Problem description
1 - open a big project 2 - try navigate in telescope
below a compartion between nvim and lvim
my nvim configuration for telescope: `if !exists('g:loaded_telescope') | finish | endif
nnoremap ;f lua require('telescope.builtin').find_files()
nnoremap ;r lua require('telescope.builtin').live_grep()
nnoremap ;b lua require('telescope.builtin').file_browser()
nnoremap \ Telescope buffers
nnoremap ;; Telescope help_tags
lua << EOF function telescope_buffer_dir() return vim.fn.expand('%:p:h') end
local telescope = require('telescope') local actions = require('telescope.actions')
telescope.setup{ defaults = { mappings = { n = { ["q"] = actions.close }, }, } } EOF`
https://user-images.githubusercontent.com/12136268/162202466-7d695897-664f-4020-ad0a-e3ea5580bfab.mp4
LunarVim version
master-23feb96
Neovim version (>= 0.6.1)
0.6.1
Operating system/version
Archlinux
Relevant log output
Screenshots
No response