Skip to content

Commit

Permalink
fix: Remove symbol_msg substitution (nvim-telescope#1525)
Browse files Browse the repository at this point in the history
Because Elixir source code can contain `|`, the removed substitution
sometimes broke `lsp_document_symbols()`.

Example:

```
E5108: Error executing lua ...packer/start/telescope.nvim/lua/telescope/make_entry.lua:392: attempt to concatenate local 'symbol_name' (a nil value)
stack traceback:
        ...packer/start/telescope.nvim/lua/telescope/make_entry.lua:392: in function 'entry_maker'
        ...scope.nvim/lua/telescope/finders/async_static_finder.lua:17: in function 'new_table'
        ...acker/start/telescope.nvim/lua/telescope/builtin/lsp.lua:137: in function 'v'
        ...acker/start/telescope.nvim/lua/telescope/builtin/lsp.lua:500: in function 'v'
        ...cker/start/telescope.nvim/lua/telescope/builtin/init.lua:496: in function <...cker/start/telescope.nvim/lua/telescope/builtin/init.lua:467>
        ...ck/packer/start/telescope.nvim/lua/telescope/command.lua:179: in function 'run_command'
        ...ck/packer/start/telescope.nvim/lua/telescope/command.lua:241: in function 'load_command'
        [string ":lua"]:1: in main chunk
```

Closes nvim-telescope#874
  • Loading branch information
nifoc authored Dec 1, 2021
1 parent ef24554 commit aa41912
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/telescope/make_entry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ function make_entry.gen_from_lsp_symbols(opts)

return function(entry)
local filename = entry.filename or vim.api.nvim_buf_get_name(entry.bufnr)
local symbol_msg = entry.text:gsub(".* | ", "")
local symbol_msg = entry.text
local symbol_type, symbol_name = symbol_msg:match "%[(.+)%]%s+(.*)"

local ordinal = ""
Expand Down

0 comments on commit aa41912

Please sign in to comment.