rust-lang / rust-lang/rust-analyzer

error 'Request textDocument/documentHighlight failed' in vscode

Open
#21,300 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

seeing this error in both vscode and cursor. using latest stable verison of everything.

2025-12-18T08:40:02.932953583Z  WARN notify error: No path was found. about ["/home/pdeva/.config/rust-analyzer/rust-analyzer.toml"]
2025-12-18T08:40:03.298267959Z  WARN notify error: No path was found. about ["/home/pdeva/.config/rust-analyzer/rust-analyzer.toml"]
2025-12-18T08:40:11.208950807Z  WARN overly long loop turn took 287.974029ms (event handling took 287.953856ms): PrimeCaches(Report(ParallelPrimeCachesProgress { crates_currently_indexing: ["bollard_stubs"], crates_total: 572, crates_done: 522, work_type: "Indexing" }))
2025-12-18T08:40:13.513847059Z  WARN overly long loop turn took 216.203789ms (event handling took 216.14092ms): PrimeCaches(End { cancelled: false })
2025-12-18T09:15:07.827697857Z  WARN overly long loop turn took 101.25686ms (event handling took 52.46µs): Notification { method: "textDocument/didChange" }
2025-12-18T09:23:53.121989209Z  WARN overly long loop turn took 347.551911ms (event handling took 63.963µs): Notification { method: "textDocument/didChange" }
[Error - 10:00:09 AM] Request textDocument/documentHighlight failed.
  Message: Invalid offset LineCol { line: 54, col: 8 } (line index length: 1350)
  Code: -32603 
Image

rust-analyzer version: 0.3.2719

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

Start by reproducing the failure in VS Code or Cursor with rust-analyzer 0.3.2719, using the provided documentHighlight error and invalid LineCol details. Trace the source of the invalid offset and verify the issue is fixed with a reproducible case or regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.