Skip to content

Commit

Permalink
fix!: allow > 1 lsp servers to be started during async tests (#37)
Browse files Browse the repository at this point in the history
Fixes #29

Co-authored-by: Mitchell Hanberg <[email protected]>
  • Loading branch information
sineed and mhanberg authored Aug 6, 2023
1 parent 85cd591 commit 8f586dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/gen_lsp.ex
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ defmodule GenLSP do
@options_schema NimbleOptions.new!(
buffer: [
type: {:or, [:pid, :atom]},
default: GenLSP.Buffer,
doc: "The `t:pid/0` or name of the `GenLSP.Buffer` process."
],
name: [
Expand Down
7 changes: 6 additions & 1 deletion lib/gen_lsp/buffer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ defmodule GenLSP.Buffer do
default: {GenLSP.Communication.Stdio, []},
doc:
"A `{module, args}` tuple, where `module` implements the `GenLSP.Communication.Adapter` behaviour."
],
name: [
type: :atom,
doc:
"Used for name registration as described in the \"Name registration\" section in the documentation for `GenServer`."
]
)

Expand All @@ -24,7 +29,7 @@ defmodule GenLSP.Buffer do
"""
def start_link(opts) do
opts = NimbleOptions.validate!(opts, @options_schema)
GenServer.start_link(__MODULE__, opts, name: Keyword.get(opts, :name, __MODULE__))
GenServer.start_link(__MODULE__, opts, Keyword.take(opts, [:name]))
end

@doc false
Expand Down

0 comments on commit 8f586dc

Please sign in to comment.