question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Elm files never format on save

See original GitHub issue

Expected Behavior

Format on save.

Current Behavior

Elm files never format on save. Tried setting Elm Format Path and was able to use alt + shift + f formatting on elm doc after, but still no format on save.

Possible Solution

Steps to Reproduce (for bugs)

  1. Installed plugin in existing version of VS Code
  2. Ran npm install -g elm-test elm-format to be sure
  3. Tried testing format on save without luck
  4. Deleted vs code plugins folder and tried reinstalling just this one, suspecting a possible conflict
  5. Still no format on save
  6. Tried setting Elm Format Path to c:\Program Files\nodejs\elm-format
  7. Still no format on save, but was able to use alt + shift + f formatting (only after specifying this setting)

Context

Syntax highlighting and some compiler checks seem to be working but can’t get format on save working. Also had the previous deprecated VSC Elm extension before switching to this one and had the same formatting issue before as well.

Your Environment

  • Version used: 0.9.3
  • Editor name and version (e.g. VSCode 1.36.1): VSCode 1.42.1
  • Environment name and version (e.g. node.js 5.4): node 10.16.0
  • Operating System and version: Win 10 Pro

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
aotarolacommented, Mar 23, 2020

if alt + shift + f works for you, then you are probably not triggering format on save, check your settings to have

"editor.formatOnSave": true,
1reaction
pnaylorcommented, Mar 23, 2020

Wow, you were right @aotarola, thank you! Can’t believe I had not found that in my searching on the problem. Hopefully this will help someone else in the future at least now as well though. Cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Elm VSCode plugin does not format on save - Stack Overflow
I am having trouble getting the Elm VSCode plugin to format on save. I have set the absolute path to my global install...
Read more >
avh4/elm-format - GitHub
Install elm-format · Install the extension Elm Plugin for Visual Studio Code. · Configure the extension to format on save: Find your settings.json...
Read more >
Using elm-format in Visual Studio Code
The elm-format is a great tool that formats your Elm code. It makes code easier to read by forcing the same formatting rules...
Read more >
Elm Format on Save - Package Control
Run elm-format whenever you save an Elm file. And add the keyboard shortcut Ctrl+K Ctrl+F (or Cmd+K Cmd+F on Mac) to run elm-format...
Read more >
The State of Elm IDEs/Editing Experiences - Learn
Unfortunatelly, the LSP has never worked reliable for me (it is slow and kept ... 4 with Elm Syntax Highlighting, Elm Format on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found