Skip to content

Commit

Permalink
feat(folding range): support include (#730)
Browse files Browse the repository at this point in the history
example:

```ocaml
include struct
  let u = ()
end
```

Co-authored-by: Ulugbek <[email protected]>
  • Loading branch information
ulugbekna and Ulugbek authored Jun 21, 2022
1 parent 916713c commit f780ac3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ocaml-lsp-server/src/folding_range.ml
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,11 @@ let fold_over_parsetree (parsetree : Mreader.parsetree) =
| Pstr_extension _ ->
Range.of_loc structure_item.pstr_loc |> push;
Ast_iterator.default_iterator.structure_item self structure_item
| Pstr_primitive _ | Pstr_exception _ | Pstr_include _ | Pstr_attribute _
-> ()
| Pstr_include { pincl_loc; pincl_mod; pincl_attributes } ->
push @@ Range.of_loc pincl_loc;
self.module_expr self pincl_mod;
self.attributes self pincl_attributes
| Pstr_primitive _ | Pstr_exception _ | Pstr_attribute _ -> ()
in

{ Ast_iterator.default_iterator with
Expand Down

0 comments on commit f780ac3

Please sign in to comment.