nvim-telescope / telescope.nvim

Find, Filter, Preview, Pick. All lua, all the time.
MIT License
15.99k stars 836 forks source link

Telescope not showing relative paths on workspace symbols #2906

Open eyalk11 opened 9 months ago

eyalk11 commented 9 months ago

Description

I am on windows.

I see this when looking for symbols:

image

It happens in lua ls and pylsp.

Neovim version

NVIM v0.9.1
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe /MD /Zi /O2 /Ob1  -W3 -wd4311 -wd4146 -DUNIT_TESTING -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0602 -DMSWIN -DINCLUDE_GENERATED_DECLARATIONS -ID:/a/neovim/neovim/.deps/usr/include/luajit-2.1 -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/build/src/nvim/auto -ID:/a/neovim/neovim/build/include -ID:/a/neovim/neovim/build/cmake.config -ID:/a/neovim/neovim/src -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include

   system vimrc file: "$VIM\sysinit.vim"
  fall-back for $VIM: "C:/Program Files (x86)/nvim/share/nvim"

Run :checkhealth for more info

Operating system and version

windows 10

Telescope version / branch / rev

commit dce1156ca103b8222e4abbfc63f9c6887abf5ec6 (HEAD -> master)

checkhealth telescope

==============================================================================
telescope: require("telescope.health").check()

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 13.0.0 (rev 9ef241166f)
- WARNING fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities

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

Telescope Extension: `git_grep` ~
- No healthcheck provided

Telescope Extension: `live_grep_args` ~
- No healthcheck provided

Steps to reproduce

  1. use lua-language-server
  2. cd telescope.nvim
  3. edit telescope.nvim\lua\telescope\builtin\init.lua
  4. call require'telescope.builtin'.lsp_workspace_symbols()

Expected behavior

Show files relative to cwd. Use .. if needed.

Actual behavior

Showing absolute paths, taking entire width of screen. None of the path_display options allow it.

Minimal config

Might add if really needed. But just install `lua-langague-server `with manson (3.7.4) and use

require'lspconfig'.lua_ls.setup {
}
eyalk11 commented 9 months ago

Using path_display={'shorten'} mitigate it. Not ideal. Using truncate or smart had no effect. Ah, tail actually does work, but it doesn't use .. appropriately, namely it reverts to full path if two dirs difference. It seems that the smart/truncate option should have done it ,but it doesn't work.