Skip to content

":RustLsp flyCheck clear" crahes rust-analyzer #465

@jannes

Description

@jannes

Have you read the docs and searched existing issues?

Neovim version (nvim -v)

v0.10.0

Operating system/version

MacOS 13.6.6

Output of :checkhealth rustaceanvim

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

Checking for Lua dependencies ~
- WARNING dap not installed. Needed for debugging features [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap)

Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 0.3.2053-standalone (fd74511f3 2024-07-28)
- OK Cargo: found cargo 1.80.0 (376290515 2024-07-16)
- OK rustc: found rustc 1.80.0 (051478957 2024-07-21)

Checking config ~
- OK No errors found in config.

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

Checking for tree-sitter parser ~
- WARNING No tree-sitter parser for Rust detected. Required by 'Rustc unpretty' command.

How to reproduce the issue

cargo new --bin repro
cd repro
nvim -u <path_to_minimal_config> src/main.rs
# then in nvim:
:RustLsp flyCheck run
:RustLsp flycheck clear`

Expected behaviour

no failure and clippy diagnostics to be cleared from all buffers

Actual behaviour

Client rust-analyzer quit with exit code 101 and signal 0.

logs:

[START][2024-07-31 15:07:01] LSP logging initiated
[ERROR][2024-07-31 15:07:01] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"thread 'LspServer' panicked at crates/rust-analyzer/src/dispatch.rs:308:17:\nInvalid request\nMethod: rust-analyzer/clearFlycheck\n error: invalid type: sequence, expected unit\n"
[ERROR][2024-07-31 15:07:01] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"stack backtrace:\n   0: _rust_begin_unwind\n   1: core::panicking::panic_fmt\n"
[ERROR][2024-07-31 15:07:01] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"   2: rust_analyzer::dispatch::NotificationDispatcher::on_sync_mut\n"
[ERROR][2024-07-31 15:07:01] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"   3: "
[ERROR][2024-07-31 15:07:01] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event\n   4: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run\n"
[ERROR][2024-07-31 15:07:01] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"   5: rust_analyzer::main_loop::main_loop\n"
[ERROR][2024-07-31 15:07:01] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"   6: rust_analyzer::run_server\nnote: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.\n"
[ERROR][2024-07-31 15:07:02] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jod-thread-0.1.2/src/lib.rs:33:"
[ERROR][2024-07-31 15:07:02] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"22:\ncalled `Result::unwrap()` on an `Err` value: Any { .. }\nstack backtrace:\n   0: _rust_begin_unwind\n   1: core::panicking::panic_fmt\n   2: core::result::unwrap_failed\n   3: stdx::thread::JoinHandle<T>::join\n   4: rust_analyzer::with_extra_thread\n   5: rust_analyzer::main\n"
[ERROR][2024-07-31 15:07:02] .../vim/lsp/rpc.lua:770	"rpc"	"rust-analyzer"	"stderr"	"note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.\n"

The minimal config used to reproduce this issue.

vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()

require('lazy.minit').repro {
  spec = {
    {
      'mrcjkb/rustaceanvim',
      version = '^5',
      init = function()
        -- Configure rustaceanvim here
        vim.g.rustaceanvim = {}
      end,
      lazy = false,
    },
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions