Skip to content
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

Integration with github1s #6

Open
RReverser opened this issue Apr 1, 2021 · 9 comments
Open

Integration with github1s #6

RReverser opened this issue Apr 1, 2021 · 9 comments

Comments

@RReverser
Copy link
Contributor

RReverser commented Apr 1, 2021

This is a very long shot, but thought I'd raise it anyway: do you think it would be possible to reuse github1s (https://github.com/conwnet/github1s / https://github1s.com/) as a base for this demo?

Then anyone could run Rust Analyzer on top of real files in real repos. Even if it could see only one file at a time, that would be a great start.

@matklad
Copy link
Member

matklad commented Apr 1, 2021

Hm, that's interesting.... I fear that, for this to be significantly more useful than plain github1s, we need to at least be able to get cargo metadata info for the project somehow...

@RReverser
Copy link
Contributor Author

RReverser commented Apr 1, 2021

Yeah, I get that it's not going to be much more useful, but at least same definition jumping within a file that already works, would now work on real files and not only on predefined textarea.

Seems like a start, and it would be at least the same extent to which JavaScript / TypeScript is supported on Github1s.

@flodiebold
Copy link
Member

It might be possible to hack something together to create a project model from a Cargo.toml without resolving dependencies etc...

@matklad
Copy link
Member

matklad commented Apr 1, 2021

I guess, taking a step back, running rust-analyzer in the browser can have some non-toy use-cases. There are no fundamental limetations to the kinds of analysis we can do. There are some annoyances around talking to the outside world, but even thouse can be at least in theory surmountable.

The bigger issue is putting resources into the work -- this needs a fair amount of fiddly code, and an ongoing maintainance. And most people who can do that can probably hack on rust-analyzer itself, and the latter is somewhat more valuable.

I wonder if I should lure some unsuspecting student here....

@RReverser
Copy link
Contributor Author

It might be possible to hack something together to create a project model from a Cargo.toml without resolving dependencies etc...

Assuming only 2018 edition resolution, you might not even need Cargo.toml - at least usages like use crate::some_mod map fairly cleanly to a few path variants which can be checked "manually" one by one.

@flodiebold
Copy link
Member

That might also go into the direction of rust-lang/rust-analyzer#6388 (if we make that even smarter and detect module trees)...

@edwin0cheng
Copy link
Member

Another solution:

Maybe we could support export project.json from Cargo.toml and make a tool to bundle all related rust files with rust-analzyer-wasm.

@jonas-schievink
Copy link
Contributor

I briefly played around with this idea a few days ago, but concluded that it wasn't really worth fighting frontend tooling for https://github.com/jonas-schievink/github1s/tree/rust-analyzer

@HKalbasi
Copy link
Member

Isn't it possible to make rust-analyzer extension to work with github1s itself? github1s accept a "browser" field. Is it possible to make it download this wasm binary instead of native binary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants