-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Only the first line of multiline Haskell errors is displayed #317
Comments
Why was this issue closed? Doesn't seem to be fixed. |
@slycelote: Because at the time the issue was one year old, syntastic has changed a lot since that date, and I know nothing about Haskell. As nobody re-opened it, either nobody uses the Haskell checker, or the problem has magically gone away, or nobody knows how to solve it, or nobody who knows how to solve it can be bothered. :) Please feel free to re-open it, perhaps describing how to reproduce the problem. |
@lcd047 It seems I don't have necessary permissions to reopen. main :: IO ()
main = do
name <- getLine
greet <- getLine
putStrLn $ greet ++ ", " ++ name
f :: IO ()
f = do
name <- getLine
greet <- getLine
putStrLn $ greet ++ ", " ++ name Syntastic produces a warning on line 3: My ghc-mod version 2.0.3, ghc version 7.4.1. |
Surely there must be some newlines in there? :) Sadly I have no reasonably easy way to install ghc-mod to check for myself. |
|
As I said, I don't know anything about Haskell. Somebody who does would have to look into it. shrug |
Ugh, things go a little further than I thought: rather than newlines, |
This may not be what it looks. Vim stores |
I stripped down the output to contain only the character in question, and the output of
Looks like this is a |
|
Yes exactly (I'm also assuming little endian). |
Thanks @zenzike for figuring out the issue. The problem with current solution is that only one of the checkers is run. In my example above, there will be a warning at line 3 ('Reduce duplication') or a warning at line 7 ('Unused definition'), depending on the order of checkers in g:syntastic_haskell_checkers variable. Is it possible to get them both running? What do you think of an alternative solution: write a wrapper script that would replace Nul characters with \n? This script could be written in Haskell so as not to create additional dependencies. |
@slycelote nice observation. I think that it's a slightly different issue though: syntastic has it such that if there are multiple checkers then they are in sequence. I've reported this as a feature request in #744. I think it's best to keep checkers as atomic parts, and let syntastic handle their composition. As for running a wrapper script, that might be good for now: in the longer term I think we should either fix the issue directly, or ask @kazu-yamamoto to provide an argument that changes ghc-mod output (see DanielG/ghc-mod#136). |
Would you explain what ghc-mod should do briefly? |
Currently
The problem is that
In other words, do not use '\0' to separate lines: instead perhaps use a new line followed by two spaces. |
OK. I will consider. |
Actually, there is a way to handle
let l:tmpfile = tempname()
call system('ghc-mod check > ' . l:tmpfile)
for l:line in readfile(l:tmpfile)
" A <NL> character in l:line indicates a <Nul> character.
endfor Please refer to |
So, the approach of @eagletmt is acceptable? Or, should |
@kazu-yamamoto Yes and no. I'll add a "preprocessing" mechanism similar to the one described above by @eagletmt, provided that I can figure out how to make it work. That would be useful by itself, and it could be applied to the ghc-mod checker. But in my opinion passing |
So, I should provide a mechanism to customize line separator, anyway. That's fine. But what about the default value? If If we can reach consensus, I will quickly implement it. |
Really, any combination of "normal", plain ASCII, non-control characters would be fine. As suggested above, a newline followed by two spaces might be a good choice. |
Please see #753. |
For what it's worth: this has been fixed in Vim 7.4b.014, Anyway, this doesn't help us much, as it will take a while for people to upgrade. |
Hmm, and how does |
Existing |
Re: running both ghc-mod and hlint and piling errors in a big, happy list: I added a new option |
The |
This works perfectly on Vim 7.4 using OS X 10.8.4. |
Is master branch supposed to work now? On Windows, when I trigger a multiline compilation error, I get a strange behaviour with ghc_mod checker: when I move to a line containing error marker, part of the error message interspersed with ^A symbols is displayed at the bottom together with a prompt to 'press Enter or type command to continue'. hlint checker doesn't display anything at all. |
Yes, seems to be working now :) |
ghc-mod now provides "-b" command line option to specify a line separator string. I did not change its default value, ie a Nul string since a lot of confusion would happen. |
I'm still seeing this behavior with Vim 7.4, latest ghc-mod and syntastic. |
@expipiplus1 Please open a new issue. Explain what you did, what you expected to happen, and what happened instead. If you have a test file that can be used to reproduce the problem, post that too. |
@expipiplus1, see #1700 for a related bug. |
No description provided.
The text was updated successfully, but these errors were encountered: