Skip to content

Feature Req: Add support for Rust files without Cargo.toml or valid cargo workspaces #4477

Closed
@deavid

Description

@deavid

Some people are trying the rustlings repo and the exercises are outside the src/ folder, but in a exercises/ folder. I have been using VSCode and rust-analyzer extension, and it does work under the src/ folder, but it does not on exercises/. There's another issue in github with users having this problem: lsp-mope issue

I understand that this is not straightforward because rust-analyzer cannot know which dependencies you may have for your code. But at least, a minimal amount of support would be nice.

Would it be possible to add an option (maybe disabled by default) that makes those work by assuming no dependencies? (i.e. a new blank, standard Cargo.toml and using the latest stable rust)

On the other hand, in some corporate environments, cargo is not desirable because the build systems are tightly integrated, so we could expect that some people have their own way of compiling Rust and their programs would not have a regular structure. It would be really interesting to have a way of allowing these companies to extend rust-analyzer to support their build environments.

As for myself, I had to switch back to RLS to do the rustlings exercises.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions