Skip to content

Commit

Permalink
Merge pull request #91 from Stevendeo/problem-matchers
Browse files Browse the repository at this point in the history
Problem patterns & matchers
  • Loading branch information
nberth authored Oct 27, 2023
2 parents 06efdf2 + f5fb619 commit 9faae1b
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 0 deletions.
68 changes: 68 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
60 changes: 60 additions & 0 deletions src/lsp/superbol_free_lib/project.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/vscode/superbol-vscode-platform/superbol_tasks.ml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,25 @@ 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
~scope
~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])

Expand Down

0 comments on commit 9faae1b

Please sign in to comment.