nvim-telescope / telescope.nvim

Find, Filter, Preview, Pick. All lua, all the time.
MIT License
15.41k stars 823 forks source link

telescope.nvim doesn't show anything #2294

Open Canertsz opened 1 year ago

Canertsz commented 1 year ago

Description

short demonstration of problem

i installed kickstart.nvim and tried to use telescope.nvim with space+s+f combination, telescope screen prompts but it doesn't search anyting.

i checked my dependencies with :checkhealth telescope if they broken and i saw some errors, after i re-install those dependencies everything looks fine.

if it's helpful, here is my full :checkhealth https://pastebin.run/k3zjj9d492gk

when i run :Telescope in neovim it works.

Neovim version

NVIM v0.7.2
Build type: Release
Lua 5.1

Operating system and version

Ubuntu 22.04

Telescope version / branch / rev

telescope 0.1.0

checkhealth telescope

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0
  - OK: fd: found fd 8.3.1

## ===== Installed extensions =====

Steps to reproduce

  1. open random text
  2. use :Telescope find_files

Expected behavior

Show files in directory

Actual behavior

it shows nothing

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
JLCarveth commented 1 year ago

I am getting the exact same issue (no files shown, no issues in healthcheck) with this minimal config:

require('telescope').setup({
    defaults = {
        file_ignore_patterns = { "./node_modules/*", "node_modules", "build/*" },
    }
});
local builtin = require('telescope.builtin');
vim.keymap.set('n', '<leader>ff', builtin.find_files, {});

I never had issues with it working until a couple days ago, never changed any configs on my end.

EDIT: After changing nothing, it is now working again... EDIT 2: I have figured out why this is happening. More of an issue with sharkdp/fd instead of telescope. It's relating to a .gitignore I have in my root ~ git repository. I use this root repository for managing my dotfiles, and the .gitignore simply contains '*' to ignore everything by default. So when I run fd within a directory that didn't have it's own repository, it would fallback to the root .gitignore and then ignore all files during the search. Initializing a git repository allowed telescope to see my files again. Hope that helps anyone else with the same issue :)

Conni2461 commented 1 year ago

@Canertsz Your issue might be with your neovim. Can you build it with LuaJIT and not Lua 5.1. Neovim builds with Luajit on default

ReggieReo commented 1 year ago

@JLCarveth

EDIT 2: I have figured out why this is happening. More of an issue with sharkdp/fd instead of telescope. It's relating to a .gitignore I have in my root ~ git repository. I use this root repository for managing my dotfiles, and the .gitignore simply contains '*' to ignore everything by default. So when I run fd within a directory that didn't have its own repository, it would fallback to the root .gitignore and then ignore all files during the search. Initializing a git repository allowed telescope to see my files again. Hope that helps anyone else with the same issue :)

Thank you, I also have .gitignore in my ~ dir. I tried using vim many times, but telescope doesn't work at all. I tried again today, and found this your commend, can't thank you enough.