Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error loading "text" syntax for hover #4574

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

liskin
Copy link
Contributor

@liskin liskin commented Aug 2, 2023

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.

autoload/ale/hover.vim Outdated Show resolved Hide resolved
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. Likewise for python/rust in
test/test_hover.vim.)
@w0rp w0rp merged commit fe38101 into dense-analysis:master Aug 15, 2023
6 checks passed
@w0rp
Copy link
Member

w0rp commented Aug 15, 2023

Cheers! 🍻

@liskin liskin deleted the fix-hover-syntax-text branch August 15, 2023 12:10
mnikulin pushed a commit to mnikulin/ale that referenced this pull request Nov 12, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants