-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for errors when opening new ocaml files in Emacs #880
Conversation
Otherwise, the user has to explicitly save the file before they can see any merlin errors.
I don't think this has its place in merlin's default configuration:
Thank you for the suggestion though! |
I also agree that this seems like the wrong way to accomplish this. Is there a flycheck option to check a buffer after opening it? That would solve the problem in general. |
Flycheck and flymake always check the buffer when you open the file, so that set my expectations. I also found it surprising that if I explicitly call It's possible to work around this in my own Emacs configuration, but my concern is that it's not discoverable. Have I missed something? I'm less concerned about performance: I've tested this on an ocaml codebase with >100KLOC and >100 errors and it wasn't an issue. Flycheck is actually more aggressive than merlin: most checkers will update even if you don't save. I suppose it's a question of whether you see merlin.el as primarily a code completion tool, or an error display package :) |
FWIW, maybe it's just me, but I not infrequently open files and explicitly do not want merlin to report errors, since the file has not been compiled, is at the other end of an only minimally-configured tramp connection, etc. |
So why doesn't it work in this case for you? Flycheck should drive this via https://github.com/flycheck/flycheck-ocaml. My main concern is such a setting shouldn't really be chosen at the mode level. It would be annoying to set this for ocaml, python, haskell, etc. |
@jberdine FWIW I've been thinking of adding tramp support for Merlin, which would suit my workflow and maybe yours too? @rgrinberg aha, I didn't realise that flycheck supported merlin! I see there's flycheck-ocaml which teaches flycheck how to use merlin. I only had flycheck itself. |
I've added a note to the wiki page. Thanks for clarifying :) |
FWIW I've been thinking of adding tramp support for Merlin, which
would suit my workflow and maybe yours too?
tramp support for merlin would be most excellent!
|
I did explore using flycheck with merlin, but it doesn't handle error ranges. It can't handle highlighting the part of the line that has the type error (see flycheck/flycheck-ocaml#12 and flycheck/flycheck#1400). At this point, I think merlin.el works better without flycheck. |
Otherwise, the user has to explicitly save the file before they can
see any merlin errors.