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

Default Python Problem Matcher #3828

Closed
AllanDaemon opened this issue Dec 30, 2018 · 12 comments · Fixed by #24114
Closed

Default Python Problem Matcher #3828

AllanDaemon opened this issue Dec 30, 2018 · 12 comments · Fixed by #24114
Assignees
Labels
area-editor-* User-facing catch-all area-terminal feature-request Request for new features or functionality needs PR Ready to be worked on on-testplan Added to test plan

Comments

@AllanDaemon
Copy link

AllanDaemon commented Dec 30, 2018

Environment data

  • VS Code version: 1.30.1 (Commit: dea8705087adb1b5e5ae1d9123278e178656186a)
  • Extension version: 2018.12.1

Feature Request

According to https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher

"VS Code ships some of the most common problem matchers 'in-the-box'"

There a list of many built-in problem matchers but there isn't one for Python.

Because of this, every task created it's easier to ignore the scanning output. If it was provided a default Python problem matcher out of the box, it would be pretty easy to use.

For this purpose, scanning exceptions should be good enough, and probably there is already one of this written for the debugger.

I can try to do this myself later, as it seems just to find an already done implementation in this repo and figure it out how to provide a default problem matcher.

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Dec 30, 2018
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Dec 31, 2018
@DonJayamanne DonJayamanne self-assigned this Dec 31, 2018
@DonJayamanne DonJayamanne added feature-request Request for new features or functionality needs decision area-terminal labels Jan 8, 2019
@DonJayamanne DonJayamanne removed their assignment Jan 8, 2019
@gramster gramster added the area-editor-* User-facing catch-all label Oct 10, 2019
@hawkerm
Copy link

hawkerm commented Dec 1, 2019

I thought a regex like this was going to work: ^Traceback.*\n.*File "([^"]|.*)", line (\d+).*\n.*\n(.*)$ but then I found out it needs to be split per line, so I'm not sure how that works...

@alexlatchford
Copy link

alexlatchford commented Jan 17, 2020

I had some success with something like this:

> Executing task: python docs/test2.py <

Traceback (most recent call last):
  File "docs/test2.py", line 3, in <module>
    func()
  File "docs/test.py", line 2, in func
    raise Exception('Meow')
Exception: Meow
The terminal process terminated with exit code: 1

I've got it to match using:

...
"problemMatcher": {
                "owner": "python",
                "fileLocation": "autoDetect",
                "pattern": [
                    {
                        "regexp": "^.*File \\\"([^\\\"]|.*)\\\", line (\\d+).*",
                        "file": 1,
                        "line": 2
                    },
                    {
                        "regexp": "^.*raise.*$"
                    },
                    {
                        "regexp": "^\\s*(.*)\\s*$",
                        "message": 1
                    }
                ]
            }

Not the most elegant solution and I haven't tested it thoroughly yet but shows promise thus far 😄

Guessing it'll over report on errors that are re-raised but without allowing the loop feature to work across multiple lines I think we're stuck unfortunately.

@brettcannon
Copy link
Member

We are going through old issues and we noticed that no one from the team had replied to this issue. I want to apologize for the oversight and to let you know that the issue was reviewed by the team and triaged (as shown by the labels applied to this issue).

@NGPixel
Copy link

NGPixel commented Nov 4, 2021

@brettcannon Any update on this issue? Thanks!

@brettcannon
Copy link
Member

Sorry, no update. If we start work on this then the labels and assignment will reflect that (unless someone provides us a PR for this).

@xucian
Copy link

xucian commented Jan 30, 2022

updates?

@brettcannon
Copy link
Member

No updates, although it's on our roadmap, so it won't be forgotten.

When there's something to share we will leave a comment here.

@github-actions github-actions bot removed the needs PR label Aug 9, 2022
@karrtikr karrtikr added the needs PR Ready to be worked on label Aug 9, 2022
@Gesugao-san

This comment was marked as outdated.

@xucian
Copy link

xucian commented Aug 16, 2022

updates?

Why is this comment marked as outdated?

@brettcannon
Copy link
Member

@tfgstudios because in #3828 (comment) I said we would post to this issue when there are updates, so a post consisting of just "updates?" is "outdated" because it didn't take my previous comment into consideration.

I purposefully put that comment there so people wouldn't ping for updates as that notifies 11 different people that someone is asking for something for which the answer is, "there are no updates; we will post when there are any." Multiply this across our entire repo and the amount of time spent on these sorts of update requests when we have said we will post when we have something to share does add up.

@LTDakin
Copy link

LTDakin commented Jun 26, 2024

Has anyone come up with a problemMatcher string that works for Django/python in the meantime?

@jhassine
Copy link

jhassine commented Sep 16, 2024

Would be also nice if there would be also default problem matchers for different pytest traceback formats: https://docs.pytest.org/en/stable/how-to/output.html#modifying-python-traceback-printing although the native python one is a good starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-editor-* User-facing catch-all area-terminal feature-request Request for new features or functionality needs PR Ready to be worked on on-testplan Added to test plan
Projects
None yet