Skip to content

Commit 68ca86c

Browse files
nepetShahanaFarooqui
authored andcommitted
lsps: Add JSON-RPC V2 server
1 parent 203621a commit 68ca86c

File tree

3 files changed

+331
-42
lines changed

3 files changed

+331
-42
lines changed

Cargo.lock

Lines changed: 26 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/lsps-plugin/src/jsonrpc/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pub mod client;
22
use log::debug;
33
use serde::{de::DeserializeOwned, Deserialize, Serialize};
44
use serde_json::{self, Value};
5+
pub mod server;
56
use std::fmt;
67
use thiserror::Error;
78

@@ -171,7 +172,8 @@ where
171172
/// **REQUIRED**. The identifier of the original request this is a response.
172173
id: String,
173174
/// **REQUIRED on success**. The data if there is a request and non-errored.
174-
/// MUST be `null` if there was an error.
175+
/// MUST NOT exist if there was an error triggered during invocation.
176+
#[serde(skip_serializing_if = "Option::is_none")]
175177
result: Option<T>,
176178
/// **REQUIRED on error** An error type if there was a failure.
177179
error: Option<RpcError>,

0 commit comments

Comments
 (0)