Skip to content
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

Nil Search Results for Telescope live_grep #967

Closed
rrpolanco opened this issue Jul 9, 2021 · 7 comments
Closed

Nil Search Results for Telescope live_grep #967

rrpolanco opened this issue Jul 9, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@rrpolanco
Copy link

Description

I'm working inside a Go project where I tried to do a live_grep for a keyword which shows invalid results. However the term does yields results in rg from the terminal.
When typing the search term, nvim shows me the following error:

E5108: Error executing lua /tmp/plugged/telescope.nvim/lua/telescope/make_entry.lua:149: attempt to concatenate field 'filename' (a nil value)

image

Expected Behavior
Expect valid search hits for the term I'm looking for.

Actual Behavior
When searching for something, I get nil:nil:nil:nil results.

Details

Reproduce
  1. nvim -nu test.vim
  2. :Telescope live_grep
  3. Observe nil:nil:nil:nil results
Environment
  • nvim --version output:
    NVIM v0.5.0
    Build type: Release
    LuaJIT 2.1.0-beta3
    Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG - 
    Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing- 
    prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto - 
    DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 - 
    DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210702-21950-fs4dxz/neovim-0.5.0/build/config - 
    I/tmp/neovim-20210702-21950-fs4dxz/neovim-0.5.0/src -I/usr/local/include - 
    I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim- 
    20210702-21950-fs4dxz/neovim-0.5.0/build/src/nvim/auto -I/tmp/neovim-20210702-21950-fs4dxz/neovim- 
    0.5.0/build/include
    Compiled by brew@iMac-Pro
    
    Features: +acl +iconv +tui
    See ":help feature-compile"
    
     system vimrc file: "$VIM/sysinit.vim"
    fall-back for $VIM: "/usr/local/Cellar/neovim/0.5.0/share/nvim"
    
    Run :checkhealth for more info
    
  • Operating system: MacOS 10.15.7
  • Telescope commit: 1dd6f8408b6e3334ddba695a7c4e0fd500f9bff6
Configuration

set nocompatible hidden laststatus=2

if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

source /tmp/plug.vim
call plug#begin('/tmp/plugged')
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
call plug#end()

autocmd VimEnter * PlugClean! | PlugUpdate --sync | close
lua require('telescope').setup()
@rrpolanco rrpolanco added the bug Something isn't working label Jul 9, 2021
@cg-jl
Copy link
Contributor

cg-jl commented Jul 9, 2021

Good news! I could reproduce the bug in an arch container (neovim 0.5.0 is mainstream there so easier to install). Do you have a big repo? it seems like it only shows when receiving big inputs. I've ran live_grep over an empty directory, this same repository and / and the nil:nil:nil:nil showed up only in the last one (over 2M resuls with an 'a').

@rrpolanco
Copy link
Author

Good news! I could reproduce the bug in an arch container (neovim 0.5.0 is mainstream there so easier to install). Do you have a big repo? it seems like it only shows when receiving big inputs. I've ran live_grep over an empty directory, this same repository and / and the nil:nil:nil:nil showed up only in the last one (over 2M resuls with an 'a').

It's not a big repo. The Go project only has 88 files.

@Conni2461
Copy link
Member

This issue also happens if you change the ripgrep command from --color=never to always because we currently do not handle ansi colors, that might happen soon (press rocket here #670 to make it happen)

So basically does this happen with the config you provided and nvim -nu minimalconfig.vim?

@rrpolanco
Copy link
Author

So basically does this happen with the config you provided and nvim -nu minimalconfig.vim?

@Conni2461 Issue surfaces with config provided(test.vim) w/o overriding any of the telescope defaults.

@shadmansaleh
Copy link

shadmansaleh commented Jul 10, 2021

I got the same error when I removed --column from vimgrep_argument .

Is there any way to remove column no from live grep ?

@Julian
Copy link
Contributor

Julian commented Jul 11, 2021

This also happens if there's a nonexisting directory in the list. E.g.:

require'telescope.builtin'.live_grep{ search_dirs = { "/does/not/exist" } }

(and then type a character). Where of course in real life, /does/not/exist is one of a few directories I passed into search_dirs, others of which exist.

@Conni2461
Copy link
Member

This issue is fixed for quite some time. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants