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 all 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
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@
"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
},
{
"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.*)$",
"message": 1
}
]
}
],
"walkthroughs": [
{
"id": "pythonWelcome",
Expand Down
Loading