Skip to content

Commit 4d50c37

Browse files
committed
run static analysis on 1.13
1 parent 2c02969 commit 4d50c37

File tree

6 files changed

+89
-84
lines changed

6 files changed

+89
-84
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ jobs:
2828
otp: 23.3.4.4
2929
tests_may_fail: false
3030
check_unused_deps: true
31-
- elixir: 1.12.x
32-
otp: 24.0.x
31+
- elixir: 1.13.x
32+
otp: 22.3.4.20
3333
tests_may_fail: false
3434
check_unused_deps: true
3535
warnings_as_errors: true
3636
- elixir: 1.13.x
37-
otp: 24.0.x
37+
otp: 24.1.x
3838
tests_may_fail: false
3939
# Needs to be false until https://github.com/elixir-lsp/elixir-ls/issues/642 is fixed
4040
warnings_as_errors: false
@@ -66,8 +66,8 @@ jobs:
6666
strategy:
6767
matrix:
6868
include:
69-
- elixir: 1.12.x
70-
otp: 24.0.x
69+
- elixir: 1.13.x
70+
otp: 24.1.x
7171
steps:
7272
- uses: actions/checkout@v2
7373
- uses: erlef/setup-beam@v1

apps/language_server/lib/language_server/server.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,10 @@ defmodule ElixirLS.LanguageServer.Server do
11381138
if is_nil(prev_env) or env == prev_env do
11391139
System.put_env(env)
11401140
else
1141-
JsonRpc.show_message(:warning, "You must restart ElixirLS after changing environment variables")
1141+
JsonRpc.show_message(
1142+
:warning,
1143+
"You must restart ElixirLS after changing environment variables"
1144+
)
11421145
end
11431146

11441147
state

apps/language_server/test/providers/code_lens/type_spec/contract_translator_test.exs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,13 @@ defmodule ElixirLS.LanguageServer.Providers.CodeLens.TypeSpec.ContractTranslator
145145

146146
test "map with fields" do
147147
contract = '(any()) -> \#{integer()=>any(), 1:=atom(), abc:=4}'
148-
149-
expected = if Version.match?(System.version(), "< 1.13.0") do
150-
"foo(any) :: %{optional(integer) => any, 1 => atom, :abc => 4}"
151-
else
152-
"foo(any) :: %{optional(integer) => any, 1 => atom, abc: 4}"
153-
end
148+
149+
expected =
150+
if Version.match?(System.version(), "< 1.13.0") do
151+
"foo(any) :: %{optional(integer) => any, 1 => atom, :abc => 4}"
152+
else
153+
"foo(any) :: %{optional(integer) => any, 1 => atom, abc: 4}"
154+
end
154155

155156
assert expected ==
156157
ContractTranslator.translate_contract(:foo, contract, false, Atom)

apps/language_server/test/providers/execute_command/expand_macro_test.exs

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -65,71 +65,71 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.ExpandMacroTest do
6565
})
6666

6767
if Version.match?(System.version(), "< 1.13.0") do
68-
assert res == %{
69-
"expand" => """
70-
require(ElixirLS.Test.MacroA)
71-
ElixirLS.Test.MacroA.__using__([])
72-
""",
73-
"expandAll" => """
74-
require(ElixirLS.Test.MacroA)
75-
76-
(
77-
import(ElixirLS.Test.MacroA)
78-
79-
def(macro_a_func) do
80-
:ok
81-
end
82-
)
83-
""",
84-
"expandOnce" => """
85-
require(ElixirLS.Test.MacroA)
86-
ElixirLS.Test.MacroA.__using__([])
87-
""",
88-
"expandPartial" => """
89-
require(ElixirLS.Test.MacroA)
90-
91-
(
92-
import(ElixirLS.Test.MacroA)
93-
94-
def(macro_a_func) do
95-
:ok
96-
end
97-
)
98-
"""
99-
}
100-
else
101-
assert res == %{
102-
"expand" => """
103-
require ElixirLS.Test.MacroA
104-
ElixirLS.Test.MacroA.__using__([])
105-
""",
106-
"expandAll" => """
107-
require ElixirLS.Test.MacroA
108-
109-
(
110-
import ElixirLS.Test.MacroA
111-
112-
def macro_a_func do
113-
:ok
114-
end
115-
)
116-
""",
117-
"expandOnce" => """
118-
require ElixirLS.Test.MacroA
119-
ElixirLS.Test.MacroA.__using__([])
120-
""",
121-
"expandPartial" => """
122-
require ElixirLS.Test.MacroA
123-
124-
(
125-
import ElixirLS.Test.MacroA
126-
127-
def macro_a_func do
128-
:ok
129-
end
130-
)
131-
"""
132-
}
133-
end
68+
assert res == %{
69+
"expand" => """
70+
require(ElixirLS.Test.MacroA)
71+
ElixirLS.Test.MacroA.__using__([])
72+
""",
73+
"expandAll" => """
74+
require(ElixirLS.Test.MacroA)
75+
76+
(
77+
import(ElixirLS.Test.MacroA)
78+
79+
def(macro_a_func) do
80+
:ok
81+
end
82+
)
83+
""",
84+
"expandOnce" => """
85+
require(ElixirLS.Test.MacroA)
86+
ElixirLS.Test.MacroA.__using__([])
87+
""",
88+
"expandPartial" => """
89+
require(ElixirLS.Test.MacroA)
90+
91+
(
92+
import(ElixirLS.Test.MacroA)
93+
94+
def(macro_a_func) do
95+
:ok
96+
end
97+
)
98+
"""
99+
}
100+
else
101+
assert res == %{
102+
"expand" => """
103+
require ElixirLS.Test.MacroA
104+
ElixirLS.Test.MacroA.__using__([])
105+
""",
106+
"expandAll" => """
107+
require ElixirLS.Test.MacroA
108+
109+
(
110+
import ElixirLS.Test.MacroA
111+
112+
def macro_a_func do
113+
:ok
114+
end
115+
)
116+
""",
117+
"expandOnce" => """
118+
require ElixirLS.Test.MacroA
119+
ElixirLS.Test.MacroA.__using__([])
120+
""",
121+
"expandPartial" => """
122+
require ElixirLS.Test.MacroA
123+
124+
(
125+
import ElixirLS.Test.MacroA
126+
127+
def macro_a_func do
128+
:ok
129+
end
130+
)
131+
"""
132+
}
133+
end
134134
end
135135
end

apps/language_server/test/providers/formatting_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
3535
assert changes == [
3636
%TextEdit{
3737
newText: ")",
38-
range: %{
38+
range: %{
3939
"end" => %{"character" => 23, "line" => 4},
4040
"start" => %{"character" => 23, "line" => 4}
4141
}

apps/language_server/test/server_test.exs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -988,12 +988,13 @@ defmodule ElixirLS.LanguageServer.ServerTest do
988988
%{
989989
"documentation" => %{
990990
"kind" => "markdown",
991-
"value" => """
992-
Inspects and writes the given `item` to the device.
991+
"value" =>
992+
"""
993+
Inspects and writes the given `item` to the device.
993994
994-
```
995-
@spec inspect\
996-
""" <> _
995+
```
996+
@spec inspect\
997+
""" <> _
997998
},
998999
"label" => "inspect(item, opts \\\\ [])",
9991000
"parameters" => [%{"label" => "item"}, %{"label" => "opts \\\\ []"}]

0 commit comments

Comments
 (0)