rust-lang / rust-lang/rust-analyzer

Invalid offset -32603 when editing an empty .rs file

Open
#17,289 68 comments 57 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-third-party-client C-support
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: 2024-05-09

rustc version: (eg. output of rustc -V): 1.78.0

editor or extension: neovim with Mason+Lspconfig+RustAnalyzer

relevant settings: none

repository link (if public, optional): none

code snippet to reproduce:


Rust analyzer is printing this error if I start editing an empty .rs file before it has completed its startup. There are no settings involved, just an empty cargo project with a main.rs. Once that error pops up, it will keep appearing on every keystroke until I close the buffer, reopen it, wait for it to fully initialize and then start writing. This does not happen if the file is not empty.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in an empty Cargo project with an empty main.rs, using Neovim with Mason, Lspconfig, and rust-analyzer, and begin typing before startup completes. Trace the startup and editing path responsible for the repeated -32603 error; done means typing in the empty file no longer produces the error during initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.