Skip to content

Commit

Permalink
rust: Prefer primary spans
Browse files Browse the repository at this point in the history
This would be great improvement to the current situation, where the
first span is used, which is quite often not the right one.

See rust-lang/rust.vim#174

Related to: neomake#2075
  • Loading branch information
dpc committed Sep 6, 2018
1 parent 22c51f3 commit 54f8962
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions autoload/neomake/makers/ft/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ function! neomake#makers#ft#rust#CargoProcessOutput(context) abort
endif

let span = data.spans[0]
for candidate_span in data.spans
if candidate_span.is_primary
let span = candidate_span
end
endfor

let expanded = 0
let has_expansion = type(span.expansion) == type({})
\ && type(span.expansion.span) == type({})
Expand Down

0 comments on commit 54f8962

Please sign in to comment.