Skip to content

Commit

Permalink
Improve logging of LSP decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
efoerster committed May 6, 2019
1 parent 25e7173 commit c677d86
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/lsp/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ impl Decoder for LspCodec {
type Error = Error;

fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
trace!(
"Received message:\n{}",
str::from_utf8(&src.to_vec()).unwrap()
);

match parse_message(&src) {
match parse_message(src) {
Ok((remaining, content)) => {
src.split_to(src.len() - remaining.len());
trace!("Received message:\n{}", content);

let offset = src.len() - remaining.len();
src.split_to(offset);
Ok(Some(content))
}
Err(error) => {
Expand Down

0 comments on commit c677d86

Please sign in to comment.