From df27355a7388f2b65da77d2f7e2364a7e0baed40 Mon Sep 17 00:00:00 2001 From: David Declerck Date: Tue, 5 Dec 2023 09:28:24 +0100 Subject: [PATCH] Some adjustment for debugging --- src/lsp/superbol_free_lib/vscode_extension.ml | 9 ++++----- src/vscode/superbol-vscode-platform/superbol_tasks.ml | 10 +++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/lsp/superbol_free_lib/vscode_extension.ml b/src/lsp/superbol_free_lib/vscode_extension.ml index d236531c3..e81b802f2 100644 --- a/src/lsp/superbol_free_lib/vscode_extension.ml +++ b/src/lsp/superbol_free_lib/vscode_extension.ml @@ -158,12 +158,11 @@ let contributes = Manifest.PROPERTY.array "copybooks" ~description:"The list of copybooks paths" ; - Manifest.PROPERTY.enum "sourceFormat" - ~cases:Cobol_config.DIALECT.all_canonical_names - ~description: "The source format of the code" - ; + Manifest.PROPERTY.string "sourceFormat" + ~description: "The source format of the code" ; - Manifest.PROPERTY.string "dialect" + Manifest.PROPERTY.enum "dialect" + ~cases:Cobol_config.DIALECT.all_canonical_names ~description: "The COBOL dialect used" ; Manifest.PROPERTY.bool "forDebugging" diff --git a/src/vscode/superbol-vscode-platform/superbol_tasks.ml b/src/vscode/superbol-vscode-platform/superbol_tasks.ml index 58b9470e8..906b900ac 100644 --- a/src/vscode/superbol-vscode-platform/superbol_tasks.ml +++ b/src/vscode/superbol-vscode-platform/superbol_tasks.ml @@ -54,6 +54,10 @@ let make_args attributes = "-ext"::ext::acc) args exts) |> + (fun args -> match List.assoc_opt "forDebugging" attributes with + | Some fd when ([%js.to: bool] fd) -> + "-g"::"-fsource-location"::"-ftraceall"::"-Q"::"--coverage"::"-A"::"--coverage"::"-v"::args + | _ -> args) |> List.map (fun elt -> `String elt) let provide_tasks ~token:_ = @@ -81,7 +85,7 @@ let provide_tasks ~token:_ = ~scope ~name:"Build file for debug" ~source:"superbol" - ~execution:(execution "cobcd") + ~execution:(execution "cobc") ~problemMatchers:[ "$gnucobol"; "$gnucobol-warning"; @@ -126,14 +130,14 @@ let resolve_task ~task ~token:_ = | exception _ -> attributes) |> (fun attributes -> match [%js.to: bool or_undefined] (TaskDefinition.get_attribute definition "forDebugging") with - | Some b -> attributes, b + | Some b -> ("forDebugging", [%js.of: bool] b)::attributes, b | None | exception _ -> attributes, false) in OutputChannel.appendLine oc ~value:"Got attributes"; let args = make_args attributes in let execution = if debug then - let shell_execution = ShellExecution.makeCommandArgs ~command:(`String "cobcd") ~args () in + let shell_execution = ShellExecution.makeCommandArgs ~command:(`String "cobc") ~args () in `ShellExecution shell_execution else let shell_execution = ShellExecution.makeCommandArgs ~command:(`String "cobc") ~args () in