nvim-treesitter-textobjects icon indicating copy to clipboard operation
nvim-treesitter-textobjects copied to clipboard

feat(ocaml): include "in" keyword in function.outer

Open beajeanm opened this issue 1 month ago • 4 comments

Make sure the fonction.outer includes the in keyword in, e.g.:

let f x = let g y = 1 in f (g 2) ^_____________^

beajeanm avatar Dec 04 '25 10:12 beajeanm

make-range is removed in main

kiyoon avatar Dec 06 '25 08:12 kiyoon

@kiyoon Where can I read about the removal and the alternative to make-range? Thanks.

beajeanm avatar Dec 10 '25 16:12 beajeanm

The reason #make-range was necessary was due to the lack of support for quantified captures in previous neovim (#612). I'm not experienced in ocaml thus I don't understand what you're trying to achieve, but most likely the important parts should be supported by the language parser.

kiyoon avatar Dec 11 '25 00:12 kiyoon

Hmmm, ok, I'll see if I can figure it out.

I'm not experienced in ocaml thus I don't understand what you're trying to achieve

OCaml has top level and nested declaration, the nested ones are terminated by the in keyword. I was trying to include in in the function.outer group. As you can see in the screenshot below "in" is not part of the value_definition node, so I was using make-range to work around that and capture both the cases with "in" and the case without "in".

Screenshot 2025-12-11 at 11 36 35

beajeanm avatar Dec 11 '25 11:12 beajeanm