Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server crashes when handling "workspace/symbol": uncaught exception #1860

Open
kentookura opened this issue Oct 28, 2024 · 4 comments
Open

Comments

@kentookura
Copy link

kentookura commented Oct 28, 2024

When the neovim client executes the "workspace/symbol" request, I get the following error:

Error executing 'workspace/symbol': RPC[Error] code_name = InternalError, message = "uncaught exception", data = {
backtrace = 'Raised at Ocaml_typing__Cmt_format.read.(fun) in file "src/ocaml/typing/cmt_format.ml", line 430, characters 11-69
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
Called from Ocaml_typing__Cmt_format.read_cmt in file "src/ocaml/typing/cmt_format.ml", line 436, characters 8-21
Called from Ocaml_lsp_server__Workspace_symbol.symbols_from_cm_file in file "ocaml-lsp-server/src/workspace_symbol.ml", line 252, characters 43-71
Called from Stdune__List.rev_concat_map.aux in file "otherlibs/stdune/src/list.ml", line 54, characters 15-18
Called from Stdune__List.concat_map in file "otherlibs/stdune/src/list.ml" (inlined), line 60, characters 26-47
Called from Ocaml_lsp_server__ Workspace_symbol.run.(fun) in file "ocaml-lsp-server/src/workspace_symbol.ml", line 323, characters 9-79
Called from Stdune__Result.map in file "otherlibs/stdune/src/result.ml", line 45, characters 15-20
Called from Stdlib__List.rev_map.rmap_f in file "list.ml", line 105, charact ers 22-25
Called from Stdune__List.map in file "otherlibs/stdune/src/list.ml" (inlined), line 5, characters 19-33
Called from Ocaml_lsp_server__Workspace_symbol.run in file "ocaml-lsp-server/src/workspace_symbol.ml", lines 315-323, characters 6-81
Called from Stdune__Exn_with_ba cktrace.try_with in file "otherlibs/stdune/src/exn_with_backtrace.ml", line 9, characters 8-12
Re-raised at Stdune__Exn.raise_with_backtrace in file "otherlibs/stdune/src/exn.ml" (inlined), line 38, characters 27-56
Called from Stdune__Exn_with_backtrace.reraise in file "otherlib s/stdune/src/exn_with_backtrace.ml", line 20, characters 33-71
Called from Fiber__Scheduler.exec in file "fiber/src/scheduler.ml", line 73, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file "otherlibs/stdune/src/exn.ml" (inlined), line 38, characters 27-56
Ca lled from Stdune__Exn_with_backtrace.reraise in file "otherlibs/stdune/src/exn_with_backtrace.ml", line 20, characters 33-71
Called from Fiber__Scheduler.exec in file "fiber/src/scheduler.ml", line 73, characters 8-11
}

Neovim version: NVIM v0.11.0-nightly+3689082
ocamllsp version: 1.19.0
OS: NixOS 24.11.20241009.5633bcf (Vicuna)

@voodoos
Copy link
Collaborator

voodoos commented Oct 28, 2024

This looks like there is a mismatch between the version of the OCaml compiler you used to build your project and the version of OCaml you used to build ocaml-lsp-server. You can try to clean and rebuild the project or make sure you have ocaml-lsp installed in the same switch you are using to build the project.

The error message is very bad however, and should be improved, I will move that issue to the Merlin repository.

@kentookura
Copy link
Author

Thanks for the hint. I am actually using opam-nix, I will need to see how this can be done.

@voodoos
Copy link
Collaborator

voodoos commented Oct 28, 2024

@kentookura you might find interesting information in that thread: https://discuss.ocaml.org/t/using-ocaml-lsp-server-with-opam-switches-in-neovim/14428/1 (I didn't read it)

@kentookura
Copy link
Author

Thanks, but it seems that this is a very strange bug in opam-nix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants