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

attempt to call field 'str_byteindex' (a nil value) #3395

Open
juanolon opened this issue Jan 3, 2025 · 0 comments
Open

attempt to call field 'str_byteindex' (a nil value) #3395

juanolon opened this issue Jan 3, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@juanolon
Copy link

juanolon commented Jan 3, 2025

Description

I have seem related issues already closed (#3346), but i still get the error:

Error executing vim.schedule lua callback: ...nvim/lazy/telescope.nvim/lua/telescope/builtin/__lsp.lua:129: attempt to call f
ield 'str_byteindex' (a nil value)                                                                                  
stack traceback:                                                                                                             
        ...nvim/lazy/telescope.nvim/lua/telescope/builtin/__lsp.lua:129: in function 'item_to_location'                      
        ...nvim/lazy/telescope.nvim/lua/telescope/builtin/__lsp.lua:265: in function 'handler'                               
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:936: in function 'handler'                                             
        /usr/local/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''                                             
        vim/_editor.lua: in function <vim/_editor.lua:0>            

At first, i thought it was about my nvim version, but i just upgraded from 0.10.2 to 0.10.3 without success. Then I reinstalled telescope (i'm using Lazy) and checked that the version are okey. Everything right. Heck, i even looked into the local source file (https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/utils.lua) to check if the function exists, and it does.
So then i checked if the import is correct:

:lua print(require "telescope.utils".iswin)

prints false, and

:lua print(require "telescope.utils".islist)

prints function: 0x7f...
but!

:lua print(require "telescope.utils".str_byteindex)

prints nil

I asked chaty (yeah, chatgpt) and got the following experiment:

:lua package.loaded["telescope.utils"] = nil
:lua print(require("telescope.utils").str_byteindex)

now it prints function: 0x7f...
But still, my mapping (gd -> Telescope lsp_definitions) don't work.

Btw. :lua vim.lsp.buf.definition() works

Neovim version

NVIM v0.10.3
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info

Operating system and version

debian

Telescope version / branch / rev

master (2eca9ba)

checkhealth telescope

==============================================================================
telescope: health#telescope#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 fdfind 8.6.0

===== Installed extensions ===== ~

Telescope Extension: `find_template` ~
- No healthcheck provided

Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured

Telescope Extension: `session-lens` ~
- No healthcheck provided

Telescope Extension: `ui-select` ~
- No healthcheck provided

Steps to reproduce

described above

Expected behavior

No response

Actual behavior

described above

Minimal config

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs { "config", "data", "state", "cache" } do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
  vim.fn.system {
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  }
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  {
    "nvim-telescope/telescope.nvim",
    dependencies = {
      "nvim-lua/plenary.nvim",
    },
    config = function()
      -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
      require("telescope").setup {}
    end,
  },
}

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})
@juanolon juanolon added the bug Something isn't working label Jan 3, 2025
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

1 participant