summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/rust.vim8
-rw-r--r--autoload/ale/linter.vim3
2 files changed, 10 insertions, 1 deletions
diff --git a/autoload/ale/handlers/rust.vim b/autoload/ale/handlers/rust.vim
index f12c53be..c6a4b670 100644
--- a/autoload/ale/handlers/rust.vim
+++ b/autoload/ale/handlers/rust.vim
@@ -7,6 +7,10 @@ if !exists('g:ale_rust_ignore_error_codes')
let g:ale_rust_ignore_error_codes = []
endif
+if !exists('g:ale_rust_ignore_secondary_spans')
+ let g:ale_rust_ignore_secondary_spans = 0
+endif
+
function! s:FindSpan(buffer, span) abort
if ale#path#IsBufferPath(a:buffer, a:span.file_name) || a:span.file_name is# '<anon>'
return a:span
@@ -47,6 +51,10 @@ function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort
for l:root_span in l:error.spans
let l:span = s:FindSpan(a:buffer, l:root_span)
+ if ale#Var(a:buffer, 'rust_ignore_secondary_spans') && !get(l:span, 'is_primary', 1)
+ continue
+ endif
+
if !empty(l:span)
call add(l:output, {
\ 'lnum': l:span.line_start,
diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim
index 7c1dc53e..dbf9f221 100644
--- a/autoload/ale/linter.vim
+++ b/autoload/ale/linter.vim
@@ -346,8 +346,9 @@ endfunction
function! s:GetAliasedFiletype(original_filetype) abort
let l:buffer_aliases = get(b:, 'ale_linter_aliases', {})
- " b:ale_linter_aliases can be set to a List.
+ " b:ale_linter_aliases can be set to a List or String.
if type(l:buffer_aliases) is v:t_list
+ \|| type(l:buffer_aliases) is v:t_string
return l:buffer_aliases
endif