A json-object of the form:
position = {"line":int, "col":int}
A json-object having at least the fields:
location <= {"start":position,"end":position}
Strings addressing file system objects:
path = string, points any file or directory
directory = string, expected to name a directory
filename = string, expected to name a regular file
Use ['tell','struct','...ocaml impl...'] to send source code from editor to merlin. The command answers the boolean 'true' if parsing ended, 'false' if it needs more input. In this case, the only allowed command is ['tell','struct','next source content']. To interrupt the parser, run ['tell','struct',''] (meaning eof) or ['tell','struct',null].
Send a chunk of ml source code. Merlin will wait for the rest of the input.
Same as above, but tell merlin that you want to stop as soon as possible. Merlin will stop waiting for input once the current definition is complete.
Notify merlin that EOF has been reached.
Same as ["tell","struct",null]
All seek functions return the position of Merlin virtual cursor after their execution, as a position object.
Return the current position of the cursor.
Move cursor just before the definition around specified position.
Move cursor to the position that has been given, or just after if this is in the middle of an ml definition.
Put cursor at the end of file.
Move cursor down until the current scope is escaped (usually when encountering an "end" of structure).
Clear content of virtual buffer.
Clear content of virtual buffer and set its name. This is used to report more informative error messages (the same the compiler would report for a file with the given path).
Reload all dependencies and try to retype the current file.
Try to detect dependencies that have changed and reload them. If needed, retype current file.
Returns the type of an expression as a string. ['type','expression','... ml expression'] tries to type expression in global env. ['type','at',{'line':l,'col':c}] returns the type of the expression at given position(BUGGY)
['complete','prefix','...identifier path...'] or ['complete','prefix','...identifier path...', 'at', {'line':l,'col':c}] returns possible completions in global environement or in environment surrounding given position for given prefix/path (path of the form: Module.ident)
['locate', ident] returns the position where this identifier is introduced.
Answers are of this shape :
- "Not found" (string)
- ["file": string , "pos": { "line" : int , "col": int }]
Return the boundary of the phrase before, at, or after the cursor.
Return the boundary of the phrase before, at, or after the given position.
var = string
List known path variables. As of today (07/2013), there is "build" and "source".
List content of variable.
Add a path to a variable.
Remove a path from a variable.
Reset all variables to default content (usually, ocaml std lib path).
Reset specified variable to its default value.
Loading of ".merlin" files.
Parse and load given filename as a ".merlin". Returns the list of files that have been loaded (as a ".merlin" can depend on another one that will be loaded recursively).
Try to find a file named ".merlin" in any directory from given path to "/", then behave as ["project","load"].with this file.
List known commands