Git Product home page Git Product logo

ocaml / merlin Goto Github PK

View Code? Open in Web Editor NEW
1.5K 40.0 228.0 47.09 MB

Context sensitive completion for OCaml in Vim and Emacs

Home Page: https://ocaml.github.io/merlin/

License: MIT License

Shell 0.12% Emacs Lisp 0.92% OCaml 94.98% Standard ML 0.01% Python 0.25% C 0.32% Batchfile 0.01% Perl 2.08% Makefile 0.08% Raku 0.76% Turing 0.01% Vim Script 0.43% Dockerfile 0.01% Nix 0.02%
ocaml emacs vim atom

merlin's Introduction

⚠️ CAUTION

The developer team released OCaml 5.0.0 in December 2022. This release sports a full rewrite of its runtime system for shared-memory parallel programming using domains and native support for concurrent programming using effect handlers.

Owing to the large number of changes, the initial 5.0 release is more experimental than usual. It is recommended that all users wanting a stable release use the 4.14 release which will continue to be supported and updated while 5.x reaches feature and stability parity. Similarly, if you need one of the ports not yet supported in the 5.0 release you must use the 4.14 release.

The initial release of OCaml 5.0 only supports the native compiler under ARM64 and x86-64 architectures under Linux, macOS and the BSDs. On Windows, only the MinGW-w64 port is supported in OCaml 5.0 and the Cygwin port is restored in 5.1. On Linux, native code support for RISC-V and s390x/IBM Z is available in OCaml 5.1 and in 5.2 for Power.

❗ From OCaml 5.0 onwards, native compilation is available only on 64-bit systems. Native compilation on 32-bit systems is no longer available, nor are there plans to bring it back. The bytecode compiler will continue to work on all architectures.

Branch trunk Branch 5.2 Branch 5.1 Branch 5.0 Branch 4.14

Github CI Build Status (trunk branch) Github CI Hygiene Status (trunk branch) AppVeyor Build Status (trunk branch)

Github CI Build Status (5.2 branch) AppVeyor Build Status (5.2 branch)

Github CI Build Status (5.1 branch) AppVeyor Build Status (5.1 branch)

Github CI Build Status (5.0 branch) AppVeyor Build Status (5.0 branch)

Github CI Build Status (4.14 branch) AppVeyor Build Status (4.14 branch)

README

Overview

OCaml is a functional, statically-typed programming language from the ML family, offering a powerful module system extending that of Standard ML and a feature-rich, class-based object system.

OCaml comprises two compilers. One generates bytecode which is then interpreted by a C program. This compiler runs quickly, generates compact code with moderate memory requirements, and is portable to many 32 or 64 bit platforms. Performance of generated programs is quite good for a bytecoded implementation. This compiler can be used either as a standalone, batch-oriented compiler that produces standalone programs, or as an interactive REPL system.

The other compiler generates high-performance native code for a number of processors. Compilation takes longer and generates bigger code, but the generated programs deliver excellent performance, while retaining the moderate memory requirements of the bytecode compiler. The native-code compiler currently runs on the following platforms:

Tier 1 (actively maintained) Tier 2 (maintained when possible)

x86 64 bits

Linux, macOS, Windows, FreeBSD

NetBSD, OpenBSD, OmniOS (Solaris)

ARM 64 bits

Linux, macOS

FreeBSD, OpenBSD, NetBSD

Power 64 bits

Linux (little-endian, ABIv2)

Linux (big-endian, ABIv2)

RISC-V 64 bits

Linux

IBM Z (s390x)

Linux

Other operating systems for the processors above have not been tested, but the compiler may work under other operating systems with little work.

All files marked "Copyright INRIA" in this distribution are Copyright © 1996-2023 Institut National de Recherche en Informatique et en Automatique (INRIA) and distributed under the conditions stated in file LICENSE.

Installation

See the file INSTALL.adoc for installation instructions on machines running Unix, Linux, macOS, WSL and Cygwin. For native Microsoft Windows, see README.win32.adoc.

Documentation

The OCaml manual is distributed in HTML, PDF, and Emacs Info files. It is available at

Availability

The complete OCaml distribution can be accessed at

Keeping in Touch with the Caml Community

There is an active and friendly discussion forum at

The OCaml mailing list is the longest-running forum for OCaml users. You can email it at

You can subscribe and access list archives via the Web interface at

There also exist other mailing lists, chat channels, and various other forums around the internet for getting in touch with the OCaml and ML family language community. These can be accessed at

In particular, the IRC channel #ocaml on Libera has a long history and welcomes questions.

Bug Reports and User Feedback

Please report bugs using the issue tracker at https://github.com/ocaml/ocaml/issues

To be effective, bug reports should include a complete program (preferably small) that exhibits the unexpected behavior, and the configuration you are using (machine type, etc).

For information on contributing to OCaml, see HACKING.adoc and CONTRIBUTING.md.

Separately maintained components

Some libraries and tools which used to be part of the OCaml distribution are now maintained separately and distributed as OPAM packages. Please use the issue trackers at their respective new homes:

Library Removed since OPAM package

The Stream and Genlex standard library modules

OCaml 5.0

camlp-streams

The Graphics library

OCaml 4.09

graphics

The Num library

OCaml 4.06

num

The OCamlbuild tool

OCaml 4.03

ocamlbuild

The camlp4 tool

OCaml 4.02

camlp4

The LablTk library

OCaml 4.02

labltk

The CamlDBM library

OCaml 4.00

dbm

The OCamlWinTop Windows toplevel

OCaml 4.00

none

merlin's People

Contributors

3rafal avatar abbysmal avatar andreypopp avatar antalsz avatar art-w avatar asmanur avatar bcc32 avatar copy avatar ddickstein avatar dra27 avatar gasche avatar gpetiot avatar gsg avatar jonahbeckford avatar khady avatar kit-ty-kate avatar lehy-probayes avatar let-def avatar lpw25 avatar mattiase avatar misterda avatar nojb avatar panglesd avatar purcell avatar rgrinberg avatar trefis avatar ulugbekna avatar voodoos avatar wilfred avatar xvw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

merlin's Issues

emacs: error in timer

Error in timer: (wrong-type-argument integer-or-marker-p nil)
Error in timer: (wrong-type-argument symbolp #)

Under emacs 24.3.50.1 (with auto-complete and using tuareg mode), I get a lot of the aforementioned error messages. Is there anything I can do to turn them off ?

Opam build failure: menhirLib not found

opam install merlin fails with:

./configure --prefix /Users/gbarnett/.opam/system
make
make install
The compilation of merlin.1.0 failed.
Uninstalling merlin.1.0:
make uninstall

==== ERROR [while installing merlin.1.0] ====

opam-version 1.0.0

os darwin

command make

path /Users/gbarnett/.opam/system/build/merlin.1.0

exit-code 2

env-file /Users/gbarnett/.opam/system/build/merlin.1.0/merlin-1872ec.env

stdout-file /Users/gbarnett/.opam/system/build/merlin.1.0/merlin-1872ec.out

stderr-file /Users/gbarnett/.opam/system/build/merlin.1.0/merlin-1872ec.err

stdout

ocamlbuild -Is .,typing,parsing,utils -use-ocamlfind ocamlmerlin.native
/usr/local/bin/ocamlfind ocamlopt -I /usr/local/lib/ocaml/ocamlbuild unix.cmxa /usr/local/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild_config.ml myocamlbuild.ml /usr/local/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
/usr/local/bin/ocamlfind ocamldep -package menhirLib -package yojson -package findlib -modules ocamlmerlin.ml > ocamlmerlin.ml.depends

  • /usr/local/bin/ocamlfind ocamldep -package menhirLib -package yojson -package findlib -modules ocamlmerlin.ml > ocamlmerlin.ml.depends
    ocamlfind: Package `menhirLib' not found
    Command exited with code 2.

    stderr

    make: *** [ocamlmerlin.native] Error 10

Understanding the context of the cursor point

One day merlin should understand the context of the point better. More specifically it should know if:

  1. One is editing a type or an expression.

  2. The local scope of the expression. Offer locally bound variables
    in the expression.

  3. It would also be great it the type at the current point guided
    what expansion results were offered. I'd imagine that one would
    want both -- one sort of expansion that took the type of the point
    into account and one that did not.

Global API search

Consider building a global API search. Merlin has all of the infrastructure required for this. TBD.

C-c C-RET not working with in-term emacs

If I launch emacs with the -nw option (what I most always do), C-c C-RET is not working in Merlin. In fact, the minibuffer displays "C-c RET is undefined".

Thus I'm not sure if it is a merlin-related issue, or something wrong with my terminal (urxvt).
Any hint on why my C-RET is interpreted as a RET ?

Flag to include current directory

Often one wants to refer to ml and mli files from the current directory. Instead of always adding the current directory to the .merlin file, add a flag to merlin such that the current directory is included as a source directory.

compilation fails on openbsd

Fairly minor error in the install target due to a missing -d flag in the OpenBSD install command.

==== ERROR [while installing merlin.1.1] ====
# opam-version    1.0.1 (df84b0565f0709578c581c1dea82246688d2804f)
# os              openbsd
# command         gmake install
# path            /tmp/ocamlot/ocamlot.work.2013-06-25.74/opam-install/system/build/merlin.1.1
# compiler        system (4.01.0)
# exit-code       2
# env-file        /tmp/ocamlot/ocamlot.work.2013-06-25.74/opam-install/system/build/merlin.1.1/merlin-11568-d4902a.env
# stdout-file     /tmp/ocamlot/ocamlot.work.2013-06-25.74/opam-install/system/build/merlin.1.1/merlin-11568-d4902a.out
# stderr-file     /tmp/ocamlot/ocamlot.work.2013-06-25.74/opam-install/system/build/merlin.1.1/merlin-11568-d4902a.err
### stdout ###
ocamlbuild -Is src,src/typing,src/parsing,src/utils -use-ocamlfind ocamlmerlin.native
install -dv /tmp/ocamlot/ocamlot.work.2013-06-25.74/opam-install/system/bin
### stderr ###
install: unknown option -- v
usage: install [-bCcdpSs] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner]
           source ... target ...
gmake: *** [install] Error 64

'opam install --verbose --yes merlin.1.1' failed.

OCAMLOT After 814.23s Opam_task.run "opam install --verbose --yes merlin.1.1" failed (4) in 334.80s

[emacs] merlin-to-point should send more input to avoid false errors

The behavior of merlin-to-point is not consistent with what most users expect from experience with ProofGeneral, CoqIde, or even Caml Light or Ocaml toplevel GUIs with a "send command" option. Consider the given code:

let id (*POINT*) x = x

If I put my cursor on the comment and call C-x C-Enter, Merlin will send "let id" to the parser, resulting in a "Parse Error" that is very confusing. The behavior I expect is to send the whole phrase and succeed.

How much exactly should Merlin send? Consider the following input:

module M = struct
  let id (* POINT *) x =
    x
  let foo x = x
end

The behavior of tuareg-eval-phrase, which would be the Tuareg equivalent, is to send the smallest enclosing phrase/structure item to the toplevel, here let id x = x. The behavior of Proof General would be to send the smallest correct prefix of the whole buffer at or after the point, that is module M = struct let id x = x.

Note that merlin-check-synchronize, that is run at idle times, has a heuristic to send the whole line rather than just upto the point (it behaves much better than merlin-to-point for one-liner phrases). I intentionally defeated it here by splitting id in two lines.

The behavior I expect is ProofGeneral's one: send the shortest prefix at or after the point that the incremental parser and type-checker can manage.

N.B.: familiarity with the ProofGeneral (or CoqIde) interface is an excellent way to feel immediately familiar with Merlin's mode of action. If I want to pitch Merlin to people, I just say "it's ProofGeneral for OCaml", and they are interested. When in doubt over how an interface action should behave, I would suggest to follow that similarity and imitate its behavior.

completion for record fields

Simple example :

type t = { x : int ; y : char }

let get_x (a : t) = a.<tab>

I would love to have x and y proposed.

Merlin refuses to refresh a module sometimes

I understand that this bug report is a little vague and hence not very useful but merlin sometimes gets into this state where it won't reload changes I've made to a particular module even though my code will compile cleanly. I.e. it will not:

  • Suggest new functions added to a module past the stage when it gets stuck
  • Will not pass the syntax check for my code (complaining about missing functions from that module)

Doing a clean rebuild of the project does not help this either. The only thing that helps is restarting vim.

I have absolutely no clue how to reproduce this reliably or what the problem could be but a :MerlinReload command that would restart the ocamlmerlin process would be a welcome addition.

Again I'm sorry for the useless bug report...

Showing documentation comments

Can you scrape off the documentation comments that precede most function definitions in mli files and show these in some way -- maybe as a help tooltip.

Paths in .merlin file

Any path that goes higher than .., for example ../../bin, is misunderstood by merlin. The ..s are skipped and the path is appended to the current path. This is a real problem because merlin only goes up 2 directories to find the .merlin file. In a deep directory structure, ocamlbuild will place all the built files in a completely different hierarchy.

Ideally, one would also be able to set how high up in the tree merlin should look for the .merlin file. Still, the ../../ parsing issue should be fixed.

vimbufsync cannot be installed

Running make install gives:

cp -R vim/merlin/* /usr/local/share/ocamlmerlin/vim/
cp -R vim/vimbufsync/* /usr/local/share/ocamlmerlin/vimbufsync/
cp: cannot stat ‘vim/vimbufsync/*’: No such file or directory

Also running submodule_sync.sh doesn't do anything.

EDIT: nvm had a dirty repository for some reason, ignore :)

Syntax check dies on camlp4 quotes

I realize that that parsing camlp4 is way beyond the scope of the project but it would be nice if the syntax check failed on camlp4 a little more gracefully. For example if you use sexplib you often do something like: <:sexp_of< exn * _ t >> to get the sexp of an exception. Would be nice if this wasn't a syntax error. Maybe treat the p4 quotes like wild cards. Like failwith "" for example.

In emacs, .merlin is read per buffer

When resuming an emacs session, it takes about a second for each .merlin file to be loaded, and this happens for every file in my project. Is there a way to avoid duplicating this work and/or speed up .merlin parsing?

[emacs] Don't override `ac-sources`

How about just add merlin-ac-source to ac-sources, instead of overriding using setq? My personal sources is ruined after loading merlin-mode.

diff --git a/emacs/merlin.el b/emacs/merlin.el
index b007f8a..a9212b1 100644
--- a/emacs/merlin.el
+++ b/emacs/merlin.el
@@ -743,7 +743,8 @@ it will print types of bigger expressions around point (it will go up the ast).
   (progn
     (merlin-start-process)
     (when (featurep 'auto-complete)
-      (auto-complete-mode))
+      (auto-complete-mode)
+      (add-to-list 'ac-sources 'merlin-ac-source))
     (set (make-local-variable 'merlin-lock-point) (point-min))
     (set (make-local-variable 'merlin-buffer) nil)
     (set (make-local-variable 'merlin-result) nil)
@@ -761,7 +762,6 @@ it will print types of bigger expressions around point (it will go up the ast).
     (set (make-local-variable 'merlin-enclosing-types) nil)
     (set (make-local-variable 'merlin-enclosing-offset) nil)
     (set (make-local-variable 'merlin-last-point-type) nil)
-    (setq ac-sources '(merlin-ac-source))
     (add-to-list 'after-change-functions 'merlin-edit)
     (set-process-query-on-exit-flag (merlin-get-process) nil)
     (merlin-parse)

Support for future OCaml versions (4.01+dev for now)

Given that Merlin currently reuses and modifies part of the OCaml implementation, it is not portable across different OCaml versions. In particular, Merlin currently does not support the development version of OCaml, presently named 4.01.0+dev (in prevision for a 4.01 release in the short- to medium-term).

After the release, several different OCaml versions will be used by Merlin users, and it would be interesting to consider the implications of this in advance, instead of lagging behind a release.

  • what can go wrong if one uses 4.00-merlin with 4.01+dev?
  • what's the amount of work involved in producing a 4.01-merlin?
  • what can go wrong if one used 4.01-merlin with 4.00 source code?
  • could we have mechanisms to detect incompatible-versions situations and report them cleanly to the users, instead of just going wrong?
  • can Merlin support several versions of OCaml?

I would be personally interested in these questions (regularly having to work in an environment using development versions of OCaml), and I think they should be documented for all users in prevision for the next release.

Given the strong backward-compatibility requirements that the OCaml language imposes upon itself, I believe it should be possibly to always use the parser and type-checker of the most recent OCaml release, even for users working on code intended for older versions. Library support is however a very different question.

(PS: I categorizes this as both a "bug" and an "enhancement", because while extending Merlin to support 4.01 is a feature, the way Merlin may degrade when used on non-intended versions of OCaml is likely to be considered a bug by users.)

Specify license, make original ocaml code explicit

I am thinking of MIT license. However now that I am not the only author, your advice and opinions are welcome :).

Also, it would be really nice to clarify license of original Ocaml code and satisfy QPL2 requirements. What should be done in this respect ?

Different behavior from various completion modes

Often auto-complete provided by the auto-complete-mode and completion-at-point (which I think ships with emacs) behave differently. i.e. one refuses to show completion results while the other does.

It is unclear why this and is hard to reproduce. One possibility is that this maybe do the fact that different modes are sending different queries to merlin. It would be good to have debug information displayed such that one can understand why completion-at-point and auto-complete behave differently.

This sort of information might also help towards building a better auto-complete mode one day that is more customized for merlin.

emacs: location of .merlin file

The documentation in the README says that the .merlin file can be in a parent directory but apparently the emacs mode only looks for it in the current directory.

Here's a patch that attempts to address this (a bit clumsily perhaps).

--- merlin.el.orig  2013-04-03 16:10:10.689107540 +0200
+++ merlin.el   2013-04-03 12:03:03.766380582 +0200
@@ -662,8 +662,10 @@
           ))))

 ;; .merlin parsing
-(defun merlin-add-path (kind dir)
+(defun merlin-add-path (kind dir dirname)
   "Adds an item to a path in merlin"
+  (if (and dirname (not (file-name-absolute-p dir)))
+      (setq dir (concat dirname dir)))
   (merlin-send-command "path" (list "add" kind dir)))

 (defun merlin-get-packages ()
@@ -676,26 +678,32 @@
    (list (completing-read "Package to use:" (merlin-get-packages))))
   (merlin-send-command "find" (list "use" pkg)))

-(defun merlin-handle-line (buffer words)
+(defun merlin-handle-line (buffer words dirname)
   "Handles a line in a .merlin file"
   (with-current-buffer buffer
     (cond
-     ((string-equal (elt words 0) "S") (merlin-add-path "source" (elt words 1)))
-     ((string-equal (elt words 0) "B") (merlin-add-path "build" (elt words 1)))
+     ((string-equal (elt words 0) "S") (merlin-add-path "source" (elt words 1) dirname))
+     ((string-equal (elt words 0) "B") (merlin-add-path "build" (elt words 1) dirname))
      ((string-equal (elt words 0) "PKG") (merlin-use (elt words 1))))))
+(defun merlin-file-parse (fname)
+  "Parses a .merlin"
+  (message "Parsing %s" fname)
+  (setq lines nil)
+  (setq buf (current-buffer))
+  (let ((dirname (file-name-directory fname)))
+    (with-current-buffer (find-file fname)
+      (goto-char (point-min))
+      (while (not (eq (point) (point-max)))
+        (let ((words (split-string (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
+          (merlin-handle-line buf words dirname)
+          (forward-line))))
+    (switch-to-buffer buf)))
 (defun merlin-parse ()
   "Parses a .merlin"
-  (if (file-exists-p ".merlin")
-      (progn
-   (setq lines nil)
-   (setq buf (current-buffer))
-   (with-current-buffer (find-file ".merlin")
-     (goto-char (point-min))
-     (while (not (eq (point) (point-max)))
-       (let ((words (split-string (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
-         (merlin-handle-line buf words)
-         (forward-line))))
-   (switch-to-buffer buf))))
+  (cond
+   ((file-exists-p ".merlin")       (merlin-file-parse ".merlin"))
+   ((file-exists-p "../.merlin")    (merlin-file-parse "../.merlin"))
+   ((file-exists-p "../../.merlin") (merlin-file-parse "../../.merlin"))))

 ;; Idle 
 (defun merlin-idle-hook ()

Filter on types in the emacs mode

In the emacs mode, currently filtering the dropdown only works for filtering on the identifier. Filtering on the identifier is the right default, but it would be nice if one could filter on the type also.

incorrect imports in packed modules

If I have a subdirectory Bar/ with files a.ml and b.ml, that are to be packed into Bar.A and Bar.B, and B tries to use values from A, merlin fails to find A. Here is an archive which should demonstrate it:

$ cd test/
$ ocamlbuild foo.native
... ok...
$ vim bar/b.ml
[ask for the type of A.f returns an error]

Sigs show up as modules.

It would be nice to see what is inside a sig such as a Floatable. Similarly it would be nice to see what is produced by a functor.

Better understanding of camlp4 extensions

merlin needs to understand camlp4 extensions. For instance, things fail in the presence of units tests where we have a "TEST =" syntax provided by pa_ounit. Soon we will have simialr extensions for micro-benchmarks.

For now, maybe one can hack in the commonly used syntax extensions. In the long term we need a better solution for this.

merlin type checks bad code with syntastic

Enter the following code in a buffer and a top level:

module type Foo = sig 
  type t
  val do_with_t : t -> unit
end

let any_foo t (module F : Foo) = F.do_with_t t <-- make sure no new line but end of file

Observe that the top level rejects this but merlin accepts this (at least in vim) ONLY IF there is no new line at the end of the offending statement. It's likely that it's possible to reproduce this bug with another example as well.

Vim question

Hi,

I installed merlin, neocomplcache.

Merlin works in the sense that the Type* commands work.
However the type does not appear in the completions. What may have I forgotten ?

Thanks in advance!

Various cleanups and support for completion-at-point

I recommend you try to byte-compile your file (especially with a recent enough Emacs), it will give you various warnings that are worth fixing. You can also use C-u M-x checkdoc-current-buffer to get some style recommendations (not to be obeyed blindly, but still worthwhile).

I have a patch which fixes most of those issues and adds preliminary support for completion-at-point-functions, contact me via email [email protected] if you're interested.

emacs: errors about auto-complete

I do not have the auto-complete package and merlin.el complains a bit:

--- /home/oandrieu/Downloads/merlin.el  2013-02-21 11:16:47.391076941 +0100
+++ /home/oandrieu/.opam/system/share/emacs/site-lisp/merlin.el 2013-02-21 11:09:54.597652168 +0100
@@ -419,7 +419,8 @@
     (requires . 3)
     ))

-(ac-define-source "merlin" merlin-ac-source)
+(when (featurep 'auto-complete)
+  (ac-define-source "merlin" merlin-ac-source))

 ;; Get the type of an element"
 (defun merlin-trim (s)
@@ -584,7 +585,8 @@
   (interactive)
   (progn
     (merlin-start-process)
-    (auto-complete-mode)
+    (when (featurep 'auto-complete)
+      (auto-complete-mode))
     (set (make-local-variable 'merlin-lock-point) (point-min))
     (set (make-local-variable 'merlin-buffer) nil)
     (set (make-local-variable 'merlin-result) nil)

Broken pipe

Merlin's pipe seems to get broken sometimes in vim. Specifically, if I run a command and then use Ctrl-C, that seems to mess up the plugin's state, and there's no way to get it back unless I restart vim.

Example to reproduce:
:!man ls
Press Ctrl-C
q (enter)
:e

Merlin should now complain about a broken pipe.

Merlin 1.0.0 under emacs errors

contents of Messages as follows

Parsing .merlin file /home/thelema/tcam/.merlin
File mode specification error: (wrong-type-argument number-or-marker-p nil)
Toggling auto-complete-mode off; better pass an explicit argument.
Parsing .merlin file /home/thelema/tcam/.merlin
if: Wrong type argument: number-or-marker-p, nil

The result seems to be that I get no contextual completion, just any string it can find with the same prefix.

[emacs] feature: have merlin-show-type-at-point pick enclosing expressions, not just identifiers

caml-mode's caml-types-show-type (code here) picks the smallest expression around the point, rather than only supporting identifiers, and uses an overlay to make it visually clear of which subexpression the type is being displayed. In the example:

let test = (List.length [])

I expect C-c C-t to work when called on the leftmost parenthesis (highlight the expression and return "int") and on either braces of the empty list (highlight [] and return '_a list).

The larger point is that I expect merlin's C-c C-t to have the same feature set than caml-mode's C-c C-t command, because I don't want as an user to have to remember which one to use depending on whether I'm doing incremental checking or reading an -annot-compiled source file. I understand that some features may be painful to implement just from the typer output (eg. handling of weak polymoprhic variables as demonstrated with the empty list here), but at least the best-subexpression logic could be reused.

More information in the dropdown.

Again this applies to using merlin via auto-complete-mode in emacs.

If the dropdown cannot show the whole type in the case of long types (auto complete of Async.Pipe as an example), one could have the type show up in the command buffer below. One could also show the whole type in a help tooltip. I believe auto-complete-mode has some support for help tooltips.

Unclosed comment

Lexer doesn't report unclosed / unterminated string and comments.

merlin-locate often fails.

I am adding this issue just for tracking. This is a bug that I have shown to Thomas a few times.

One can ask merlin to auto-complete something following which if one were to ask merlin to jump to the location of the completed thing, it is unable to do so. It is unclear why it is unable to do that.

Have some debug information or error message such that one is able to do that. One approach to doing this is to have better debug information printed out into the debug file when MERLIN_LOG is enabled.

autocomplete very slows, keeps setting the mark

When I try to autocomplete, it takes several seconds between the moment I choose a completion and the moment it is inserted. During that time, the minibuffer keeps flashing with messages. Here is what they are:

point: 373 start! 373
Mark set [2 times]
point: 387 start! 373
Mark set [2 times]
point: 396 start! 396
Mark set [2 times]
point: 395 start! 395
Mark set [2 times]
point: 394 start! 394
Mark set [2 times]
point: 393 start! 393
Mark set [2 times]
point: 392 start! 392
Mark set [2 times]
point: 391 start! 391
Mark set [2 times]
point: 390 start! 390
Mark set [2 times]
point: 389 start! 389
Mark set [2 times]
point: 388 start! 388
Mark set [4 times]

I'm using the opam installed version of Merlin.

Formatting misaligned dropdowns.

When using merlin with auto-complete-mode in emacs, the dropdowns are often broken.

One way to fix the problem may be to have a configuarble lenght variable set in merlin mode. Subsequently merlin will should not send completion candidates that are longer that than the specified length.

Errors in .mli files

The parser does not recognize that the file is a .mli, so it signals lots of errors that are in fact correct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.