Skip to content

Commit

Permalink
Merge pull request #121 from ddeclerck/debugging_adjustments
Browse files Browse the repository at this point in the history
Some adjustment for debugging
  • Loading branch information
nberth authored Dec 7, 2023
2 parents dda19aa + df27355 commit e8caddb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/lsp/superbol_free_lib/vscode_extension.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 7 additions & 3 deletions src/vscode/superbol-vscode-platform/superbol_tasks.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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:_ =
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e8caddb

Please sign in to comment.