Closed drvink closed 9 years ago
Merlin doesn't expects to synchronous commands to happen concurrently (in this case, completion and error-checking), we had a lot of difficulty to find a convenient api for emacs, the situation is still not satisfying.
I think error-checking could be made to use the asynchronous interface. Who is maintaining the flycheck integration of merlin? The fix shouldn't take long, but I am not a flycheck user so I won't be able to test.
I have no familiarity at all with merlin's guts, but I'm willing to offer any help I can in tracking down the issue and testing changes.
@lunaryorn updated flycheck-ocaml code. Could you test on your side? I am not 100% confident about my code ;).
@drvink I have patched versions of merlin.el and flycheck-ocaml.el, could you try with those files in your local installation and tell if that fixes the bug?
OK, let me give it a try.
JFYI, I had to change the version requirement for flycheck-ocaml.el to use merlin 1.4 to prevent package-install-from-buffer
from fetching the ELPA one (since the version number of merlin.el in your gist is 1.4)
Wow! You are using completion-at-point, not the merlin-company-backend.
Look at https://github.com/the-lambda-church/merlin/wiki/emacs-from-scratch#company-mode for the setup.
Oh dear. Let me try that and get back to you.
NP, it might fail as well, but if that's the case it will be easier to debug this way :)
Backtrace with the correct config :)
Sorry about that!
Ok, something went wrong with the version of merlin.el I shared. Some parts of the code look 6 months old?!, its like I mixed different version of the same file. Sorry for the inconvenience, I'll try to fix that.
This version of the gist looks saner https://gist.github.com/def-lkb/d3cc4907b81f15cc26d7
@drvink: do you have some kind of instant messager (or IRC) so that we can have more interactive discussion? That would help solving this quickly
IRC would work; where should I connect?
On freenode, I am def`, you can also find me on #ocaml.
This issue should be fixed. Feel free to reopen/comment if you still have problems.
Seems like there are still some issues--Emacs will occasionally lock up. auto-complete-mode
is fine, but company-mode
isn't. Furthermore, there are frequent pauses if I stop typing momentarily and then start again. flycheck also gets desynchronized from the buffer--I'll get nonsensical error messages (like it claiming something is a string when it's an int).
I spoke too soon--I get a very occasional hard lockup even with company-mode
off and only auto-complete-mode
and flycheck-mode
on. @def-lkb Let me know if there's any way I can provide more information.
Where you able to produce a stack trace of those lockups?
@def-lkb I'll try to get something from within Emacs when the lockup happens, but if I can't, I can get Emacs to dump core, and you might be able to do something with that, since Emacs includes gdb scripts which will give a complete stack trace (including the calls into Lisp from C and vice versa).
It's not clear if this is a merlin bug or a flycheck-ocaml bug (flycheck/flycheck-ocaml#3), so I'm filing an issue here in the hope the root cause can be found.
flycheck-ocaml breaks if company-mode or auto-complete-mode (or both) are enabled. Strange parts of the buffer will get highlighted as errors; in particular, messages like these are common:
Merlin was already processing ((tell start at ((assoc) (line . 35) (col . 31)))) while ((tell start at ((assoc) (line . 35) (col . 31)))) was attempted
With auto-completion-mode specifically, Emacs will lock up after showing a completion listing.
I'm seeing this on Emacs 24.5.1 with the latest flycheck, merlin, company, and auto-complete.