Closed yorickpeterse closed 2 years ago
Actually it seems I'm slightly mistaken about the nature of this option. The documentation says the following:
if true, shows the content of the
line the tag is found on (default:
false)
However, based on the code it seems that setting this option to true adds the line and column number, similar to the treesitter
option.
So if the option is supposed to show the line, it's currently not implemented correctly. If the option is supposed to show the column/line number, the documentation is incorrect.
Looking at the other pickers, it seems the treesitter
picker is the only one that inserts the line/column number when show_line
is enabled. Other pickers, such as builtin.tags
show the actual line contents.
I'm guessing either the treesitter
picker or the lsp_document_symbols
picker was copied from the other, but not adjusted properly to meet the other pickers.
More info here #1938
Description
The
show_line
option is used to disable showing the line of an LSP symbol. According to the documentation, this option is disabled by default. However, in reality it seems this option is enabled. For example:One part of the problem seems to be the code found here:
https://github.com/nvim-telescope/telescope.nvim/blob/9cad3a4a5d0e36b07b25c4be1db1c1306fcec945/lua/telescope/make_entry.lua#L356-L367
It seems that when
ignore_filename
is set totrue
(which is the default), theshow_line
option is ignored and the line is always displayed.Another problem appears to this:
https://github.com/nvim-telescope/telescope.nvim/blob/f31ef362931907bbdd3b46cb880b34493c2d1882/lua/telescope/builtin/lsp.lua#L134
If
ignore_filename
is set tofalse
, the expression evaluates toopts.ignore_filename = false or true
, resulting inopts.ignore_filename = true
. Unless I'm mistaken this basically makes the option useless, as it's always set totrue
.Neovim version
NVIM v0.6.0-dev+547-gfa97d3485 Build type: RelWithDebInfo LuaJIT 2.0.5
Operating system and version
Arch Linux, kernel 5.14
checkhealth telescope
Steps to reproduce
Configure Telescope along the lines of the following:
Next, open a document that has a LSP client attached, and run
Telescope lsp_document_symbols
.Expected behavior
The line the symbol is defined on isn't displayed.
Actual behavior
The line is always displayed
Minimal config