Issue Matchers

Within the JSON manifest of an extension, a issueMatchers top-level key can be used to define issue matchers. The value is an object which defined key-value pairs following the following format:

"issueMatchers": {
    "my-issue-matcher": {
        "pattern": {
            "regexp": "^(?:PHP\\s+)?Parse error:\\s+(.+?)\\s+\\(([a-zA-Z0-9-_]+)\\) in ([^:]+?) on line (\\d+)$",
            "message": 1,
            "code": 2,
            "file": 3,
            "line": 4,
            "severity": "error"
        }
    }
}

Each issue matcher object is keyed with an identifier (in this case, my-issue-matcher) which is used with the IssueParser constructor API. This value must be unique within a single extension.

In this way, the JSON representation of a matcher defines everything needed to wrap issue detection up into an easily readable format.

Issue Matcher definitions

Keys within this object are:

Pattern definitions

An issue matcher definition may have one or more patterns.

Each pattern is defined as an object containing a regular expression (regexp) and a set of keys that map to the regex capture it represents. Keys are then defined for each “important” piece of the parsed text that is used of building issues.