halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

Feature request: run elm-make on opening file #171

Open Tails opened 4 years ago

Tails commented 4 years ago

I might be missing a configuration combination, but currently I have to manually save an elm file (or press CTRL+S on an unchanged file) before the linter errors (atom-ide-ui) become available.

Is it possible to run the linter immediately when opening an Elm file, or when switching to an opened Elm file? If there is a Elmjutsu command available to run the compiler we could also script this ourselves using the Atom init file.

Thanks!

Edit: I managed to somewhat get what I was looking for using the following snippet in init.coffee:

atom.workspace.onDidChangeActiveTextEditor (editor) ->
  if editor and editor.getPath().endsWith('.elm') and !editor.isModified()
    editor.save()