diff --git a/src/debugger/inspect/value_basic.ml b/src/debugger/inspect/value_basic.ml index dececa8..4ed4a36 100644 --- a/src/debugger/inspect/value_basic.ml +++ b/src/debugger/inspect/value_basic.ml @@ -1,6 +1,5 @@ (** - * Copyright (C) 2021 Yuxiang Wen - * +msg * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the @@ -50,15 +49,33 @@ let unknown_value = method to_short_string = "«opaque»" end +class raw_string_value v = + object + inherit value + + method to_short_string = v + end + +class tips_value tips = + object + inherit value + + method to_short_string = "…" + + method! num_indexed = Array.length tips + + method! get_indexed i = new raw_string_value tips.(i) |> Lwt.return + end + let adopters = ref - ( [] + ([] : (Scene.t -> Typenv.t -> Scene.obj -> Types.type_expr -> value option Lwt.t) - list ) + list) let adopt scene typenv obj ty = let rec resolve_type ty = @@ -75,8 +92,8 @@ let adopt scene typenv obj ty = } -> ( match Typenv.type_apply typenv type_params body ty_args with | ty -> resolve_type ty - | exception Ctype.Cannot_apply -> ty ) - | _ -> ty ) + | exception Ctype.Cannot_apply -> ty) + | _ -> ty) | _ -> ty in let ty = resolve_type ty in diff --git a/src/debugger/inspect/value_func.ml b/src/debugger/inspect/value_func.ml index 012a78b..cc476e0 100644 --- a/src/debugger/inspect/value_func.ml +++ b/src/debugger/inspect/value_func.ml @@ -27,6 +27,16 @@ class func_value ?pc ?loc () = method! vscode_menu_context = Some "ocamlearlybird.function" method! closure_code_location = loc + + method! num_named = 1 + + method! list_named = + Lwt.return + [ + ( "‹tips›", + new tips_value + [| "You can use context menu to goto closure code location." |] ); + ] end let adopter scene typenv obj typ =