Khady / merlin-eldoc

Type and doc on hover for OCaml and Reason in emacs
GNU General Public License v3.0
43 stars 3 forks source link

Eldoc error with 'raise Exception' #27

Closed Fourchaux closed 6 years ago

Fourchaux commented 6 years ago

Config: merlin-eldoc 20180816.456 Melpa OCaml 4.07.0+flambda - Merlin-master - Emacs 27.0.50 - Linux x86_64

Not sure where the problem comes from, but with:

exception PinPon ;;
raise PinPon ;;

Cursor on the 1st 'PinPon': OK (type exn = ..)

Cursor on the 2nd 'PinPon' displays:

eldoc error: (error unknown answer: "exception":"File \"src/analysis/browse_tree.ml\", line 87, characters 15-21: Assertion failed
Raised at file \"src/analysis/browse_tree.ml\", line 87, characters 15-27
Called from file \"src/analysis/browse_tree.ml\", line 92, characters 12-23
Called from file \"src/analysis/browse_tree.ml\", line 114, characters 21-59
Called from file \"list.ml\", line 117, characters 24-34
Called from file \"list.ml\", line 117, characters 24-34
Called from file \"list.ml\", line 117, characters 24-34
Called from file \"src/frontend/query_commands.ml\", line 709, characters 15-68
Called from file \"src/frontend/query_commands.ml\", line 715, characters 18-55
Called from file \"src/utils/local_store.ml\", line 29, characters 8-12
Re-raised at file \"src/utils/local_store.ml\", line 37, characters 4-15
Called from file \"src/kernel/mocaml.ml\", line 40, characters 8-38
Re-raised at file \"src/kernel/mocaml.ml\", line 48, characters 4-15
Called from file \"src/frontend/new/new_commands.ml\", line 64, characters 15-53
Called from file \"src/utils/std.ml\", line 654, characters 8-12
Re-raised at file \"src/utils/std.ml\", line 656, characters 30-39
Called from file \"src/ocaml/utils/misc.ml\", line 30, characters 20-27
Re-raised at file \"src/ocaml/utils/misc.ml\", line 30, characters 50-57
Called from file \"src/frontend/new/new_merlin.ml\", line 97, characters 18-54
")

Note: running ''merlin-type-enclosing' on the 2 PinPon is OK.

Khady commented 6 years ago

Thanks for the report.

The problem seems to come from the merlin-occurrences command. With the cursor on the 2nd 'PinPon', running M-x merlin-occurrences gives the same stacktrace.

Can you confirm? If yes, then I think the issue should be moved to merlin's repo. I can do it if you don't have time.

Khady commented 6 years ago

I will add some error handling so that this kind of crash doesn't affect other features like type display.

Fourchaux commented 6 years ago

I confirm the 'merlin-occurrences' pb. Thank you.

Issue open on Merlin's repo: https://github.com/ocaml/merlin/issues/853

Wait and See ...