vscode tasks - problemMatcher works sometimes yes, sometimes not

105 Views Asked by At

I'm trying to use the "problemMatcher" below to have VSCode start the debugging process as soon as the string...

SUCCESSFUL
OPERATION

... is displayed in the terminal output.

PROBLEMMATCHER

[...]
        {
            "label": "startWithAwsSam",
            "type": "shell",
            "command": "bash startWithAwsSam.bash",
            "isBackground": true,
            "dependsOn": [
                "buildWithAwsSam"
            ],
            "problemMatcher": [
                {
                    "pattern": [
                        {
                            "regexp": "\\b\\B",
                            "file": 1,
                            "location": 2,
                            "message": 3
                        }
                    ],
                    "background": {
                        "activeOnStart": true,
                        "beginsPattern": "^.*SUCCESSFUL*",
                        "endsPattern": "^.*OPERATION*"
                    }
                }
            ]
        },
[...]

OUTPUT SAMPLE (terminal)

pyenv shell some-app
 > ----------------------------------- 
    Make the http request!
 < ----------------------------------- 
SUCCESSFUL
OPERATION
You can now browse to the above endpoints to invoke your functions. You do not need to restart/reload SAM CLI while working on your functions, changes will be reflected instantly/automatically. If you used sam build before running local commands, you will need to re-run sam build for the changes to be picked up. You only need to restart SAM CLI if you update your AWS SAM template
2023-05-22 23:17:41 WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:3000
2023-05-22 23:17:41 Press CTRL+C to quit
Invoking some_app/api.getFAQ (python3.8)
Local image is up-to-date
Using local image: public.ecr.aws/lambda/python:3.8-rapid-x86_64.

Mounting /home/eduardolac/some-app/.aws-sam/build/GetFAQLambda as /var/task:ro,delegated, inside runtime container
START RequestId: 4fe811c9-bd5c-43c2-86f0-e0fd7398219e Version: $LATES

PROBLEM

The presented problemMatcher works sometimes yes, sometimes not. Even though the evaluated output is always the same.

QUESTION

How to solve this problem?

Thanks!

PLUS: If it were possible to use a "problemMatcher" to match a string anywhere in an output, that would be perfect!

0

There are 0 best solutions below