fix(lsp): handle server requests#101
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes LSP interoperability with servers (e.g., tsgo) that send server-to-client JSON-RPC requests by correctly classifying inbound messages and sending appropriate client-side responses.
Changes:
- Extend inbound message classification to include server-to-client requests (
id+method). - Add handling/auto-responses for common server requests (e.g.,
client/registerCapability,workspace/configuration). - Add focused unit tests and document the fix in the changelog.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/mcpls-core/src/lsp/types.rs | Adds InboundMessage::Request variant and minor doc/test annotation update. |
| crates/mcpls-core/src/lsp/transport.rs | Introduces parse_inbound_message to classify inbound JSON-RPC messages (request/response/notification) and adds a unit test. |
| crates/mcpls-core/src/lsp/client.rs | Handles InboundMessage::Request by generating and sending JSON-RPC responses; adds unit tests for server-request responses. |
| CHANGELOG.md | Notes the tsgo timeout fix under “Fixed”. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1f17020 to
be6f7e7
Compare
Contributor
Author
|
I pushed
All checks are green now, including both CodeQL jobs. Local validation also passed with fmt, |
Owner
|
Nice fix. Good call on |
bug-ops
added a commit
that referenced
this pull request
Apr 29, 2026
Repository-wide instructions (.github/copilot-instructions.md) cover architecture overview, lock scope rules, glob anchoring, channel semantics, and deny.toml license gaps. Path-specific instruction files cover: - bridge/lsp: TOCTOU, version overflow, notification_pump deadlock, file watcher - config/deps: license allow list, serde round-trip tests, TOML defaults - mcp: 1-based positions, JsonSchema derive, tool dispatch completeness - tests: #[ignore] hygiene, resync coverage, glob pattern correctness - ci: feature flag parity, RUSTDOCFLAGS, MSRV guards - CHANGELOG: breaking change format, PR references Instructions are derived from findings in PR #101 and #103 reviews.
bug-ops
added a commit
that referenced
this pull request
Apr 29, 2026
Repository-wide instructions (.github/copilot-instructions.md) cover architecture overview, lock scope rules, glob anchoring, channel semantics, and deny.toml license gaps. Path-specific instruction files cover: - bridge/lsp: TOCTOU, version overflow, notification_pump deadlock, file watcher - config/deps: license allow list, serde round-trip tests, TOML defaults - mcp: 1-based positions, JsonSchema derive, tool dispatch completeness - tests: #[ignore] hygiene, resync coverage, glob pattern correctness - ci: feature flag parity, RUSTDOCFLAGS, MSRV guards - CHANGELOG: breaking change format, PR references Instructions are derived from findings in PR #101 and #103 reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Classifies inbound LSP JSON-RPC messages with both
idandmethodas server-to-client requests, then replies to common client requests such asclient/registerCapabilityandworkspace/configuration.Also tightens response classification so
id-only JSON-RPC messages are treated as protocol errors instead of successfulnullresponses.Type of Change
Breaking Change Note
InboundMessagenow includes aRequest(JsonRpcRequest)variant and is marked#[non_exhaustive]. Downstream crates that matchInboundMessageexhaustively need to add a wildcard arm.Related Issues
Fixes #100
Checklist
Additional Notes
Verification:
RUSTUP_TOOLCHAIN=nightly-aarch64-apple-darwin cargo fmt --checkRUSTUP_TOOLCHAIN=1.95-aarch64-apple-darwin cargo nextest runRUSTUP_TOOLCHAIN=1.95-aarch64-apple-darwin cargo test -p mcpls-coreRUSTUP_TOOLCHAIN=1.95-aarch64-apple-darwin cargo clippy --all-targets --all-features -- -D warnings