mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 23:44:55 +01:00
chore: return nil
This commit is contained in:
parent
55c4ddb93a
commit
e471a6dbc9
1 changed files with 4 additions and 6 deletions
|
@ -47,8 +47,6 @@ impl Handler for NeovimHandler {
|
||||||
match name.as_ref() {
|
match name.as_ref() {
|
||||||
"ping" => Ok(Value::from("pong")),
|
"ping" => Ok(Value::from("pong")),
|
||||||
|
|
||||||
"error" => Err(Value::from("user-requested error")),
|
|
||||||
|
|
||||||
"create" => {
|
"create" => {
|
||||||
if args.len() < 1 {
|
if args.len() < 1 {
|
||||||
return Err(Value::from("no path given"));
|
return Err(Value::from("no path given"));
|
||||||
|
@ -58,7 +56,7 @@ impl Handler for NeovimHandler {
|
||||||
let mut c = self.client.clone();
|
let mut c = self.client.clone();
|
||||||
match c.create(path, content).await {
|
match c.create(path, content).await {
|
||||||
Ok(r) => match r {
|
Ok(r) => match r {
|
||||||
true => Ok(Value::from("accepted")),
|
true => Ok(Value::Nil),
|
||||||
false => Err(Value::from("rejected")),
|
false => Err(Value::from("rejected")),
|
||||||
},
|
},
|
||||||
Err(e) => Err(Value::from(format!("could not create buffer: {}", e))),
|
Err(e) => Err(Value::from(format!("could not create buffer: {}", e))),
|
||||||
|
@ -78,7 +76,7 @@ impl Handler for NeovimHandler {
|
||||||
Ok(res) => {
|
Ok(res) => {
|
||||||
info!("RPC 'insert' completed");
|
info!("RPC 'insert' completed");
|
||||||
match res {
|
match res {
|
||||||
true => Ok(Value::from("accepted")),
|
true => Ok(Value::Nil),
|
||||||
false => Err(Value::from("rejected")),
|
false => Err(Value::from("rejected")),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -97,7 +95,7 @@ impl Handler for NeovimHandler {
|
||||||
let mut c = self.client.clone();
|
let mut c = self.client.clone();
|
||||||
match c.delete(path, pos, count).await {
|
match c.delete(path, pos, count).await {
|
||||||
Ok(res) => match res {
|
Ok(res) => match res {
|
||||||
true => Ok(Value::from("accepted")),
|
true => Ok(Value::Nil),
|
||||||
false => Err(Value::from("rejected")),
|
false => Err(Value::from("rejected")),
|
||||||
},
|
},
|
||||||
Err(e) => Err(Value::from(format!("could not send insert: {}", e))),
|
Err(e) => Err(Value::from(format!("could not send insert: {}", e))),
|
||||||
|
@ -132,7 +130,7 @@ impl Handler for NeovimHandler {
|
||||||
if let Err(e) = buffer.set_lines(0, -1, false, lines).await {
|
if let Err(e) = buffer.set_lines(0, -1, false, lines).await {
|
||||||
error!("could not update buffer: {}", e);
|
error!("could not update buffer: {}", e);
|
||||||
}
|
}
|
||||||
Ok(Value::from("spawned worker"))
|
Ok(Value::Nil)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue