-
Notifications
You must be signed in to change notification settings - Fork 1.8k
examples: add minimal_lsp.rs
and FIFO test script
#20233
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
examples: add minimal_lsp.rs
and FIFO test script
#20233
Conversation
This comment has been minimized.
This comment has been minimized.
4cec573
to
7f7f6a2
Compare
This comment has been minimized.
This comment has been minimized.
7f7f6a2
to
2e5a50b
Compare
This comment has been minimized.
This comment has been minimized.
minimal_lsp.rs
and FIFO test script (#20017)minimal_lsp.rs
and FIFO test script
2e5a50b
to
31e2f81
Compare
This comment has been minimized.
This comment has been minimized.
b1d8293
to
f11d8da
Compare
Hi @ShoyuVanilla @lnicola , Thank you for the helpful guidance on my last attempt on #20187
I’ve also added a tiny FIFO helper (examples/manual_test.sh) to replay the nine canonical packets, so the whole round-trip can be tested in two terminals. — Shashi |
Thanks! I'll take a look before not too late 😅 |
Overally looks good but some nits and a question: |
f11d8da
to
d60ca00
Compare
Thanks so much for the careful review!
Ran cargo fmt; the example builds and clippy is clean. If the extra script still feels like overkill, I’m happy to delete it and rely on the one-liner here-doc instead—just say the word. Really appreciate your time and feedback. Let me know if there’s anything else you’d like tweaked! |
ed08b10
to
7e224c2
Compare
* `examples/minimal_lsp.rs` – compact LSP server showing definition, completion, hover, rustfmt-based formatting, and dummy diagnostics. Advertises UTF-8 offset encoding. * `examples/manual_test.sh` – FIFO script that streams the canonical nine LSP packets so anyone can validate the server from two terminals. No new runtime deps; `anyhow` stays under [dev-dependencies].
7e224c2
to
4541495
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Sorry for being too picky on this PR. As this is adding an example that serves as a documentation for newcomers, I had to be sensitive on accuracy 😅
Absolutely, and thanks again for the careful review — it only makes the example stronger. If there are other bite-sized issues or examples that could use a fresh set of eyes, I’d be happy to tackle them next. I’m already browsing the issue tracker, but please feel free to point me toward anything you think would be especially helpful for the project. I’m keen to contribute wherever it adds the most value. |
Adds a single example, examples/minimal_lsp.rs, plus a tiny FIFO test script.
The sample now shows:
Quick test
one-shot, all nine packets
Also includes
examples/manual_test.sh
, a tiny FIFO script that sends the canonical 9 LSP packets so the server can be verified from two terminals.Two-terminal test
mkfifo /tmp/lsp_pipe
terminal A
cat /tmp/lsp_pipe | cargo run --example minimal_lsp
terminal B
bash examples/manual_test.sh # pumps the same nine packets
We should see, in order: capabilities → diagnostics → completion → hover → definition → formatting → shutdown.
(anyhow stays under [dev-dependencies]).
Fixes #20017