iamcco/vim-language-server

autoload functions end with `#` can not find definition/reference

JS-Zheng opened this issue · 6 comments

As mentioned in the title, vim-language-server cannot work on autoload function with empty name.

For example, this can work:

func! path#create()
...
endfunc

but this one cannot:

func! path#()
...
endfunc

fix, please update to latest version.

Hi @iamcco, It still not works 🙁

My env:
vim version: VIM - Vi IMproved 8.2 8024700
node version: v17.8.0
coc.nvim version: 0.0.80-1c4c2ab0 2022-04-11 01:28:56 +0800
vim-language-server version: v2.2.8
coc-vimlsp version: v0.12.6

When I go to definition, go to references, ..., (on any coc-operations) on a empty-name autoload function (e.g., utils#dir_stack#( )), it gets:

[coc.nvim] definition not found
[coc.nvim] reference not found
...

But it can works on functions such like utils#dir_stack#push() or utils#dir_stack#pop().

It works, thanks @iamcco !

Forgive me, but should it also update getLocationsByUri()'s regexp in workspaces.ts to enable document highlight? Sorry, it just a speculation, I am not familiar with this project yet. 😅

I don't know what you mean

Go to definition/references works well now !
but Document highlight cannot work on autoload functions end with #.

fix with latest version