diff --git a/src/vscode/superbol-vscode-platform/superbol_commands.ml b/src/vscode/superbol-vscode-platform/superbol_commands.ml index a685ede9..2949df07 100644 --- a/src/vscode/superbol-vscode-platform/superbol_commands.ml +++ b/src/vscode/superbol-vscode-platform/superbol_commands.ml @@ -27,6 +27,9 @@ type t = handler: handler; } +let extension_oc : Vscode.OutputChannel.t Lazy.t = + lazy (Vscode.Window.createOutputChannel ~name:"SuperBOL Studio Extension") + let commands = ref [] let command id handler = @@ -35,7 +38,8 @@ let command id handler = command let _editor_action_findReferences = - command "superbol.editor.action.findReferences" @@ Instance + let command_name = "superbol.editor.action.findReferences" in + command command_name @@ Instance begin fun _instance ~args -> match args with | [arg1; arg2] -> @@ -43,11 +47,20 @@ let _editor_action_findReferences = let line = Ojs.get_prop_ascii arg2 "line" |> Ojs.int_of_js in let character = Ojs.get_prop_ascii arg2 "character" |> Ojs.int_of_js in let pos = Position.make ~line ~character in + let lazy oc = extension_oc in + let value = Printf.sprintf + "Info: Performing %s on file %s at position %d:%d" + command_name (Ojs.string_of_js arg1) line character in + OutputChannel.appendLine oc ~value; let _ = Commands.executeCommand ~command:"editor.action.findReferences" ~args:[Uri.t_to_js uri; Position.t_to_js pos ] in () - | _ -> () + | _ -> + let lazy oc = extension_oc in + let value = Printf.sprintf + "Warning: %s requires 2 arguments" command_name in + OutputChannel.appendLine oc ~value end let _restart_language_server =