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

Fixes #80: Update problem matcher #147

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

jonaprieto
Copy link
Collaborator

@jonaprieto jonaprieto commented Sep 5, 2024

@jonaprieto jonaprieto self-assigned this Sep 5, 2024
@jonaprieto jonaprieto added this to the 0.2.4 milestone Sep 5, 2024
@jonaprieto jonaprieto changed the title Fix problem matcher Fix #80: Update problem matcher Sep 5, 2024
@jonaprieto jonaprieto changed the title Fix #80: Update problem matcher Fixes #80: Update problem matcher Sep 5, 2024
@jonaprieto jonaprieto marked this pull request as draft September 5, 2024 16:05
Copy link
Contributor

@lukaszcz lukaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work now!

@lukaszcz lukaszcz modified the milestones: 0.2.4, 0.2.5 Sep 5, 2024
@jonaprieto
Copy link
Collaborator Author

I'm not sure, I just tested it on another machine, and it didn't work. Did you test it with typecheckOn set to "none"

@lukaszcz
Copy link
Contributor

lukaszcz commented Sep 6, 2024

I'm not sure, I just tested it on another machine, and it didn't work. Did you test it with typecheckOn set to "none"

Oh, yes, it doesn't work with typecheckOn set to "none". It's a bit strange and random. For the first typecheck, I got only the first line of the error message. When I repeat the type checking, I don't get the error message at all.

@lukaszcz
Copy link
Contributor

lukaszcz commented Nov 8, 2024

I looked into this, and it seems to be completely impossible to use a ProblemMatcher for an error message spanning several lines. Theoretically, there are multiline problem matchers, but they are intended to work for stuff like:

test.js
  1:0   error  Missing "use strict" statement                 strict
  1:9   error  foo is defined but never used                  no-unused-vars
  2:5   error  x is defined but never used                    no-unused-vars
  2:11  error  Missing semicolon                              semi
  3:1   error  "bar" is not defined                           no-undef
  4:1   error  Newline required at end of file but not found  eol-last
✖ 6 problems (6 errors, 0 warnings)

When you get several error messages for one file, and not a single message on multiple lines. VSCode extensions for Haskell, which need to parse multiline error messages, do this by manually parsing all errors without using any problem matchers.

See:

@lukaszcz
Copy link
Contributor

lukaszcz commented Nov 8, 2024

Even for the simple case of one line break between file/location info and the message, this line break is precisely what causes the error messages to get mangled up in the pop-up window, even though we seem to be correctly implementing a problem matcher for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants