Closed johbra closed 3 years ago
Yes, the Elm guys completely changed the json error output of the Elm compiler, and elm-mode has not been updated to support both the old format and the new format. elm-compile-add-annotations
is the function to be fixed for this.
Ah, in fact the issue here is that the new elm make
does not support the --warn
flag, and this is what elm-mode was using previously in order to have elm make
print out the missing annotation so it could be inserted. Without support for that, there's no obvious alternative route to providing this functionality.
I'll confess to being quite frustrated by all the breakage introduced by Elm 0.19, and I don't currently have much faith that it will be addressed upstream.
It's a pity, I regret your frustration. But for me, a programming language without an effective Emacs mode isn't worth to be used further.
It's a pity, I regret your frustration. But for me, a programming language without an effective Emacs mode isn't worth to be used further.
It's a chicken and egg thing for me: my motivation to work on Emacs modes like this is related to my trust in the language. :-)
It's a chicken and egg thing for me: my motivation to work on Emacs modes like this is related to my trust in the language. :-)
Indeed, that's a problem. I am teaching functional programming (using Racket, Clojure/Clojurescript) and I am trying to figure out, if Elm could be an alternative. But especially for beginners you need a good support by editors or IDEs.
You might also consider using a basic subset of Haskell or Purescript. The Emacs support is extremely good for both these days, particularly Purescript. For the latter, you can install the language tools using only npm
, and the Emacs purescript-mode
+ psc-ide
+ psci
packages. The resulting experience is extremely nice.
Thanks for the hints, but for now I'll not give up using Elm
Yep, definitely not trying to talk you out of it. :-)
Is this still relevant?
I suspect (but have not checked) that elm-make
hasn't grown a --warn
flag, so I think there's no route for fixing this. Does LSP support inserting type signatures?
Yeah, elm-language-server
can infer and insert types now:
After insert:
Great, then fixing this will be out of scope for elm-mode, given current lack of core tool support.
If I type C-c C-a I get a message like Wrote /var/folders/r8/mm42spk12vbg3j856x5hr5qr0000gn/T/elm-comp-in-59859mMk.elm But no type annotations are added to the .elm buffer