mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Fix error loading "text" syntax for hover (#4574)
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.
This commit is contained in:
@@ -168,7 +168,7 @@ Execute(LSP hover response with lists of strings should be handled):
|
||||
|
||||
Execute(LSP hover response with lists of strings and marked strings should be handled):
|
||||
call HandleValidLSPResult({'contents': [
|
||||
\ {'language': 'rust', 'value': 'foo'},
|
||||
\ {'language': 'python', 'value': 'foo'},
|
||||
\ "bar\n",
|
||||
\]})
|
||||
|
||||
@@ -178,8 +178,8 @@ Execute(LSP hover response with lists of strings and marked strings should be ha
|
||||
\ {
|
||||
\ 'commands': [
|
||||
\ 'unlet! b:current_syntax',
|
||||
\ 'syntax include @ALE_hover_rust syntax/rust.vim',
|
||||
\ 'syntax region ALE_hover_1 start=/\%1l/ end=/\%2l/ contains=@ALE_hover_rust',
|
||||
\ 'syntax include @ALE_hover_python syntax/python.vim',
|
||||
\ 'syntax region ALE_hover_1 start=/\%1l/ end=/\%2l/ contains=@ALE_hover_python',
|
||||
\ ],
|
||||
\ },
|
||||
\ ],
|
||||
|
||||
Reference in New Issue
Block a user