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

Problem matcher errors are unhelpful #29951

Closed
mmkal opened this issue Jun 30, 2017 · 6 comments
Closed

Problem matcher errors are unhelpful #29951

mmkal opened this issue Jun 30, 2017 · 6 comments
Assignees
Labels
feature-request Request for new features or functionality tasks Task system issues
Milestone

Comments

@mmkal
Copy link

mmkal commented Jun 30, 2017

  • VSCode Version:
  • OS Version:

Steps to Reproduce:

  1. Write a task with a custom problem matcher (which apparently has some issues) as below
  2. Try to run it.

Expected:
A helpful error message in the output window that tells me what I did wrong.
Actual:
The error message just echoes my problemMatcher config back to me:

Error: the description doesn't define a valid problem pattern:
{
    "background": {
        "activeOnStart": true,
        "beginsPattern": ".*",
        "endsPattern": ".*"
    }
}

tasks.json I'm trying:

{
    "version": "0.1.0",
    "command": "npm",
    "isShellCommand": true,
    "showOutput": "always",
    "suppressTaskName": true,
    "tasks": [
        {
            "taskName": "compile",
            "isBuildCommand": true,
            "isTestCommand": false,
            "showOutput": "always",
            "args": [ "run", "local:compile", "--", "--watch" ],
            "isBackground": true,
            "problemMatcher": {
                "background": {
                    "activeOnStart": true,
                    "beginsPattern": ".*",
                    "endsPattern": ".*"
                }
            }
        }
    ]
}

Reproduces without extensions: Yes

(this issue isn't about what is specifically wrong with this configuration, but the fact that the error message doesn't help me figure that out. But if anyone wants to point me in the right direction, that'd be good too)

@vscodebot vscodebot bot added the tasks Task system issues label Jun 30, 2017
@dlech
Copy link
Contributor

dlech commented Jun 30, 2017

"background" is not a valid member of "problemMatcher". See docs for what a valid problem matcher looks like.

dlech added a commit to dlech/vscode that referenced this issue Jun 30, 2017
@dlech
Copy link
Contributor

dlech commented Jun 30, 2017

Actually, I just found that background was spelled wrong in the code and sent a PR.

@mmkal
Copy link
Author

mmkal commented Jun 30, 2017

@dlech not sure what you mean by this. "background" is valid member and its values are being respected. And as I said, this issue is more about getting VS code to give more informative error messages for invalid problem matchers, than what's wrong with my individual one (for anyone curious, I was able to fix it by adding a "pattern" object to the problemMatcher (FWIW, this should probably be optional given I don't care about the pattern, I'm only using the problem matcher as a task-watcher, but that's an issue for another day)).

@dbaeumer
Copy link
Member

dbaeumer commented Jul 3, 2017

Agree, that the error message is not very helpful. We have documentation about how to write a problem matcher here: https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher

@dbaeumer dbaeumer added the feature-request Request for new features or functionality label Jul 3, 2017
@dbaeumer dbaeumer added this to the On Deck milestone Jul 3, 2017
@dbaeumer dbaeumer modified the milestones: On Deck, Backlog Nov 9, 2017
@michael-hawker
Copy link

Yeah, I'm following documentation and a previous matcher I had built, and it doesn't seem to be working in the new project I'm building. This message doesn't provide any insight into what's wrong. I can delete any piece of what I've put in and if I have anything in there, it's giving me this message, so it seems like there's something else going on that can also cause this unhelpful message to appear?

@alexr00
Copy link
Member

alexr00 commented Nov 15, 2021

Tried this out, and I got a number of fairly useful errors in the console:

abstractExtensionService.ts:923 [vscode.typescript-language-features]: The problem pattern is missing a regular expression.
abstractExtensionService.ts:923 [vscode.typescript-language-features]: Invalid problem pattern. The pattern will be ignored.
abstractExtensionService.ts:923 [vscode.typescript-language-features]: {
    "name": "tsc",
    "file": 1,
    "severity": 4,
    "code": 5,
    "message": 6
}
abstractExtensionService.ts:923 [vscode.typescript-language-features]: Error: the pattern with the identifier $tsc doesn't exist.

@alexr00 alexr00 closed this as completed Nov 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality tasks Task system issues
Projects
None yet
Development

No branches or pull requests

5 participants