Skip to content

Commit 3fd40ce

Browse files
committed
format
1 parent 8cc7593 commit 3fd40ce

File tree

4 files changed

+252
-252
lines changed

4 files changed

+252
-252
lines changed

apps/language_server/test/providers/completion/suggestions_test.exs

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,24 +2004,24 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
20042004
end
20052005

20062006
if Version.match?(System.version(), ">= 1.15.0") do
2007-
test "list vars in multiline struct" do
2008-
buffer = """
2009-
defmodule MyServer do
2010-
def go do
2011-
%Some{
2012-
filed: my_var,
2013-
other: my
2014-
} = abc()
2007+
test "list vars in multiline struct" do
2008+
buffer = """
2009+
defmodule MyServer do
2010+
def go do
2011+
%Some{
2012+
filed: my_var,
2013+
other: my
2014+
} = abc()
2015+
end
20152016
end
2016-
end
2017-
"""
2017+
"""
20182018

2019-
list =
2020-
Suggestion.suggestions(buffer, 5, 16)
2021-
|> Enum.filter(fn s -> s.type in [:variable] end)
2019+
list =
2020+
Suggestion.suggestions(buffer, 5, 16)
2021+
|> Enum.filter(fn s -> s.type in [:variable] end)
20222022

2023-
assert list == [%{name: "my_var", type: :variable}]
2024-
end
2023+
assert list == [%{name: "my_var", type: :variable}]
2024+
end
20252025
end
20262026

20272027
test "tuple destructuring" do
@@ -4015,47 +4015,47 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
40154015

40164016
describe "suggestions for typespecs" do
40174017
if Version.match?(System.version(), ">= 1.15.0") do
4018-
test "remote types - filter list of typespecs" do
4019-
buffer = """
4020-
defmodule My do
4021-
@type a :: Remote.remote_t\
4022-
"""
4023-
4024-
list = suggestions_by_type(:type_spec, buffer)
4025-
assert length(list) == 4
4026-
end
4018+
test "remote types - filter list of typespecs" do
4019+
buffer = """
4020+
defmodule My do
4021+
@type a :: Remote.remote_t\
4022+
"""
4023+
4024+
list = suggestions_by_type(:type_spec, buffer)
4025+
assert length(list) == 4
4026+
end
40274027
end
40284028

40294029
if Version.match?(System.version(), ">= 1.15.0") do
4030-
test "remote types - retrieve info from typespecs" do
4031-
buffer = """
4032-
defmodule My do
4033-
@type a :: Remote.\
4034-
"""
4030+
test "remote types - retrieve info from typespecs" do
4031+
buffer = """
4032+
defmodule My do
4033+
@type a :: Remote.\
4034+
"""
40354035

4036-
suggestion = suggestion_by_name("remote_list_t", buffer)
4036+
suggestion = suggestion_by_name("remote_list_t", buffer)
40374037

4038-
assert suggestion.spec == """
4039-
@type remote_list_t() :: [
4040-
remote_t()
4041-
]\
4042-
"""
4038+
assert suggestion.spec == """
4039+
@type remote_list_t() :: [
4040+
remote_t()
4041+
]\
4042+
"""
40434043

4044-
assert suggestion.signature == "remote_list_t()"
4045-
assert suggestion.arity == 0
4046-
assert suggestion.doc == "Remote list type"
4047-
assert suggestion.origin == "ElixirSenseExample.ModuleWithTypespecs.Remote"
4048-
end
4044+
assert suggestion.signature == "remote_list_t()"
4045+
assert suggestion.arity == 0
4046+
assert suggestion.doc == "Remote list type"
4047+
assert suggestion.origin == "ElixirSenseExample.ModuleWithTypespecs.Remote"
4048+
end
40494049
end
40504050

40514051
test "on specs" do
40524052
if Version.match?(System.version(), ">= 1.15.0") do
4053-
buffer = """
4054-
defmodule My do
4055-
@spec a() :: Remote.\
4056-
"""
4053+
buffer = """
4054+
defmodule My do
4055+
@spec a() :: Remote.\
4056+
"""
40574057

4058-
assert %{name: "remote_list_t"} = suggestion_by_name("remote_list_t", buffer)
4058+
assert %{name: "remote_list_t"} = suggestion_by_name("remote_list_t", buffer)
40594059
end
40604060

40614061
buffer = """
@@ -4102,55 +4102,55 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
41024102
end
41034103

41044104
if Version.match?(System.version(), ">= 1.15.0") do
4105-
test "remote types - by attribute" do
4106-
buffer = """
4107-
defmodule My do
4108-
@type my_type :: integer
4109-
@attr My
4110-
@type some :: @attr.my\
4111-
"""
4105+
test "remote types - by attribute" do
4106+
buffer = """
4107+
defmodule My do
4108+
@type my_type :: integer
4109+
@attr My
4110+
@type some :: @attr.my\
4111+
"""
41124112

4113-
[suggestion_1] = suggestions_by_name("my_type", buffer)
4113+
[suggestion_1] = suggestions_by_name("my_type", buffer)
41144114

4115-
assert suggestion_1.signature == "my_type()"
4116-
end
4115+
assert suggestion_1.signature == "my_type()"
4116+
end
41174117
end
41184118

41194119
if Version.match?(System.version(), ">= 1.15.0") do
4120-
test "remote types - by __MODULE__" do
4121-
buffer = """
4122-
defmodule My do
4123-
@type my_type :: integer
4124-
@type some :: __MODULE__.my\
4125-
"""
4120+
test "remote types - by __MODULE__" do
4121+
buffer = """
4122+
defmodule My do
4123+
@type my_type :: integer
4124+
@type some :: __MODULE__.my\
4125+
"""
41264126

4127-
[suggestion_1] = suggestions_by_name("my_type", buffer)
4127+
[suggestion_1] = suggestions_by_name("my_type", buffer)
41284128

4129-
assert suggestion_1.signature == "my_type()"
4130-
end
4129+
assert suggestion_1.signature == "my_type()"
4130+
end
41314131
end
41324132

41334133
if Version.match?(System.version(), ">= 1.15.0") do
4134-
test "remote types - retrieve info from typespecs with params" do
4135-
buffer = """
4136-
defmodule My do
4137-
@type a :: Remote.\
4138-
"""
4139-
4140-
[suggestion_1, suggestion_2] = suggestions_by_name("remote_t", buffer)
4141-
4142-
assert suggestion_1.spec == "@type remote_t() :: atom()"
4143-
assert suggestion_1.signature == "remote_t()"
4144-
assert suggestion_1.arity == 0
4145-
assert suggestion_1.doc == "Remote type"
4146-
assert suggestion_1.origin == "ElixirSenseExample.ModuleWithTypespecs.Remote"
4147-
4148-
assert suggestion_2.spec =~ "@type remote_t(a, b) ::"
4149-
assert suggestion_2.signature == "remote_t(a, b)"
4150-
assert suggestion_2.arity == 2
4151-
assert suggestion_2.doc == "Remote type with params"
4152-
assert suggestion_2.origin == "ElixirSenseExample.ModuleWithTypespecs.Remote"
4153-
end
4134+
test "remote types - retrieve info from typespecs with params" do
4135+
buffer = """
4136+
defmodule My do
4137+
@type a :: Remote.\
4138+
"""
4139+
4140+
[suggestion_1, suggestion_2] = suggestions_by_name("remote_t", buffer)
4141+
4142+
assert suggestion_1.spec == "@type remote_t() :: atom()"
4143+
assert suggestion_1.signature == "remote_t()"
4144+
assert suggestion_1.arity == 0
4145+
assert suggestion_1.doc == "Remote type"
4146+
assert suggestion_1.origin == "ElixirSenseExample.ModuleWithTypespecs.Remote"
4147+
4148+
assert suggestion_2.spec =~ "@type remote_t(a, b) ::"
4149+
assert suggestion_2.signature == "remote_t(a, b)"
4150+
assert suggestion_2.arity == 2
4151+
assert suggestion_2.doc == "Remote type with params"
4152+
assert suggestion_2.origin == "ElixirSenseExample.ModuleWithTypespecs.Remote"
4153+
end
41544154
end
41554155

41564156
test "local types - filter list of typespecs" do

0 commit comments

Comments
 (0)