File tree Expand file tree Collapse file tree 2 files changed +33
-6
lines changed
Expand file tree Collapse file tree 2 files changed +33
-6
lines changed Original file line number Diff line number Diff line change 11(* *
2- * Copyright (C) 2021 Yuxiang Wen
3- *
2+ msg *
43 * This program is free software: you can redistribute it and/or modify
54 * it under the terms of the GNU Affero General Public License as
65 * published by the Free Software Foundation, either version 3 of the
@@ -50,15 +49,33 @@ let unknown_value =
5049 method to_short_string = " «opaque»"
5150 end
5251
52+ class raw_string_value v =
53+ object
54+ inherit value
55+
56+ method to_short_string = v
57+ end
58+
59+ class tips_value tips =
60+ object
61+ inherit value
62+
63+ method to_short_string = " …"
64+
65+ method! num_indexed = Array. length tips
66+
67+ method! get_indexed i = new raw_string_value tips.(i) |> Lwt. return
68+ end
69+
5370let adopters =
5471 ref
55- ( []
72+ ([]
5673 : (Scene. t ->
5774 Typenv. t ->
5875 Scene. obj ->
5976 Types. type_expr ->
6077 value option Lwt. t)
61- list )
78+ list )
6279
6380let adopt scene typenv obj ty =
6481 let rec resolve_type ty =
@@ -75,8 +92,8 @@ let adopt scene typenv obj ty =
7592 } -> (
7693 match Typenv. type_apply typenv type_params body ty_args with
7794 | ty -> resolve_type ty
78- | exception Ctype. Cannot_apply -> ty )
79- | _ -> ty )
95+ | exception Ctype. Cannot_apply -> ty)
96+ | _ -> ty)
8097 | _ -> ty
8198 in
8299 let ty = resolve_type ty in
Original file line number Diff line number Diff line change @@ -27,6 +27,16 @@ class func_value ?pc ?loc () =
2727 method! vscode_menu_context = Some " ocamlearlybird.function"
2828
2929 method! closure_code_location = loc
30+
31+ method! num_named = 1
32+
33+ method! list_named =
34+ Lwt. return
35+ [
36+ ( " ‹tips›" ,
37+ new tips_value
38+ [| " You can use context menu to goto closure code location." |] );
39+ ]
3040 end
3141
3242let adopter scene typenv obj typ =
You can’t perform that action at this time.
0 commit comments