rust-lang / rust-lang/rust-analyzer

Question about `failed to find any projects in [AbsPathBuf("/projects/snippets")]`

Open
#11,666 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hello all,

using emacs 27.2 and lsp-mode

rust-analyzer --version 
rust-analyzer 4e72700e3 2022-02-28 dev

the lsp-server doesn't start with error
[ERROR rust_analyzer] failed to find any projects in [AbsPathBuf("/projects/snippets")]

It used to work in older versions(I can't recall the exact version).
and my project directory tree is like:

/projects/snippets  <-- git root 
/projects/snippets/projectA  //contains Cargo.toml, src/main.rs
/projects/snippets/projectB  //contains Cargo.toml, src/main.rs 
/projects/snippets/projectC  //contains Cargo.toml, src/main.rs

And in projectX the lsp doesn't start.

The rust_analyzer with debug is shown here.
https://pastebin.com/tjrdUtbP

thanks for any tips or ideas.

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 report with rust-analyzer 4e72700e3, Emacs 27.2, and lsp-mode against the shown /projects/snippets tree. Read the reported error and the linked debug output, then compare behavior for the repository root and its projectA/projectB/projectC subdirectories. Done means the cause of the project-discovery failure is identified and a concrete fix or clarified expected behavior is documented.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.