raulchedrese/nova-elixir-ls

Format on save does not work

tobiastom opened this issue · 6 comments

I have enabled the format on save option, but when I save a document, it does not get formatted.
Running mix format <filename> from the terminal works fine.

I can find the following error message in the extension console, but it does not help me much to debug it further:

Cannot format file from current directory (Currently in .)

Same here, although I'm not seeing that error message in the extension console.

Formatting has been finicky. I previously fixed an issue with file paths that was causing formatting to stop working but looks like there may be another bug. If anyone is interested in attempting a fix please do! The format command is being dispatched here.

@tobiastom in your case it looks like the format command is being sent but failing. This will likely require debugging on the ElixirLS end to see what would cause that error. Searching the ElixirLS code base for that error message might be a good place to start.

@hfjallemark in your case it looks like the command may be failing to send. You could throw some console.log calls here to verify if it is getting called.

My issue seems to be fixed with Nova 9 and format on save works for me.

Does not work for me Nova 9.2

Unfortunately I can confirm this.

For me it was just disabled inside the settings. Enabling the "Format on save" option, disabling and enabling the extension made format on save work again.

I'm going to close this because "Format on save" appears to be more reliable in newer versions of Nova. If you are still experiencing this please post here with the output of your extension console.