dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.57k stars 1.44k forks source link

Fix error loading "text" syntax for hover #4574

Closed liskin closed 1 year ago

liskin commented 1 year ago

rust-analyzer sometimes returns a hover result with language being "text", but there's no syntax/text.vim, so this would fail with:

Error detected while processing function <SNR>150_VimOutputCallback[6]..<lambda>8[1]..ale#lsp#HandleMessage[30]..ale#hover#HandleLSPResponse[42]..ale#floating_preview#Show[13]..<SNR>161_VimShow:
line   13:
E484: Cannot open file syntax/text.vim

Only including the file when it actually exists fixes this.

(Note that I had to substitute javascript for typescript in test/test_hover_parsing.vader because there's no syntax/typescript.vim in vim 8.0 and neovim 0.2.)

Where are the tests? Have you added tests? Have you updated the tests? Read the comment above and the documentation referenced in it first. Write tests!

Seriously, read :help ale-dev and write tests.

There are some, yeah.

w0rp commented 1 year ago

Cheers! :beers: