elixir-lsp / vscode-elixir-ls

Elixir language support and debugger for VS Code, powered by ElixirLS.
https://marketplace.visualstudio.com/items?itemName=JakeBecker.elixir-ls
MIT License
545 stars 105 forks source link

Custom `dot-formatter` location isn't respected by extension #421

Open kieraneglin opened 5 months ago

kieraneglin commented 5 months ago

Is this the right repo?

This is specifically a request for this repo

Environment

Troubleshooting

Setup

defp aliases do [ format: "format --dot-formatter=tooling/.formatter.exs",

...

] end


- Attempt to format a file via the extension

### Expected behaviour

`--dot-formatter` argument is respected (or, if not respected, is configurable)

### Actual behaviour

`--dot-formatter` argument is not respected or configurable

### Spitballing

I'm not sure if this is possible, but it'd rule if you could specify the exact formatting command to run in your VS Code settings and the [format task](https://github.com/elixir-lsp/vscode-elixir-ls/blob/160e08a0ff7365ea21d91bff9e0ebf62cb50bbfc/src/taskProvider.ts#L187) would use that command instead. The default value would be `mix format`
lukaszsamson commented 4 months ago

ElixirLS handler for LSP textDocument/formatting does not run the mix task. It calls formatter APIs directly. If you need changing path I suggest opening an issue in elixir so dot-formatter path setting can be read from mix project.

Alternatively stick to using a custom VSCode task