Skip to content
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

fix: clarify errors by handling more clauses #45

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/gen_lsp/communication/stdio.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ defmodule GenLSP.Communication.Stdio do
This is the default adapter, and is the communication channel that most LSP clients expect to be able to use.
"""

require Logger

@behaviour GenLSP.Communication.Adapter
@separator "\r\n\r\n"

Expand Down Expand Up @@ -43,6 +41,9 @@ defmodule GenLSP.Communication.Stdio do
:eof ->
:eof

{:error, error} ->
{:error, error}

headers ->
body =
headers
Expand All @@ -59,6 +60,9 @@ defmodule GenLSP.Communication.Stdio do
:eof ->
:eof

{:error, error} ->
{:error, error}

line ->
line = String.trim(line)

Expand All @@ -81,6 +85,9 @@ defmodule GenLSP.Communication.Stdio do
:eof ->
:eof

{:error, error} ->
{:error, error}

payload ->
payload
end
Expand Down