File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
apps/language_server/lib/language_server/dialyzer Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 1
1
defmodule ElixirLS.LanguageServer.Dialyzer.Analyzer do
2
2
require Record
3
3
4
- # :warn_race_condition is unsupported because it greatly increases analysis time
4
+ # warn_race_condition is unsupported because it greatly increases analysis time
5
+ # OTP 25 dropped support for warn_race_condition
6
+ # see https://github.com/erlang/otp/commit/74c65fbb588b98ee24df9f7302a43552178dfac2
7
+ # TODO remove this comment when OTP >= 25 is required
8
+
9
+ # default warns taken from
10
+ # https://github.com/erlang/otp/blob/4ed7957623e5ccbd420a09a506bd6bc9930fe93c/lib/dialyzer/src/dialyzer_options.erl#L34
11
+ # macros defined in https://github.com/erlang/otp/blob/4ed7957623e5ccbd420a09a506bd6bc9930fe93c/lib/dialyzer/src/dialyzer.hrl#L36
12
+ # as of OTP 25
5
13
@ default_warns [
6
14
:warn_behaviour ,
7
15
:warn_bin_construction ,
@@ -26,7 +34,17 @@ defmodule ElixirLS.LanguageServer.Dialyzer.Analyzer do
26
34
:warn_return_only_exit ,
27
35
:warn_umatched_return ,
28
36
:warn_unknown
29
- ]
37
+ ] ++ (
38
+ if String . to_integer ( System . otp_release ( ) ) >= 25 do
39
+ [
40
+ # OTP >= 25 options
41
+ :warn_contract_missing_return ,
42
+ :warn_contract_extra_return
43
+ ]
44
+ else
45
+ [ ]
46
+ end
47
+ )
30
48
@ log_cache_length 10
31
49
32
50
defstruct [
You can’t perform that action at this time.
0 commit comments