mrcjkb / rustaceanvim

🦀 Supercharge your Rust experience in Neovim! A heavily modified fork of rust-tools.nvim
GNU General Public License v2.0
1.81k stars 69 forks source link

Crash in project that uses stable Rust #248

Closed westernwontons closed 9 months ago

westernwontons commented 9 months ago

Neovim version (nvim -v)

NVIM v0.10.0-dev-2404+geb1e8c12e

Operating system/version

MacOS Sonoma 14.2.1

Output of :checkhealth rustaceanvim

rustaceanvim: require("rustaceanvim.health").check()

Checking for Lua dependencies ~
- OK [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap) installed.

Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 1.78.0-nightly (3246e795 2024-02-19)
- OK Cargo: found cargo 1.78.0-nightly (7b7af3077 2024-02-17)
- OK rustc: found rustc 1.78.0-nightly (3246e7951 2024-02-19)
- OK debug adapter: found codelldb 

Checking config ~
- OK No errors found in config.

Checking for conflicting plugins ~
- OK No conflicting plugins detected.

Checking for tree-sitter parser ~
- OK tree-sitter parser for Rust detected.

How to reproduce the issue

cd /tmp
cargo new helo
cd helo
rustup override set stable
nvim .

// open any Rust file to trigger RA

Expected behaviour

rust-analyzer starts successfully

Actual behaviour

Following error happens:

// notice error:

    Error  17:33:46 msg_show.lua_error Error executing luv callback:
 .../.local/neovim/share/nvim/runtime/lua/vim/lsp/client.lua:606: E5560: nvim_err_writeln must not be called in a lua loop callback
 stack traceback:
    [C]: in function 'nvim_err_writeln'
    .../.local/neovim/share/nvim/runtime/lua/vim/lsp/client.lua:606: in function 'err_message'
    .../.local/neovim/share/nvim/runtime/lua/vim/lsp/client.lua:853: in function 'write_error'
    .../.local/neovim/share/nvim/runtime/lua/vim/lsp/client.lua:432: in function '_run_callbacks'
    .../.local/neovim/share/nvim/runtime/lua/vim/lsp/client.lua:931: in function 'on_exit'
    ...ond/.local/neovim/share/nvim/runtime/lua/vim/lsp/rpc.lua:813: in function 'on_exit'
    ...ond/.local/neovim/share/nvim/runtime/lua/vim/_system.lua:297: in function <...ond/.local/neovim/share/nvim/runtime/lua/vim/_system.lua:267>

The minimal config used to reproduce this issue.

-- The issue can be fully reproduced with your minimal.lua config
mrcjkb commented 9 months ago

Hey :wave:

Are you able to reproduce this with neovim 0,9? I haven't been able to reproduce it (using a nightly build from Feb. 19), and the stack trace doesn't contain any rustaceanvim files, which tells me this is probably a bug in the nightly build you're using.

westernwontons commented 9 months ago

Apparently, I had an old rust-analyzer version installed and the error from neovim was masking the real error

mrcjkb commented 9 months ago

Apparently, I had an old rust-analyzer version installed and the error from neovim was masking the real error

Glad you could solve it :smile:

tomtomjhj commented 9 months ago

neovim was masking the real error

https://github.com/neovim/neovim/pull/27688 should fix this