ocaml / ocaml-lsp

OCaml Language Server Protocol implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"uncaught exception" in vscode dev console

ulugbekna opened this issue · comments

Description

When opening semantic_highlighting.ml with current master (7e444e1), I get the following error in vscode dev console:

  ERR uncaught exception: Error: uncaught exception
    at handleResponse (/Users/ulugbekna/.vscode-insiders/extensions/ocamllabs.ocaml-platform-1.13.1/node_modules/vscode-jsonrpc/lib/common/connection.js:565:48)
    at handleMessage (/Users/ulugbekna/.vscode-insiders/extensions/ocamllabs.ocaml-platform-1.13.1/node_modules/vscode-jsonrpc/lib/common/connection.js:345:13)
    at processMessageQueue (/Users/ulugbekna/.vscode-insiders/extensions/ocamllabs.ocaml-platform-1.13.1/node_modules/vscode-jsonrpc/lib/common/connection.js:362:17)
    at Immediate.<anonymous> (/Users/ulugbekna/.vscode-insiders/extensions/ocamllabs.ocaml-platform-1.13.1/node_modules/vscode-jsonrpc/lib/common/connection.js:334:13)
    at processImmediate (node:internal/timers:476:21)

Turns out it comes from jsonrpc-fiber (https://insiders.vscode.dev/github/ocaml/ocaml-lsp/blob/master/jsonrpc-fiber/src/jsonrpc_fiber.ml#L110). The stack trace extracted from the data of the exception thrown:

Raised at Stdlib.invalid_arg in file \"stdlib.ml\", line 30, characters 20-45
Called from Stdlib__List.combine in file \"list.ml\", line 305, characters 36-49
Called from Merlin_specific__Browse_raw.of_expression_desc in file \"src/ocaml/merlin_specific/browse_raw.ml\", line 385, characters 23-54
Called from Merlin_specific__Browse_raw.fold_node in file \"src/ocaml/merlin_specific/browse_raw.ml\" (inlined), line 691, characters 2-24
Called from Merlin_kernel__Mbrowse.fold_node in file \"src/kernel/mbrowse.ml\", line 53, characters 2-34
Called from CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 31, characters 17-27
Re-raised at CamlinternalLazy.force_lazy_block in file \"camlinternalLazy.ml\", line 36, characters 4-11
Called from Merlin_analysis__Browse_tree.all_occurrences.aux in file \"src/analysis/browse_tree.ml\", line 118, characters 36-61
Called from Stdlib__List.fold_left in file \"list.ml\", line 121, characters 24-34
Called from Stdlib__List.fold_left in file \"list.ml\", line 121, characters 24-34
Called from Stdlib__List.fold_left in file \"list.ml\", line 121, characters 24-34
Called from Stdlib__List.fold_left in file \"list.ml\", line 121, characters 24-34
Called from Stdlib__List.fold_left in file \"list.ml\", line 121, characters 24-34
Called from Query_commands.dispatch.ident_occurrence in file \"src/frontend/query_commands.ml\", line 823, characters 17-53
Called from Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line 693, characters 8-12
Re-raised at Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line 695, characters 30-39
Called from Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line 45, characters 8-15
Re-raised at Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line 62, characters 10-24

Looks like a merlin bug? cc @voodoos

commented

This is most probably a duplicate of #1182.
Could you check that pinning https://github.com/voodoos/merlin.git#letop-tuples-issue-1683 fixes the issue for OCaml 4.14 ?