diff --git a/src/vscode/superbol-vscode-platform/superbol_commands.ml b/src/vscode/superbol-vscode-platform/superbol_commands.ml index a685ede9..3be6c14b 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,22 @@ 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 = "Info: Performing " + ^ command_name + ^ " on file " + ^ Ojs.string_of_js arg1 + ^ " at position " + ^ (string_of_int line) ^ ":" ^ (string_of_int 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 = "Warning: " ^ command_name ^ " requires 2 arguments" in + OutputChannel.appendLine oc ~value end let _restart_language_server =