Skip to content

Commit 8f586dc

Browse files
sineedmhanberg
andauthored
fix!: allow > 1 lsp servers to be started during async tests (#37)
Fixes #29 Co-authored-by: Mitchell Hanberg <mitch@mitchellhanberg.com>
1 parent 85cd591 commit 8f586dc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/gen_lsp.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ defmodule GenLSP do
120120
@options_schema NimbleOptions.new!(
121121
buffer: [
122122
type: {:or, [:pid, :atom]},
123-
default: GenLSP.Buffer,
124123
doc: "The `t:pid/0` or name of the `GenLSP.Buffer` process."
125124
],
126125
name: [

lib/gen_lsp/buffer.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ defmodule GenLSP.Buffer do
1212
default: {GenLSP.Communication.Stdio, []},
1313
doc:
1414
"A `{module, args}` tuple, where `module` implements the `GenLSP.Communication.Adapter` behaviour."
15+
],
16+
name: [
17+
type: :atom,
18+
doc:
19+
"Used for name registration as described in the \"Name registration\" section in the documentation for `GenServer`."
1520
]
1621
)
1722

@@ -24,7 +29,7 @@ defmodule GenLSP.Buffer do
2429
"""
2530
def start_link(opts) do
2631
opts = NimbleOptions.validate!(opts, @options_schema)
27-
GenServer.start_link(__MODULE__, opts, name: Keyword.get(opts, :name, __MODULE__))
32+
GenServer.start_link(__MODULE__, opts, Keyword.take(opts, [:name]))
2833
end
2934

3035
@doc false

0 commit comments

Comments
 (0)