fix: Remove symbol_msg substitution (#1525)
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 #874
This commit is contained in:
@@ -382,7 +382,7 @@ function make_entry.gen_from_lsp_symbols(opts)
|
|||||||
|
|
||||||
return function(entry)
|
return function(entry)
|
||||||
local filename = entry.filename or vim.api.nvim_buf_get_name(entry.bufnr)
|
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 symbol_type, symbol_name = symbol_msg:match "%[(.+)%]%s+(.*)"
|
||||||
|
|
||||||
local ordinal = ""
|
local ordinal = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user