Don't use temporary file for rustfmt fixer
rustfmt normally acts on a file in place, and applies configuration from rustfmt.toml files according to the path of the file. Using a temporary file for rustfmt breaks this functionality, so removing the '%t' from the rustfmt command.
This commit is contained in:
parent
c165c7c5d1
commit
b0eaddadc9
@ -10,8 +10,6 @@ function! ale#fixers#rustfmt#Fix(buffer) abort
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
\ 'command': ale#Escape(l:executable)
|
\ 'command': ale#Escape(l:executable)
|
||||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||||
\ . ' %t',
|
|
||||||
\ 'read_temporary_file': 1,
|
|
||||||
\}
|
\}
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -18,9 +18,7 @@ Execute(The rustfmt callback should return the correct default values):
|
|||||||
|
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ {
|
\ {
|
||||||
\ 'read_temporary_file': 1,
|
\ 'command': ale#Escape('xxxinvalid'),
|
||||||
\ 'command': ale#Escape('xxxinvalid')
|
|
||||||
\ . ' %t',
|
|
||||||
\ },
|
\ },
|
||||||
\ ale#fixers#rustfmt#Fix(bufnr(''))
|
\ ale#fixers#rustfmt#Fix(bufnr(''))
|
||||||
|
|
||||||
@ -30,9 +28,7 @@ Execute(The rustfmt callback should include custom rustfmt options):
|
|||||||
|
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ {
|
\ {
|
||||||
\ 'read_temporary_file': 1,
|
|
||||||
\ 'command': ale#Escape('xxxinvalid')
|
\ 'command': ale#Escape('xxxinvalid')
|
||||||
\ . ' ' . g:ale_rust_rustfmt_options
|
\ . ' ' . g:ale_rust_rustfmt_options,
|
||||||
\ . ' %t',
|
|
||||||
\ },
|
\ },
|
||||||
\ ale#fixers#rustfmt#Fix(bufnr(''))
|
\ ale#fixers#rustfmt#Fix(bufnr(''))
|
||||||
|
Loading…
Reference in New Issue
Block a user