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

Test multiline error messages #15

Closed
benekastah opened this issue Nov 18, 2014 · 4 comments
Closed

Test multiline error messages #15

benekastah opened this issue Nov 18, 2014 · 4 comments

Comments

@benekastah
Copy link
Collaborator

I suspect that multiline error messages will not work currently. We may need to join all lines back into a string with newlines before we feed it to the location/quickfix list. We may also need to gather all errors until the job completes before we populate the list for some checkers.

@ckafi
Copy link

ckafi commented Jan 29, 2015

I currently have this problem with the Kibit Clojure code analyzer. I'm using these settings to parse multiline messages:

setlocal makeprg=lein\ kibit\ %
setlocal errorformat=%IAt\ %f:%l:,%C%m,%Z,%-G%.%#
let g:neomake_clojure_kibit_maker = {
    \ 'exe': 'lein',
    \ 'args': ['kibit'],
    \ 'errorformat': '%IAt\ %f:%l:,%C%m,%Z,%-G%.%#',
    \ }
let g:neomake_clojure_enabled_makers = ['kibit']

Kibits output:

At test.clj:1:
Consider using:
  (when true 42)
instead of:
  (if true 42 nil)

:makes output:

test.clj|1 info|  Consider using: (when true 42) instead of: (if true 42 nil)

:Neomakes output:

test.clj|1 info|  Consider using: (when true 42) instead of:

As you can see, the last line gets lost.

@benekastah
Copy link
Collaborator Author

Yup. I did some investigation, and it looks like multiline messages will work fine, as long as the whole message comes through in the same stdout/stderr event. If it gets split across events, it will mess up the parsing of the message. The best solution I can think of is to make a setting to gather all the maker output before trying to put it in the loclist or quickfix list.

@benekastah
Copy link
Collaborator Author

This feature should be added in e1bce3d. Try adding 'buffer_output': 1 to your kibit maker. It should take care of it for you. Let me know if this resolves it.

@ckafi
Copy link

ckafi commented Feb 1, 2015

Works now as expected. Thanks!

paretje added a commit to paretje/dotfiles that referenced this issue Mar 5, 2016
Unless setting buffer_output, multiline errorformats seem to be parsed
unreliable. Appareantly it only works when both lines come trough the
same event (neomake/neomake#15).
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