From dca5862f5bb5b1eef63e3d7044c041e149a699df Mon Sep 17 00:00:00 2001 From: Steven de Oliveira Date: Fri, 27 Oct 2023 10:38:15 +0200 Subject: [PATCH 1/2] Problem patterns and matchers --- package.json | 68 ++++++++++++++++++++++++++++ src/lsp/superbol_free_lib/project.ml | 60 ++++++++++++++++++++++++ 2 files changed, 128 insertions(+) diff --git a/package.json b/package.json index 5c3b0a277..c90d1825d 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,74 @@ ] } ], + "problemMatchers": [ + { + "name": "gnucobol", + "owner": "cobol", + "fileLocation": "absolute", + "pattern": "$gnucobol", + "source": "GnuCOBOL" + }, + { + "name": "gnucobol-warning", + "owner": "cobol", + "fileLocation": "absolute", + "pattern": "$gnucobol-warning", + "source": "GnuCOBOL", + "severity": "warning" + }, + { + "name": "gnucobol-error", + "owner": "cobol", + "fileLocation": "absolute", + "pattern": "$gnucobol-error", + "source": "GnuCOBOL", + "severity": "error" + }, + { + "name": "gnucobol-note", + "owner": "cobol", + "fileLocation": "absolute", + "pattern": "$gnucobol-note", + "source": "GnuCOBOL", + "severity": "info" + } + ], + "problemPatterns": [ + { + "name": "gnucobol", + "regexp": "^(.*): ?(\\d+): (error|warning): ([^[]*)(\\[(.*)\\])?$", + "file": 1, + "line": 2, + "severity": 3, + "code": 6, + "message": 4 + }, + { + "name": "gnucobol-warning", + "regexp": "^(.*):(\\d+):\\s?(warning|Warnung|[wW]aarschuwing|[aA]lerta|avertissement|упозорење)\\s?:([^[]*)(\\[(.*)\\])?$", + "file": 1, + "line": 2, + "code": 6, + "message": 4 + }, + { + "name": "gnucobol-error", + "regexp": "^(.*): ?(\\d+):\\s?(error|Fehler|[fF]out|[eE]rrores|[eE]rrores|erreur|грешка)\\s?:\\s?([^[]*)(\\[(.*)\\])?$", + "file": 1, + "line": 2, + "code": 6, + "message": 4 + }, + { + "name": "gnucobol-note", + "regexp": "^(.*): ?(\\d+): (note|Anmerkung|[nN]ota): ([^[]*)(\\[(.*)\\])?$", + "file": 1, + "line": 2, + "code": 6, + "message": 4 + } + ], "taskDefinitions": [ { "type": "superbol", diff --git a/src/lsp/superbol_free_lib/project.ml b/src/lsp/superbol_free_lib/project.ml index f74a62a38..c28f79244 100644 --- a/src/lsp/superbol_free_lib/project.ml +++ b/src/lsp/superbol_free_lib/project.ml @@ -169,6 +169,66 @@ let contributes = ~description: "Add cobol file extensions" ] ] + ~problemPatterns:[ + Manifest.problemPattern + (Some "^(.*): ?(\\d+): (error|warning): ([^[]*)(\\[(.*)\\])?$") + ~name:"gnucobol" + ~file:1 + ~line:2 + ~severity:3 + ~message:4 + ~code:6; + Manifest.problemPattern + (Some "^(.*):(\\d+):\\s?(warning|Warnung|[wW]aarschuwing|[aA]lerta|avertissement|упозорење)\\s?:([^[]*)(\\[(.*)\\])?$") + ~name:"gnucobol-warning" + ~file:1 + ~line:2 + ~message:4 + ~code:6; + Manifest.problemPattern + (Some "^(.*): ?(\\d+):\\s?(error|Fehler|[fF]out|[eE]rrores|[eE]rrores|erreur|грешка)\\s?:\\s?([^[]*)(\\[(.*)\\])?$") + ~name:"gnucobol-error" + ~file:1 + ~line:2 + ~message:4 + ~code:6; + Manifest.problemPattern + (Some "^(.*): ?(\\d+): (note|Anmerkung|[nN]ota): ([^[]*)(\\[(.*)\\])?$") + ~name:"gnucobol-note" + ~file:1 + ~line:2 + ~message:4 + ~code:6; + ] + ~problemMatchers:[ + Manifest.problemMatcher () + ~name:"gnucobol" + ~owner:"cobol" + ~fileLocation:["absolute"] + ~pattern:[Manifest.ProblemName "$gnucobol"] + ~source:"GnuCOBOL"; + Manifest.problemMatcher () + ~name:"gnucobol-warning" + ~owner:"cobol" + ~fileLocation:["absolute"] + ~pattern:[Manifest.ProblemName "$gnucobol-warning"] + ~severity:"warning" + ~source:"GnuCOBOL"; + Manifest.problemMatcher () + ~name:"gnucobol-error" + ~owner:"cobol" + ~fileLocation:["absolute"] + ~pattern:[Manifest.ProblemName "$gnucobol-error"] + ~severity:"error" + ~source:"GnuCOBOL"; + Manifest.problemMatcher () + ~name:"gnucobol-note" + ~owner:"cobol" + ~fileLocation:["absolute"] + ~pattern:[Manifest.ProblemName "$gnucobol-note"] + ~severity:"info" + ~source:"GnuCOBOL"; + ] let manifest = Manifest.vscode From f5fb619fa6efb97790d74a1e0e7f104372fec9ab Mon Sep 17 00:00:00 2001 From: Steven de Oliveira Date: Fri, 27 Oct 2023 10:44:48 +0200 Subject: [PATCH 2/2] Task definitions --- .../superbol-vscode-platform/superbol_tasks.ml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/vscode/superbol-vscode-platform/superbol_tasks.ml b/src/vscode/superbol-vscode-platform/superbol_tasks.ml index 3ebd6dce4..58b9470e8 100644 --- a/src/vscode/superbol-vscode-platform/superbol_tasks.ml +++ b/src/vscode/superbol-vscode-platform/superbol_tasks.ml @@ -69,6 +69,12 @@ let provide_tasks ~token:_ = ~name:"Build file" ~source:"superbol" ~execution:(execution "cobc") + ~problemMatchers:[ + "$gnucobol"; + "$gnucobol-warning"; + "$gnucobol-error"; + "$gnucobol-note"; + ] in let build_debug_task = Task.make () ~definition:definition_debug @@ -76,6 +82,12 @@ let provide_tasks ~token:_ = ~name:"Build file for debug" ~source:"superbol" ~execution:(execution "cobcd") + ~problemMatchers:[ + "$gnucobol"; + "$gnucobol-warning"; + "$gnucobol-error"; + "$gnucobol-note"; + ] in `Value (Some [build_task; build_debug_task])