-
Notifications
You must be signed in to change notification settings - Fork 16
Std and prelude support #7
Comments
Something like this is indeed probably the simplest way, though ideally we could generate the fake std from the real one (we could replace all the function bodies by |
I added machine generated fakes of Another problem, is that it doesn't detect |
You need to add
Always latest stable. |
Thanks, it works! I would never guess that.
I receive this error from latest stable:
It is maybe due to some I see this as almost done, my goal is adding it to playground but I can file a PR here as well, if it is helpful. But it may be wanted to keep this demo simple. |
We make sure that |
8: Add std and inlay hints r=matklad a=HKalbasi I actually done this as an experiment for adding [RA to playground](rust-lang/rust-playground#357) but I think this demo can also take advantage of this PR and by merging it, future people don't need to repeat my work. Fix #7 This satisfies me, but it is not great. Specially it is slower than RA on vscode, and I don't know why it should be that slow. Suggestions on this (and other problems) are welcome. Co-authored-by: hamidreza kalbasi <hamidrezakalbasi@protonmail.com> Co-authored-by: HKalbasi <45197576+HKalbasi@users.noreply.github.com>
8: Add std and inlay hints r=matklad a=HKalbasi I actually done this as an experiment for adding [RA to playground](rust-lang/rust-playground#357) but I think this demo can also take advantage of this PR and by merging it, future people don't need to repeat my work. Fix #7 This satisfies me, but it is not great. Specially it is slower than RA on vscode, and I don't know why it should be that slow. Suggestions on this (and other problems) are welcome. Co-authored-by: hamidreza kalbasi <hamidrezakalbasi@protonmail.com>
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:
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.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?The text was updated successfully, but these errors were encountered: