Skip to content

Commit 17f3591

Browse files
committed
add OTP 28 dialyzer options
1 parent 77fdae4 commit 17f3591

File tree

1 file changed

+17
-1
lines changed
  • apps/language_server/lib/language_server/dialyzer

1 file changed

+17
-1
lines changed

apps/language_server/lib/language_server/dialyzer/analyzer.ex

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defmodule ElixirLS.LanguageServer.Dialyzer.Analyzer do
1111
# default warns taken from
1212
# https://github.com/erlang/otp/blob/928d03e6da416208fce7b9a7dbbfbb4f25d26c37/lib/dialyzer/src/dialyzer_options.erl#L34
1313
# macros defined in https://github.com/erlang/otp/blob/928d03e6da416208fce7b9a7dbbfbb4f25d26c37/lib/dialyzer/src/dialyzer.hrl#L36
14-
# as of OTP 27
14+
# as of OTP 28
1515

1616
# NOTE the allowed options in vscode extension need to be updated basing on https://github.com/erlang/otp/blob/412bff5196fc0ab88a61fe37ca30e5226fc7872d/lib/dialyzer/src/dialyzer_options.erl#L495
1717
@default_warns [
@@ -38,6 +38,14 @@ defmodule ElixirLS.LanguageServer.Dialyzer.Analyzer do
3838
]
3939
else
4040
[]
41+
end) ++
42+
(if String.to_integer(System.otp_release()) >= 28 do
43+
[
44+
# warn_contract_opaque is enabled by default since OTP 26
45+
:warn_contract_opaque
46+
]
47+
else
48+
[]
4149
end)
4250

4351
@non_default_warns [
@@ -66,6 +74,14 @@ defmodule ElixirLS.LanguageServer.Dialyzer.Analyzer do
6674
# warn_unknown is enabled by default since OTP 26
6775
:warn_unknown
6876
]
77+
end) ++
78+
(if String.to_integer(System.otp_release()) >= 28 do
79+
[
80+
# OTP >= 28 options
81+
:warn_opaque_union
82+
]
83+
else
84+
[]
6985
end)
7086
@log_cache_length 10
7187

0 commit comments

Comments
 (0)