elixir-ls icon indicating copy to clipboard operation
elixir-ls copied to clipboard

Feature request: Add support of Dialyxir options

Open AndrewDryga opened this issue 4 years ago • 3 comments

Environment

  • Elixir & Erlang versions (elixir --version): 1.11.2 / 23.1.2
  • Operating system: MacOS
  • Editor or IDE name (e.g. Emacs/VSCode): VSCode
  • Editor Plugin/LSP Client name:

Problem description

There is a closed issue in the deprecated repo on this topic: https://github.com/JakeBecker/elixir-ls/issues/131. ElixirLS does not respect Dialyzer settings from mix.exs, at least in umbrella applications.

Running mix dialyzer from the shell:

$ mix dialyzer
Finding suitable PLTs
Checking PLT...
...
Total errors: 43, Skipped: 43, Unnecessary Skips: 0
done in 2m10.33s
done (passed successfully)

When Dialyzer from ElixirLS reports hundreds issues from tests, eg:

Function __ex_unit_setup_0/1 has no local return.

When they are ignored in dialyzer ignore file:

mix.exs:

...
     dialyzer: [
        flags: [:unmatched_returns, :error_handling, :race_conditions, :underspecs],
        plt_add_apps: [:mix, :ftp],
        format: "dialyxir",
        ignore_warnings: ".dialyzer_ignore"
      ]
...

.dialyzer_ignore:

:0: Unknown function 'Elixir.ExUnit.
Function call/2 has no local return
Function 'raise_env_not_set!'/1 only terminates with explicit exception
_test.exs
test/support/
lib/phoenix/router.ex
legacy_apps/
Function 'raise_unsupported_relation!'/1 only terminates with explicit exception
The call erlang:cancel_timer(_timer_ref@1::'false',[{'info', 'false'}]) breaks the contract
Function routing_key/0 only terminates with explicit exception
Undefined callback function embed_as/1
Undefined callback function 'equal?'/2
:0: Unknown function persistent_term
Function init/1 has no local return
Function config_and_child_spec/1 has no local return

AndrewDryga avatar Nov 24 '20 00:11 AndrewDryga

Migration to exs version of an ignore file did not give any results

AndrewDryga avatar Nov 24 '20 02:11 AndrewDryga

Hi, if you could create a sample repository that has this issue, that would be very helpful in tracking it down.

axelson avatar Nov 24 '20 02:11 axelson

@AndrewDryga mix.exs dialyzer options and .dialyzer_ignore.exs are dialyxir extensions and they were never supported. Currently elixir-ls only uses dialyxir warning formatter. Of course a PR would be appreciated.

lukaszsamson avatar Nov 24 '20 08:11 lukaszsamson