Skip to content

[Bug]: Diagnostics are not displayed with rust-analyzer #798

@cskr

Description

@cskr

Description

50d4b60 breaks diagnostics when used with rust-analyzer. When I open a .rs file with known errors, the errors are not highlighted in the buffer. The following error appears in the status line.

Error: request textDocument/diagnostic failed (server cancelled the request, error = ServerCancelled, data = {'retriggerRequest': true}) 

Vim Version

Vim 9.1.1230

Operating System

Debian 13

Plugin Commit Hash

159de71

Language Server

rust-analyzer

Language Server Version

1.95.0

Minimal Vim Configuration

var lspServers = [
    {
        name: 'rust-analyzer',
        filetype: 'rust',
        path: 'rust-analyzer',
    },
]
g:LspAddServer(lspServers)

Steps to Reproduce

1. Open a Rust source file with `use` lines for unknown crates.
2. Observe that no diagnostic/error is shown on the line with the incorrect import.
3. Wait for a few seconds and observe the following error on the status line.


Error: request textDocument/diagnostic failed (server cancelled the request, error = ServerCancelled, data = {'retriggerRequest': true})

Expected Behavior

Diagnostics should be displayed automatically, without any error on the status line.

Actual Behavior

Diagnostics are not shown and an error is displayed on the status line.

Logs

Final Checklist

  • I have verified this issue persists with a minimal configuration.
  • I am using the latest version of the plugin.
  • I am using a supported Vim version (9.0+).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions