Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format on save does not respect imported formatter configuration #58

Closed
Rosetjau opened this issue Mar 16, 2018 · 2 comments
Closed

Format on save does not respect imported formatter configuration #58

Rosetjau opened this issue Mar 16, 2018 · 2 comments

Comments

@Rosetjau
Copy link

When running the formatter from command line via mix format the formatter respects the configuration that is imported from dependencies. The same does not seem to apply to the "format on save" feature in Visual Studio Code.

I have set up an example repository to reproduce this issue. Steps to reproduce:

  1. Clone the repo
  2. Run mix format from command line. Notice that the formatter exits without changing the schema.ex file, because the .formatter.exs file imports the configuration that is exported by Absinthe
  3. Open the project with Visual Studio Code, edit the workspace settings to enable "editor.formatOnSave", open the schema.ex file and save it
  4. Upon saving the file the formatter will add parentheses to the schema.ex file, even if the Absinthe formatter configuration declares those functions/macros as locals_without_parens
@JakeBecker
Copy link
Owner

Ah, looks like they've added a lot of configuration options to the format task since I added support for it to ElixirLS. Unfortunately, supporting those features right now will likely involve copy-and-pasting a lot of private functions from Elixir. I'm willing to do that, but I think I also will send a PR to try to export some of the configuration functionality from Mix.Tasks.Format in future Elixir versions.

I'll likely get to this sometime next week.

@JakeBecker
Copy link
Owner

This issue was moved to JakeBecker/elixir-ls#67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants