mybuddymichael / linter-elm-make

Lint your Elm files in Atom with elm-make
MIT License
32 stars 12 forks source link

Feature Request: Command for building Main.elm #169

Closed anagrius closed 2 years ago

anagrius commented 7 years ago

Quite often (20 times per day) I have to jump to Main.elm and save to get all my errors. Would be nice with atom-elm-make:compile-main

halohalospecial commented 7 years ago

Hi @anagrius, have you tried https://github.com/mybuddymichael/linter-elm-make#always-compile-main ?

anagrius commented 7 years ago

@halohalospecial Yes, but it is too heavy. I save many times a minute, to get the "new errors". When dealing with a module that is very connected (used by other modules) compile times for main is quite long and are painful.

halohalospecial commented 7 years ago

Hi @anagrius, the latest version (v0.28.0) has a Linter Elm Make: Lint command. I didn't add it before because there was a Linter: Lint command from the linter package. I couldn't find a similar command for Nuclide / Atom IDE, though, hence the new linter-elm-make command. Thanks!

anagrius commented 7 years ago

Does that actually lint Main or just the current buffer?

halohalospecial commented 7 years ago

It depends on whether you have Always Compile Main enabled (https://github.com/mybuddymichael/linter-elm-make#always-compile-main)

anagrius commented 7 years ago

I am sorry, I realize I did not explain my issue well enough. I don't want to lint-the-current-buffer-without-saving. My issue is that since our project is very large, using always-compile-main results in a very slow user experience in my workflow. Though, quite often I am working on a module that is used by a lot of other module. To see if the changes break anything I would have to either:

  1. Toggle always-compile-main, then save, then toggle always-compile-main back off.
  2. Open Main.elm and save that, which would lead to compile errors from all modules (this is how I do it ~20 times a day).

I would prefer to just have a single command that would lint-main from anywhere in my project.

halohalospecial commented 7 years ago

@anagrius, if you have Always Compile Main enabled and invoke the new command (Linter Elm Make: Lint, it should compile your main Elm file (configurable using Linter Elm Make: Set Main Paths). I just realized that there should be an option to disable linting on save/edit :smile:

anagrius commented 7 years ago

That still would not service my use case (if I understand you correctly). I would like to:

Having the option you're talking about would be nice as well, I don't think I would use it though.

halohalospecial commented 7 years ago

If I understand it correctly, what you need is something like Linter Elm Make: Lint Main, which will compile the main paths?

anagrius commented 7 years ago

Yup, kind of like in IntelliJ you have "Ctrl-F8" -> Compile Project. IntelliJ will always lint your current file, but will only do the entire project on command.