Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide problem matchers for common compilers #854

Closed
dlech opened this issue Jun 29, 2017 · 5 comments
Closed

provide problem matchers for common compilers #854

dlech opened this issue Jun 29, 2017 · 5 comments

Comments

@dlech
Copy link

dlech commented Jun 29, 2017

Please add contributes.problemMatchers as described here.

@sean-mcmanus
Copy link
Contributor

For what build systems? gcc?

@sean-mcmanus sean-mcmanus added Feature Request Language Service more info needed The issue report is not actionable in its current state labels Jun 29, 2017
@dlech
Copy link
Author

dlech commented Jun 30, 2017

gcc definitely. Makefile might be useful too. I imagine others might be interested in msvc, but it is not important to me.

@sean-mcmanus sean-mcmanus removed the more info needed The issue report is not actionable in its current state label Jun 30, 2017
@agauniyal
Copy link

I see this was added in recent changelogs for this plugin, what is it exactly?

@dlech
Copy link
Author

dlech commented Aug 6, 2017

A problem matcher is something you can add to a task.

{
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "build",
            "command": "gcc",
            "args": [
                "-g",
                "hello.c"
            ],
            "type": "process",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": "$gcc"
        }
    ]
}

It matches errors and warnings in the task output (used to be in the output panel, but now with tasks 2.0 in the terminal panel).

> Executing task: gcc hello.c <

hello.c:3:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main(void) {
^
hello.c:3:1: note: change return type to 'int'
void main(void) {
^~~~
int
hello.c:5:2: error: use of undeclared identifier 'syntax'
        syntax error
        ^
1 warning and 1 error generated.
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

It uses the information in the matching text to list the items in the problem panels and also indicate them in the source code with squiggles.

image

@dlech
Copy link
Author

dlech commented Aug 6, 2017

Looks like it is working, so closing. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants