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

Code actions broken on newest rust-analyzer #1037

Closed
YaLTeR opened this issue May 27, 2020 · 6 comments · Fixed by #1038
Closed

Code actions broken on newest rust-analyzer #1037

YaLTeR opened this issue May 27, 2020 · 6 comments · Fixed by #1038

Comments

@YaLTeR
Copy link
Contributor

YaLTeR commented May 27, 2020

  • Did you upgrade to latest plugin version? Yes
  • Did you upgrade to/compile latest binary? Run shell command
    bin/languageclient --version to get its version number. Yes
  • (Neovim users only) Did you check output of :checkhealth LanguageClient? Yes
  • Did you check troubleshooting? Yes

Describe the bug

Starting from 2020-05-25, rust-analyzer returns no code actions to LanguageClient-neovim.

Environment

  • neovim/vim version (nvim --version or vim --version): v0.4.3
  • This plugin version (git rev-parse --short HEAD): 7c741d0
  • This plugin's binary version (bin/languageclient --version): 0.1.156
  • Minimal vimrc content (A minimal vimrc is the smallest vimrc that could
    reproduce the issue. Refer to an example here):
call plug#begin('~/.config/nvim/plugged')

Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }

call plug#end()

augroup filetype_rust
    autocmd!
    autocmd BufReadPost *.rs setlocal filetype=rust
augroup END

" Always draw sign column. Prevent buffer moving when adding/deleting sign.
set signcolumn=yes

let g:LanguageClient_serverCommands = {
    \ 'rust': ['rust-analyzer'],
    \ }
let $RUST_BACKTRACE = 1
let g:LanguageClient_loggingLevel = 'INFO'
let g:LanguageClient_virtualTextPrefix = ''
let g:LanguageClient_loggingFile =  expand('~/.local/share/nvim/LanguageClient.log')
let g:LanguageClient_serverStderr = expand('~/.local/share/nvim/LanguageServer.log')

To Reproduce

Steps to reproduce the behavior:

  • cargo new temp
  • nvim -u min-vimrc.vim temp/src/main.rs
  • :call LanguageClient_textDocument_codeAction()

Current behavior

Code actions shown on 2020-05-18 but not on 2020-05-25 or nightly.

Expected behavior

Code actions shown.

Screenshots

image

Additional context

Log files for calling code action on 2020-05-18 and 2020-05-25:
LanguageClient-old.log
LanguageClient-new.log

@martskins
Copy link
Collaborator

Possibly related to the changes introduced here: rust-lang/rust-analyzer#4494

@YaLTeR
Copy link
Contributor Author

YaLTeR commented May 27, 2020

I'm looking into this, I think it's just that LanguageClient-neovim doesn't advertise code action support.

@TheZoq2
Copy link

TheZoq2 commented Jun 22, 2020

I think I tested this fix by switching my branch in vim-plug to dev and rerunning plugin update. I sitll experience the same issue (0/0) actions supported. Checking out R-A 2020-05-18 works fine

@martskins
Copy link
Collaborator

@TheZoq2 I assume you have "bash ./install.sh" as a post install step there? Try changing "bash ./install.sh" to "make release", so it rebuilds from source instead of downloading the latest released binary (which is behind dev).

@TheZoq2
Copy link

TheZoq2 commented Jun 22, 2020

Thanks. Adding make release to the vimrc didn't work, but going into the plugin folder and manually running it seems to have done the trick :)

@martskins
Copy link
Collaborator

@YaLTeR I think your fix for this is already in next, so I'll close this one, but feel free to re-open if this is still an issue.

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 a pull request may close this issue.

3 participants