DEV Community

Will Ceolin
Will Ceolin

Posted on

How to clear Elixir warnings on VSCode

After making changes to my Phoenix project, VSCode often gives me warnings:

  • Phoenix.LiveView.TagEngine.component/3 defined in application :phoenix_live_view is used by the current application but the current application does not depend on :phoenix_live_view.
  • Invalid type specification for function coming from the ElixirLS Dialyzer.
  • And other warnings that I don't remember now.

Here are some the things that help me to clear those warnings on VSCode:

  • Delete the _build, .elixir_ls and deps directories.
  • Reinstall dependencies: mix deps.get
  • With an .ex file open, go to the Command Palette (Cmd + Shift + P) and run these commands: Elixir: Trigger mix clean --deps in language server and Elixir: Restart language server, then restart VSCode.

If Elixir (not VSCode) starts complaining about routes not found, then you can delete the _build directory and compile your project again (mix compile).

Top comments (0)