-
Notifications
You must be signed in to change notification settings - Fork 80
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
Completion in the *OCaml* buffer #299
Comments
There's no way for Merlin to provide completion candidates directly for the top-level, as it operates on source files. |
Small experiment: (same configuration except for Tuareg now v3.0.1) Using a very basic init.el (with tuareg, merlin, company, and NOTHING else) I get the same behavior. e.g. with this ugly code (idem with eval-region & eval-buffer): (defun my-tuareg-eval-phrase ()
(interactive)
(tuareg-eval-phrase)
(set-buffer "*OCaml*")
(merlin-mode)) I have the completion in the OCaml REPL. (completion-at-point alone works too). So I guess it must be possible to properly incorporate a completion in the Tuareg's interactive mode. |
I'll have to take a closer look at where Merlin pulls the candidates from exactly, but I can't imagine how exactly something like this will work. E.g. do completion candidates update after you load stuff in the toplevel or reload the code there? I'm also puzzled by the command you've shared - you first eval something in a source file (I presume), then set the current buffer to the REPL and you enable |
Configuration:
OCaml 4.14.0 - Emacs 29.0.50 - Tuareg (v20220929.1327) - Merlin - Linux Box x86_64
By default, I have no completion in the *OCaml* buffer.
Now, if I run 'M-x merlin-mode' I get the message 'Merlin mode disabled in current buffer'
and ,oh surprise, the completion appears (in this *OCaml* buffer).
So,three questions:
Note:
The emacs mode of Merlin provides 3 ways to achieve completion:
Eventually, this third way (being the native completion engine of Emacs) seems a good candidate to use.
The text was updated successfully, but these errors were encountered: