vim-lsp icon indicating copy to clipboard operation
vim-lsp copied to clipboard

Cannot jump to definition when using clangd with windows network drive

Open yamam opened this issue 2 years ago • 1 comments

I have a wsl2 file system mounted on a network drive with smb and using clangd in Windows 10. (Z: is mounted to \ubuntu2204\username)

When I use LspDefinition with a C file on drive Z using vim-lsp, vim specifies a path like z:/ to clangd, but clangd returns results in the format file://ubuntu2204/username/.

There are two problems here. One is that the result from clangd is file:// and not file:///, so The result from is_file_uri (utils.vim) is not true in the following decision.

function! lsp#utils#is_file_uri(uri) abort
    return stridx(a:uri, 'file:///') == 0
endfunction

(In clangd 10.0, it starts with file:/// like file:///ubuntu2204/username, but in clangd 14.0, it starts with file://)

The other thing is that the result from clangd is ubuntu2204/username instead of z:, so vim has no idea where that file is.

yamam avatar May 05 '22 00:05 yamam

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 10 '22 05:07 stale[bot]