Skip to content

Folding is slightly off with ocamllsp #14

@thibautbenjamin

Description

@thibautbenjamin

I am using emacs to code in OCaml, using lsp-mode and the ocamllsp server. I have just tried adding lsp-origami to my setup, and I really like its capabilities, however, I find that the decisions it takes when it comes to folding are a little questionable. The folding looks almost right, except is also folds the header of every block, and as a result I can't see the blocks at all, except for the indicator that there is something to unfold at this place.

I don't know wether this is the fault of the LSP itself, or of lsp-origami making assumptions about the language. I believe that this bevavior possible to fix (maybe with a customizable variable controlling some adjustments of the LSP answer), but I do not know enough elisp to do this myself.

Here is a picture of the behavior I am describing, where you can see that after folding, only the comments are still active
folded
unfolded
Here is what I would expect the folding to look like in this example

(* This is a demo *)

(* First say hello *)
let hello = ...

(* This function is more complicated *)
let complicated_function x y = ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions