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

Hard to set up non-trivial problem matcher #24260

Closed
chrmarti opened this issue Apr 7, 2017 · 4 comments
Closed

Hard to set up non-trivial problem matcher #24260

chrmarti opened this issue Apr 7, 2017 · 4 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality tasks Task system issues
Milestone

Comments

@chrmarti
Copy link
Collaborator

chrmarti commented Apr 7, 2017

Test tour #23385

When setting up the vue starter kit we had the following output structure:

  • Errors in ./some/file.vue
    • Some error message line:column
    • Other error message line:column

Multiline patterns cannot match that.

@dbaeumer
Copy link
Member

This is exactly what a multi line problem matcher is for. However it is not trivial due to the nature of this not being trivial with regexp. What kind of matcher did you try?

Here is the matcher for eslint stylish matcher which have the same output structure:

		this.add('eslint-stylish', [
			{
				regexp: /^([^\s].*)$/,
				file: 1
			},
			{
				regexp: /^\s+(\d+):(\d+)\s+(error|warning|info)\s+(.+?)\s\s+(.*)$/,
				line: 1,
				character: 2,
				severity: 3,
				message: 4,
				code: 5,
				loop: true
			}
		]);

Please remember that this matcher is defined in code but the tasks.json offers the same kind of functionality. Key might be the loop property.

@dbaeumer dbaeumer added tasks Task system issues info-needed Issue requires more information from poster labels Apr 10, 2017
@chrmarti
Copy link
Collaborator Author

Can I apply loop to more than just the last pattern? Each problem takes multiple lines in this case:

ERROR in ./src/components/About.vue
  error      semi      Extra semicolon                     
  /Users/chrmarti/Development/repos/vue-starter-kit/src/components/About.vue:18:28
        console.log(response);;;;
                              ^
  error  semi-spacing  Missing whitespace after semicolon  
  /Users/chrmarti/Development/repos/vue-starter-kit/src/components/About.vue:18:28
        console.log(response);;;;
                              ^
✖ 2 problems (2 errors, 0 warnings)

@dbaeumer dbaeumer added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Apr 11, 2017
@dbaeumer dbaeumer added this to the Backlog milestone Apr 11, 2017
@Londovir
Copy link

I would agree that having some way to designate a block of problem matcher regex entries as "loop true" would be beneficial in some cases. I'm working on an Angular 4 app that is running via a webpack-dev-server instance during development. Upon each save of a code file, the webpack instance recompiles the codebase and outputs any error. The problem is that the webpack instance will always output a blank line (\r) on the 1st line, then the error detail on the 2nd line, followed by a blank line (\r) on the 3rd line [if there's an additional error], followed by error detail on the 4th line, etc. For instance:

Line 1:
Line 2: ERROR in c:/TFSProjects/TOY/src/app/nominees.component.ts (6,30): Module "c:/TFSProjects/TOY/src/services/application/application.service" has no exported member 'NomineeInfo'.`
Line 3:
Line 4: ERROR in c:/TFSProjects/TOY/src/app/nominees/nominees.component.ts (6,55): Module '"c:/TFSProjects/TOY/src/services/application/application.service"' has no exported member 'SchoolNominationInfo'.

I can easily put in a regexp for ^\\s+ for my first regexp entry, followed by a far more detailed ^(ERROR|WARN).... entry to catch all of the parts of the error message, and this works wonderfully, but it only catches the first reported error because the "loop" property only runs on the second regexp. You also cannot use JavaScript regex syntax (to my knowledge) such as /^\\s+(ERROR|WARN)...$/gm to try and do it with a single regexp.

If I could specify that the task problem matcher should look for looping matches against both regexps, then it would work perfectly in this case (and likely others).

@alexr00 alexr00 assigned alexr00 and unassigned dbaeumer Oct 7, 2019
@alexr00
Copy link
Member

alexr00 commented Oct 10, 2019

Would be solved by #59337, so closing as duplicate.

@alexr00 alexr00 closed this as completed Oct 10, 2019
@alexr00 alexr00 added the *duplicate Issue identified as a duplicate of another issue(s) label Oct 10, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality tasks Task system issues
Projects
None yet
Development

No branches or pull requests

4 participants