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

Contribute problem matcher #24114

Merged
merged 6 commits into from
Sep 17, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,32 @@
"browser": "./dist/extension.browser.js",
"l10n": "./l10n",
"contributes": {
"problemMatchers":
[
{
"name": "python",
"owner": "python",
"source": "python",
"fileLocation": "autoDetect",
"pattern": [
{
"regexp": "^.*File \\\"([^\\\"]|.*)\\\", line (\\d+).*",
"file": 1,
"line": 2,
"severity": 4,
"message": 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above regex seems to only have 2 groups. This will not extract message/severity as far as I understand.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got rid of message (this shouldnt have any effect because message defaults to 5), and got rid of severity entirely too and that doesnt seem to do anything too. 472103b

},
{
"regexp": "^\\s*(.*)\\s*$"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This expression seems to capture all lines. What is the purpose of this?

Copy link
Author

@anthonykim1 anthonykim1 Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem matcher will not pick up intended errors(NameError, ValueError, etc) if this is removed.
Generally it seems that array that is set for "pattern" is responsible for multi-line string of output that we(problem matcher) intends to parse.
For our case specifically, it will be responsible for capturing the output right above (error ---> the error is the one we intend to show in the problem panel); So this would allow us to correctly capture and show the error in the problems panel, and not the output above the error.
Screenshot 2024-09-16 at 9 39 21 PM


},
{
"regexp": "\\s*(.*Error.*)$",
anthonykim1 marked this conversation as resolved.
Show resolved Hide resolved
"message": 1
}
]
}
],
"walkthroughs": [
{
"id": "pythonWelcome",
Expand Down
Loading