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

some way to look at formatted error under cursor #39

Closed
dlants opened this issue Apr 2, 2017 · 3 comments
Closed

some way to look at formatted error under cursor #39

dlants opened this issue Apr 2, 2017 · 3 comments

Comments

@dlants
Copy link

dlants commented Apr 2, 2017

Long error messages (especially type errors) passed to syntastic become quite hard to read, since it seems that psc-ide-vim strips them of newlines during processing.

It would be great to have some easy way to look at the error under the cursor in a pretty-formatted way. Either by passing it to syntastic this way, or through a psc-ide-vim specific command.

Not sure how hard this is -- it seems that it may be a shortcoming of Syntastic/location lists vim-syntastic/syntastic#1700

Thanks for the fantastic plugin!

@coot
Copy link
Collaborator

coot commented Jul 14, 2017

In the current version you can see formatted errors inside vim quick fix list. I tend to use

vert cope

I even have a simple command for that

com Vcopen vert cope|normal <C-W>=

Handy for very long error messages

@coot coot closed this as completed Jul 14, 2017
@dlants
Copy link
Author

dlants commented Jul 15, 2017

Hey @coot thanks for the tip, but sorry if I'm not understanding correctly. Are you saying that when psc-ide-vim populates the quickfix list, you can display it pretty-printed? I haven't been able to get that to happen... from what I understand quickfix can only contain a single line per error, and strips out newline characters (there also seems to be a max line-length, so very long errors get cropped).

@coot
Copy link
Collaborator

coot commented Jul 15, 2017

Yes, that's true. The common workaround for that is to put each line in a single entry and only put the filename and line number in the first one. vim will render it like this:

Test.Main |84 col 8 error| Could not match type
|| 
||     ( avar :: AVAR
||     , console :: CONSOLE
||     , dom :: DOM
||     , enzyme :: ENZYME
||     , st :: ST testRef0
||     | eff1
||     )
|| 
||   with type
|| 
||     ( console :: CONSOLE
||     , dom :: DOM

The GhcMod Haskell plugin is using this feature as well.

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

No branches or pull requests

2 participants