Repository: vscode
Issue: Problems are not always generated when running tasks
Labels: bug,tasks

Type: <b>Bug</b>

The problem was first encountered on VS Code 1.74 on Ubuntu Linux but is still reproducible with the latest ie 1.78.2. It has not been seen on Windows. 
I reported a similar bug some time ago which was fixed -
https://github.com/microsoft/vscode/issues/132551

Use the following tasks.json

```json
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run build",
            "type": "shell",
            "command": "./bld.sh",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": {
                "fileLocation": "autoDetect",
                "owner": "cobol",
                "pattern":  {
                    "regexp": "^\\s*\\[cobol\\]\\s*\\*\\*\\s*(COB(?:CH|ES)\\d+)[USE]\\s*(.*) :\\s+\"?([^\"]*)\"?\\((\\d+),(\\d+),(\\d+)\\).*$",
					"code": 1,
					"message": 2,
					"file": 3,
					"line": 4,
					"column": 6
                }
             }
        }
     ]
}
```  

and this script named bld.sh

```sh
echo '    [cobol] **    COBCH0012S Operand aaa is not declared  : "CobProgram.cbl"(11,26,24)'
echo '    [cobol] **    COBCH0012S Operand aaa is not declared  : "CobProgram.cbl"(11,26,24)'
echo '    [cobol] **    COBCH0012S Operand ccc is not declared  : "CobProgram.cbl"(13,26,24)'
echo '    [cobol] **    COBCH0012S Operand ddd is not declared  : "CobProgram.cbl"(14,26,24)'
echo '    [cobol] **    COBES0109S svr is not a data item.   : "CobProgram.cbl"(17,28,28)'
```
with this test program CobProgram.cbl

```cobol
      *SET SQL(dbman=ODBC)
       identification division.
       program-id. CobProgram.

       environment division.
       configuration section.
       data division.
       working-storage section.

       procedure division.
           move "1" to aaa

           move "3" to ccc
           move "4" to ddd

      *     EXEC SQL
      *         CONNECT TO :svr USER :usr WITH NO PROMPT ooops
      *     END-EXEC

           goback.


       end program CobProgram.
```

Run the build task. Four problems are expected in the Problems list but sometimes only two or three are generated. 

VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:47:05.613Z)
OS version: Linux x64 5.4.0-149-generic
Modes:
Sandboxed: Yes

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (4 x 2712)|
|GPU Status|2d_canvas: unavailable_software<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: disabled_software<br>multiple_raster_threads: enabled_on<br>opengl: disabled_off<br>rasterization: disabled_software<br>raw_draw: disabled_off_ok<br>video_decode: disabled_software<br>video_encode: disabled_software<br>vulkan: disabled_off<br>webgl: unavailable_software<br>webgl2: unavailable_software<br>webgpu: disabled_off|
|Load (avg)|1, 0, 0|
|Memory (System)|11.58GB (7.42GB free)|
|Process Argv|. --crash-reporter-id 72b2e2eb-cf02-4d66-8565-24c02ccfa29d|
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|ubuntu|
|XDG_CURRENT_DESKTOP|Unity|
|XDG_SESSION_DESKTOP|ubuntu|
|XDG_SESSION_TYPE|x11|
</details><details><summary>Extensions (2)</summary>

Extension|Author (truncated)|Version
---|---|---
mfcobol|Mic|1.0.47
csharp|ms-|1.25.9


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
2i9eh265:30646982
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30730052
hidesbindicator:30760978
pythongtdpath:30739704

```

</details>

<!-- generated by issue reporter -->