rust-lang / rust-lang/rust-analyzer

rust-analyzer not working in non-cargo based projects

Open
#18,636 4 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

rust-analyzer version: 0.3.2204-standalone (b65911d5e 2024-11-30)

rustc version: rustc 1.80.1 (3f5fd8dd4 2024-08-06)

editor or extension: VSCode 1.92.0 (Universal)

relevant settings: nothing

I am currently using the rust-analyzer extension to work on a project that does not utilize Cargo. I have read the user manual and followed the instructions to create a rust-project.json file in my project directory. However, the extension appears to be non-functional, and I am unable to locate any error logs in the Output View or Console within VSCode Developer Tools.

I recall that this functionality was working as of October last year. Additionally, I had developed a VSCode extension to simplify the creation of rust-project.json called rust-project, which also seems to be malfunctioning now.

I am reaching out in the hope that you can assist me in resolving this issue. Your help is greatly appreciated.Thank you for your time and assistance.


A example to test:

files structure:

.
├── a.rs
└── rust-project.json

content in rust-project.json

{
    "sysroot": "/your_path_to_sysroot",
    "crates": [
        {
            "root_module": "a.rs",
            "edition": "2021",
            "deps": [],
        }
    ]
}

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 non-Cargo example with the supplied rust-project.json and inspect the VSCode Output View and Developer Tools Console for diagnostics. Compare the current non-Cargo project behavior with the user manual instructions and determine why the extension does not initialize; done means the example project works and failures produce actionable diagnostics.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.