mirror of https://github.com/dense-analysis/ale
Fix #1202 - Do not use --all-targets by default, because it doesn't work some of the time.
This commit is contained in:
parent
0e57ca3df3
commit
63ecc8341d
|
@ -2,7 +2,7 @@
|
|||
" Description: rustc invoked by cargo for rust files
|
||||
|
||||
call ale#Set('rust_cargo_use_check', 1)
|
||||
call ale#Set('rust_cargo_check_all_targets', 1)
|
||||
call ale#Set('rust_cargo_check_all_targets', 0)
|
||||
|
||||
function! ale_linters#rust#cargo#GetCargoExecutable(bufnr) abort
|
||||
if ale#path#FindNearestFile(a:bufnr, 'Cargo.toml') isnot# ''
|
||||
|
|
|
@ -53,7 +53,7 @@ g:ale_rust_cargo_use_check *g:ale_rust_cargo_use_check*
|
|||
g:ale_rust_cargo_check_all_targets *g:ale_rust_cargo_check_all_targets*
|
||||
*b:ale_rust_cargo_check_all_targets*
|
||||
Type: |Number|
|
||||
Default: `1`
|
||||
Default: `0`
|
||||
|
||||
When set to `1`, ALE will set the `--all-targets` option when `cargo check`
|
||||
is used. See |g:ale_rust_cargo_use_check|,
|
||||
|
|
|
@ -85,23 +85,7 @@ Execute(`cargo build` should be used when g:ale_rust_cargo_use_check is set to 0
|
|||
|
||||
AssertEqual '', ale_linters#rust#cargo#VersionCheck(bufnr(''))
|
||||
|
||||
Execute(`cargo check --all-targets` should be used when the version is new enough):
|
||||
AssertEqual
|
||||
\ 'cargo check --all-targets' . g:suffix,
|
||||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [
|
||||
\ 'cargo 0.22.0 (3423351a5 2017-10-06)',
|
||||
\ ])
|
||||
|
||||
" We should cache the version check
|
||||
AssertEqual
|
||||
\ 'cargo check --all-targets' . g:suffix,
|
||||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [])
|
||||
|
||||
AssertEqual '', ale_linters#rust#cargo#VersionCheck(bufnr(''))
|
||||
|
||||
Execute(--all-targets should not be used when g:ale_rust_cargo_check_all_targets is set to 0):
|
||||
let g:ale_rust_cargo_check_all_targets = 0
|
||||
|
||||
Execute(`cargo check` should be used when the version is new enough):
|
||||
AssertEqual
|
||||
\ 'cargo check' . g:suffix,
|
||||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [
|
||||
|
@ -114,3 +98,19 @@ Execute(--all-targets should not be used when g:ale_rust_cargo_check_all_targets
|
|||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [])
|
||||
|
||||
AssertEqual '', ale_linters#rust#cargo#VersionCheck(bufnr(''))
|
||||
|
||||
Execute(--all-targets should be used when g:ale_rust_cargo_check_all_targets is set to 1):
|
||||
let g:ale_rust_cargo_check_all_targets = 1
|
||||
|
||||
AssertEqual
|
||||
\ 'cargo check --all-targets' . g:suffix,
|
||||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [
|
||||
\ 'cargo 0.22.0 (3423351a5 2017-10-06)',
|
||||
\ ])
|
||||
|
||||
" We should cache the version check
|
||||
AssertEqual
|
||||
\ 'cargo check --all-targets' . g:suffix,
|
||||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [])
|
||||
|
||||
AssertEqual '', ale_linters#rust#cargo#VersionCheck(bufnr(''))
|
||||
|
|
Loading…
Reference in New Issue