Thicket thicket
cambridge
REPOS 4

Projects covers Forester, Merry, xdge and ocaml-crockford.

W35.2026 · 24–30 Aug / Issue

Assertion in Document_symbols.compute is triggered

tangled · jonmsterling.com/ocaml-forester · did:plc:jjiv56ot7d6sgethto3jr3r5

I have been working on a Visual Studio Code language client for Forester, and it is actually triggering this assertion:

let compute ({textDocument = {uri; _}; _} : L.DocumentSymbolParams.t) :
    [> `DocumentSymbol of L.DocumentSymbol.t list] option =
  let Lsp_state.{forest; _} = Lsp_state.get () in
  let uri = URI.of_lsp_uri ~base:forest.config.url uri in
  match State.get_code ~forest uri with
  | None -> assert false

It was extremely difficult to detect that this was happening, because I don't yet have a good way to debug forester while the language server is running.

Comments

did:plc:4gj3ihsdh6fn3aqq5bdnw5w3

I really need to improve the logging output for the lsp...


did:plc:jjiv56ot7d6sgethto3jr3r5

For debugging, it would be really nice if we could make it just go to a file or something... Every editor has a different way of dealing with the logs, and it's really hard to get everything to line up perfectly.


did:plc:4gj3ihsdh6fn3aqq5bdnw5w3

https://tangled.org/jonmsterling.com/ocaml-forester/commit/e075618c151ff7e96fb959fc0191933beb19bb61


did:plc:jjiv56ot7d6sgethto3jr3r5

Heh :) Glad it was that simple.


did:plc:4gj3ihsdh6fn3aqq5bdnw5w3

;)