Skip to content

Commit f780ac3

Browse files
ulugbeknaUlugbek
andauthored
feat(folding range): support include (#730)
example: ```ocaml include struct let u = () end ``` Co-authored-by: Ulugbek <[email protected]>
1 parent 916713c commit f780ac3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ocaml-lsp-server/src/folding_range.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,11 @@ let fold_over_parsetree (parsetree : Mreader.parsetree) =
256256
| Pstr_extension _ ->
257257
Range.of_loc structure_item.pstr_loc |> push;
258258
Ast_iterator.default_iterator.structure_item self structure_item
259-
| Pstr_primitive _ | Pstr_exception _ | Pstr_include _ | Pstr_attribute _
260-
-> ()
259+
| Pstr_include { pincl_loc; pincl_mod; pincl_attributes } ->
260+
push @@ Range.of_loc pincl_loc;
261+
self.module_expr self pincl_mod;
262+
self.attributes self pincl_attributes
263+
| Pstr_primitive _ | Pstr_exception _ | Pstr_attribute _ -> ()
261264
in
262265

263266
{ Ast_iterator.default_iterator with

0 commit comments

Comments
 (0)