-
Notifications
You must be signed in to change notification settings - Fork 60
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
tower-lsp in the web #187
Comments
Sounds like an awesome project, @segeljakt! While it is a goal for
The first issue will hopefully be resolved soon, but the second one is a blocker. We can't fully remove the dependency on |
I found this GitHub Gist which which demonstrates a clever but ugly hack to adapt a type implementing |
Thank you for the detailed answer and also for |
Sure, that would be most appreciated! Thanks. 😄 In the meantime, I'll be keeping this issue open and update it as new changes come in. |
Ok, cool 🤩 |
Combined with the recent release of v0.12.0 and efforts on #180 (comment), all calls to |
I wonder if it would be possible to add an opt-in feature flag which replaces |
Actually, after a bit of investigation, I'm not so sure that could work. |
A bit more investigation yielded the I'm currently blocked on matthunz/futures-codec#46 for now. If this can be resolved in a timely manner, it could be possible to add a |
WIP code is available in the |
The progress you have made is excellent. Sorry I have not been active. My knowledge in the async Rust ecosystem is very poor. I doubt I can be of too much help besides testing the functionality 😬 |
The option to opt-out of Tokio with a feature flag would be awesome, on my end I might use something like:
|
No problem at all, @segeljakt! Just trying to keep you and everyone else following up to date regarding the current progress. |
Should be supported with |
Hey @segeljakt, I was wondering how you ended up making the language server for your website and if you found success with If you have any insights I'd much appreciate it :) |
Hey, @TimJentzsch. I don't recall getting it working at the time, but probably Rust's async has matured since then. It should probably be possible to use an async executor like https://github.com/wasm-rs/async-executor. |
Thanks for your reply! My main problem has been to get the IO working, i.e. implementing If you're interested in helping out with using |
@TimJentzsch Have you tried using the WebSockets transport with I see that it might be valuable for us to create an example VSCode extension demonstrating WASM support and commit it to the repository, or else point to your external repo once completed, to help future users. |
I have not tried |
Hi, sorry for the late response. I'm not currently using Rust for my compiler but I'm very interested to see it working in action. |
Hi,
I am trying to setup a website which has both an editor (https://github.com/TypeFox/monaco-languageclient) and language server (
tower-lsp
) running concurrently on the client-side in the browser. If possible it would be nice for portability to run everything inside WebAssembly or Javascript.An example of how to implement the language server on the javascript side is: https://github.com/TypeFox/monaco-languageclient/blob/98f15c6499f23c853882c557dc18ccf7406ed1cf/example/src/json-server.ts#L18-L23
This looks very similar to how it's done in
tower-lsp
:tower-lsp/examples/server.rs
Lines 112 to 124 in 0f5b31b
From discussions on the Tokio Discord, Tokio cannot be compiled to WebAssembly since it has dependencies to unix. Do you see any other possibilities down the line to run
tower-lsp
in the browser?The reason behind writing the server in Rust and compiling it to WASM, instead of writing a server in Javascript that makes calls to handlers in Rust, is that I it should be easier to keep state between compilations.
The text was updated successfully, but these errors were encountered: