@@ -2004,24 +2004,24 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
2004
2004
end
2005
2005
2006
2006
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
2015
2016
end
2016
- end
2017
- """
2017
+ """
2018
2018
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 )
2022
2022
2023
- assert list == [ % { name: "my_var" , type: :variable } ]
2024
- end
2023
+ assert list == [ % { name: "my_var" , type: :variable } ]
2024
+ end
2025
2025
end
2026
2026
2027
2027
test "tuple destructuring" do
@@ -4015,47 +4015,47 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
4015
4015
4016
4016
describe "suggestions for typespecs" do
4017
4017
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
4027
4027
end
4028
4028
4029
4029
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
+ """
4035
4035
4036
- suggestion = suggestion_by_name ( "remote_list_t" , buffer )
4036
+ suggestion = suggestion_by_name ( "remote_list_t" , buffer )
4037
4037
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
+ """
4043
4043
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
4049
4049
end
4050
4050
4051
4051
test "on specs" do
4052
4052
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
+ """
4057
4057
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 )
4059
4059
end
4060
4060
4061
4061
buffer = """
@@ -4102,55 +4102,55 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
4102
4102
end
4103
4103
4104
4104
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
+ """
4112
4112
4113
- [ suggestion_1 ] = suggestions_by_name ( "my_type" , buffer )
4113
+ [ suggestion_1 ] = suggestions_by_name ( "my_type" , buffer )
4114
4114
4115
- assert suggestion_1 . signature == "my_type()"
4116
- end
4115
+ assert suggestion_1 . signature == "my_type()"
4116
+ end
4117
4117
end
4118
4118
4119
4119
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
+ """
4126
4126
4127
- [ suggestion_1 ] = suggestions_by_name ( "my_type" , buffer )
4127
+ [ suggestion_1 ] = suggestions_by_name ( "my_type" , buffer )
4128
4128
4129
- assert suggestion_1 . signature == "my_type()"
4130
- end
4129
+ assert suggestion_1 . signature == "my_type()"
4130
+ end
4131
4131
end
4132
4132
4133
4133
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
4154
4154
end
4155
4155
4156
4156
test "local types - filter list of typespecs" do
0 commit comments