-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 <[email protected]> Co-authored-by: HKalbasi <[email protected]>
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 <[email protected]>
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: