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

Multi-Line Problem Matcher does not support multi-line messages #24867

Closed
o-lim opened this issue Apr 16, 2017 · 9 comments
Closed

Multi-Line Problem Matcher does not support multi-line messages #24867

o-lim opened this issue Apr 16, 2017 · 9 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

Comments

@o-lim
Copy link

o-lim commented Apr 16, 2017

VS Code supports defining multi-line problem matchers, but it does not support problems with messages that span multiple lines. Attempting to define a multi-line problem matcher for messages that span multiple lines results in VS Code defining N or N-1 problems for a single problem with N lines, where either the first line of the message is used for each of the N problems or the first line is missing and a separate problem is listed for each of the N-1 lines of the error message.

For example, given the following 3-line compiler error message:

myfile.cpp:6:11: error: undeclared identifier "i"
    array[i] = value;
          ^

There is no way to define a problem matcher that will contain all 3 lines.

  • VSCode Version: 1.11.x
@mjbvz mjbvz added the tasks Task system issues label Apr 20, 2017
@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Apr 25, 2017
@dbaeumer
Copy link
Member

@o-lim For this particular use case why would you need the line 2 and 3 information ?

@o-lim
Copy link
Author

o-lim commented Apr 25, 2017

In this particular use case, it is easy enough to figure out and fix the error without the additional lines of information. However, imagine the case where you have an error in a C++ template. In such a case the error message can easily extend beyond 2 or 3 lines. Furthermore, the additional lines of information are often essential to understanding and fixing the error.

@o-lim
Copy link
Author

o-lim commented Apr 25, 2017

Also consider the case with gtest, where the any single line is insufficient:

[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from myfile_unittest
[ RUN      ] myfile_unittest.test_empty
myfile_unittest.cpp:11: Failure
Value of: v.empty()
  Actual: true
Expected: false
[  FAILED  ] myfile_unittest.test_empty (0 ms)
[----------] 10 tests from myfile_unittest (0 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (0 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] myfile_unittest.test_empty
 1 FAILED TEST

@o-lim
Copy link
Author

o-lim commented Apr 25, 2017

There is also the case of the following format for an error message:

File File-name, Line Line-number
Source-line
    ^
Error-number: Message

@dbaeumer
Copy link
Member

A multi line matcher should be able to capture the last type of messages. What we currently don't support to capture a single property over multiple lines (for example if the message spawns multiple lines). Supporting this is not only a problem matcher capability we would need to render the messages as multiline in the problems view as well. Folding them onto one line will not make a good feature.

@sandy081 what will currently happen in the problems view if error messages contain new lines ?

@sandy081
Copy link
Member

Only single line is shown with ....
Complete message is shown on hover

There is a feature request to support multi line problems - #1927

@dbaeumer
Copy link
Member

@sandy081 thanks

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

Actually dups #9635

@Yensan
Copy link

Yensan commented Nov 1, 2017

@o-lim
hi, o-lim, sean-mcmanus guide me to here. It seems your project embed with gtest.
I have compiled the gtest iframe, and got the header file/ binary lib file. But , I can't compile my test case with the gtest header file/ binary lib file. Although I can put the frame in MinGW dir and compile/run it, but for most IDE, combine thirdParty's src or header&lib in a project is not rare. But I don't know how to do it
So, could you tell me how to create a C/C++ project with gtest ? (Maybe you can show file tree, setting json, etc)

@dbaeumer dbaeumer removed this from the Backlog milestone Nov 10, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
@alexr00 alexr00 added the *duplicate Issue identified as a duplicate of another issue(s) label Jan 30, 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

6 participants