JakeBecker/ide-elixir

Dialyzer errors in slim files (Phoenix project)

general-CbIC opened this issue · 3 comments

Hi! I want to say that I really like this plugin!
It saves a lot of time with static code analysis implementation.

I'm currently working with the Phoenix Framework and using slim to create templates.
After checking the code, the console displays these errors for each slim file:

2018-03-12 22 00 59

And the code in these files starts with these tags:

2018-03-12 22 20 12

I know it's definitely not your fault (using dialyzer returns the same result), but it's frustrating.

We can eliminate these errors (may be using regexps for file names) or will it be a lame? If you think this should be decided on the side of the dialyzer, then you can close this issue.

Glad you like the plugin!

I hadn't seen Slim/Slime before. Anyway, I'd recommend filing this issue on Slime itself. If the modules it generates fail Dialyzer checks, they should either fix them or have the resulting modules export the @dialyzer module attribute to suppress these warnings. The docs for Dialyzer are a bit hard to follow at times (partly because they use Erlang syntax), but the section on suppressing warnings is here: http://erlang.org/doc/man/dialyzer.html#suppression

One more thing-- Double check that any conditionals in your templates are correct. Dialyzer warnings in the slim templates could possibly originate from your own code, in which case, keeping them around is useful. I'm disinclined to get rid of the Dialyzer warnings for Slim templates because if they fix any extraneous ones, actual warnings could be useful.

Thanks for the quick response!

Unfortunately, this error occurs with any content of slim file.
I'll try to contact slime's developers when I go deeper with the cause of its occurrence.

Also thanks for the information about @dialyzer tag! Probably, it will turn out to solve this problem independently.