Skip to content

Frequent "version is out of date" error with Helix #134

Description

@hanyuone

Describe the bug
The versions emitted by bacon-ls do not match up with Helix's LSP when a file is written (:w), resulting in the following error found in ~/.cache/helix/helix.log:

2026-08-15T23:28:00.851 helix_view::handlers::lsp [INFO] Version (3) is out of date for File("/home/hanyuan/personal/rust/sandbox/src/main.rs") (expected (4)), dropping PublishDiagnostic notification

Because of this, Rust errors logged by bacon-ls, which do appear in logs:

2026-08-15T23:28:43.298 helix_lsp::transport [INFO] bacon-ls <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"message":"error[E0369]: cannot add `{integer}` to `&str`\n --> src/main.rs:3:30\n  |\n3 |     println!(\"{}\", hello_str + 12);\n  |                    --------- ^ -- {integer}\n  |                    |\n  |                    &str","range":{"end":{"character":28,"line":2},"start":{"character":19,"line":2}},"severity":1,"source":"bacon-ls"},{"message":"error[E0369]: cannot add `{integer}` to `&str`\n --> src/main.rs:3:30\n  |\n3 |     println!(\"{}\", hello_str + 12);\n  |                    --------- ^ -- {integer}\n  |                    |\n  |                    &str","range":{"end":{"character":33,"line":2},"start":{"character":31,"line":2}},"severity":1,"source":"bacon-ls"},{"message":"error[E0369]: cannot add `{integer}` to `&str`\n --> src/main.rs:3:30\n  |\n3 |     println!(\"{}\", hello_str + 12);\n  |                    --------- ^ -- {integer}\n  |                    |\n  |                    &str","range":{"end":{"character":30,"line":2},"start":{"character":29,"line":2}},"severity":1,"source":"bacon-ls"}],"uri":"file:///home/hanyuan/personal/rust/sandbox/src/main.rs","version":3}}

are not displayed.

My ~/.config/helix/languages.toml:

[[language]]
name = "rust"
file-types = ["rs"]
roots = ["Cargo.toml"]
language-servers = ["scls", "rust-analyzer", "bacon-ls"]
auto-format = true

[language.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
'"' = '"'
'`' = '`'

[language-server.rust-analyzer.config]
checkOnSave = false
diagnostics = { enable = false }

[language-server.rust-analyzer.config.inlayHints]
closureCaptureHints.enable = true

[language-server.bacon-ls]
command = "bacon-ls"

[language-server.bacon-ls.config.bacon_ls]
backend = "bacon"

To reproduce, start a fresh Rust project open src/main.rs, and change it to the following:

fn main() {
    let hello_str = "Hello, World!";
    println!("{}", hello_str + 12);
}

Save the file, and then the error doesn't display.

Expected behavior
bacon-ls diagnostics should be displayed on write, the versions as above should line up, resulting in PublishDiagnostic being triggered (which I assume is what gets Helix to display errors).

Attach bacon-ls.log
bacon-ls.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions