forked from ocaml/merlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ocaml#1773 from voodoos/get-doc-of-decl
Use the new uid_to_decl table in 5.2 to locate doc
- Loading branch information
Showing
4 changed files
with
181 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
$ cat >main.mli <<'EOF' | ||
> (** A great module *) | ||
> | ||
> val x : int | ||
> (** The only answer *) | ||
> EOF | ||
|
||
$ cat >main.ml <<'EOF' | ||
> let x = 42 | ||
> let _ = x | ||
> EOF | ||
|
||
$ cat >lib.ml <<'EOF' | ||
> let _ = Main.x | ||
> EOF | ||
|
||
$ cat >.merlin << 'EOF' | ||
> B . | ||
> S . | ||
> EOF | ||
$ $OCAMLC -c -bin-annot main.mli main.ml lib.ml | ||
|
||
$ ls | ||
lib.cmi | ||
lib.cmo | ||
lib.cmt | ||
lib.ml | ||
main.cmi | ||
main.cmo | ||
main.cmt | ||
main.cmti | ||
main.ml | ||
main.mli | ||
|
||
FIXME: Querying for doc from the implementation for values defined in the | ||
current compilation unit does not work because merlin cannot link the | ||
declarations coming from the mli and the ml file: | ||
$ $MERLIN single document -position 1:4 -filename main.ml < main.ml | ||
{ | ||
"class": "return", | ||
"value": "No documentation available", | ||
"notifications": [] | ||
} | ||
|
||
$ $MERLIN single document -position 2:8 -filename main.ml < main.ml | ||
{ | ||
"class": "return", | ||
"value": "No documentation available", | ||
"notifications": [] | ||
} | ||
|
||
Querying from the mli itself work as expected, but is not very useful: | ||
$ $MERLIN single document -position 3:4 -filename main.mli < main.mli | ||
{ | ||
"class": "return", | ||
"value": "The only answer", | ||
"notifications": [] | ||
} | ||
|
||
Querying from another unit work as expected: | ||
$ $MERLIN single document -position 1:13 -filename lib.ml < lib.ml | ||
{ | ||
"class": "return", | ||
"value": "The only answer", | ||
"notifications": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters