Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio code - Elixir formatter not working, trying to use prettier instead

When pressing save VS.code is not formatting Elixir files, even after installing the elixir-ls extension https://github.com/elixir-lsp/elixir-ls

VS.Code is trying to use Prettier as the default formatter and the option format with doesn't show other formatters.

like image 450
Immutable Brick Avatar asked Jan 25 '23 00:01

Immutable Brick


1 Answers

We can define different formatters based in the language we are using, under settings.json in user space we can specify the configurations for Elixir.

On my file I used:

  "[elixir]": {
    "editor.defaultFormatter": "JakeBecker.elixir-ls"
  },

My formatter starts with JakeBecker because I have the old plugin still installed in my system, this may or not have changed in the latest version.

like image 91
Immutable Brick Avatar answered Jan 29 '23 13:01

Immutable Brick