-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
allow for problem patterns without a line #39936
allow for problem patterns without a line #39936
Conversation
Will update to follow the discussion in #6538 |
First impressions/questions after trying to implement this (CC: @dbaeumer, since you're the one that proposed the 'kind' property in the first place)
I would appreciate some guidance there ... Completely new to the codebase. |
67464af
to
4f31fd8
Compare
First take on it. Went the shortest route, that is requiring that 'kind' is within the first pattern in a multi-pattern. It's unit tested, but as of yet not tested "in daily use". |
@doudou thanks a lot for looking into this! Regarding your questions:
Let me know what you think about it. |
Sounds reasonable, I'm going to stick to that. The PR already implements it this way. Could you have a look ? I'm still testing, but I'm guessing that you might have some comments ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the code and especially for the test! Highly appreciated.
I only have two minor comments
@@ -781,6 +823,15 @@ class ProblemPatternParser extends Parser { | |||
private validateProblemPattern(values: ProblemPattern[]): boolean { | |||
let file: boolean, message: boolean, location: boolean, line: boolean; | |||
let regexp: number = 0; | |||
let patternsWithKind = values.filter((pattern, i) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we fold this with the forEach from below. May be it would be easiest to turn the forEach into a for(pattern of values).
@@ -415,6 +441,13 @@ export namespace Config { | |||
*/ | |||
regexp?: string; | |||
|
|||
/** | |||
* Whether the pattern matches a whole file, or a location (file/line) | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment to say that the value is only valid on the first entry. Like we do with loop
.
4f31fd8
to
8652645
Compare
Updated. |
Not in 1.20 :( Anything missing in there ? |
No, nothing missing here. I was very busy with Language Pack support in 1.20 which required bigger changes in the loader and core code of VS Code. So I needed to shift this to February. |
I merge the PR. Thanks for providing it. |
Thanks ! And thanks for vscode ... the first IDE that made me leave vim in 10 years. |
Problem matchers currently must provide a line (and will be ignored if they don't). There's however sometimes problems that have no lines.
In these cases, using the matcher, assuming a line of 1, would be IMO a lot more useful than ignoring it.
Closes #39919