Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.
This repository was archived by the owner on May 29, 2025. It is now read-only.

Std and prelude support #7

Closed
Closed
@HKalbasi

Description

@HKalbasi

I'm trying to add rust-analyzer-wasm to playground. Main problem here is that it doesn't support std. I ( code / demo ) currently added a fake std with subset of code as a simple dependency, but it has some problems:

  • It doesn't detect prelude. I added use std::prelude::v1::* and some more thing in first line invisibly. It works but it is hacky and there may be a better way.
  • It doesn't detect language features. For example std::ops::Range { } works but (1..num) type is detected as {unknown}

What I'm missing? Should I declare std crate special in rust-analyzer? Or some flags (I'm adding #[lang="Range"] but it doesn't work) in std source code? And in general what is the best way to add std to rust-analyzer-wasm?

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